Loyc.Ecs.Parser.EcsParser.TentativeExpr C# (CSharp) Method

TentativeExpr() private method

private TentativeExpr ( VList attrs, TentativeResult &result, bool allowUnassigned = false ) : LNode
attrs VList
result TentativeResult
allowUnassigned bool
return LNode
		LNode TentativeExpr(VList<LNode> attrs, out TentativeResult result, bool allowUnassigned = false)
		{
			result = new TentativeResult(InputPosition);
			var oldState = _tentative;
			_tentative = new TentativeState(true);
			{
				try {
					bool failed = false;
					result.Result = SubExpr(StartExpr).PlusAttrs(attrs);
					if ((LA0 != EOF && LA0 != TT.Semicolon && LA0 != TT.Comma)) {
						failed = true;
					}
					result.Errors = _tentative.DeferredErrors;
					result.InputPosition = InputPosition;
					if (failed || _tentative.LocalErrorCount != 0) {
						// error(s) occurred.
						InputPosition = result.OldPosition;
						return null;
					}
				} finally {
					_tentative = oldState;
				}
			
			}
			return Apply(result);	// must Apply after finally block
		}
		// Parses an expression (TentativeExpr) or variable declaration (TentativeVarDecl).
EcsParser