Exemplo n.º 1
0
        private Statement ParseExpressionStatement()
        {
            Expression ret = ParseExpression();
            if (!EatSemiOrInteractiveEndOfFile())
                return null;

            if (ret is ErrorExpression)
                NextToken();

            ExpressionStatement stmt = new ExpressionStatement(ret);
            stmt.SetLoc(_globalParent, ret.StartIndex, GetEnd());
            if (!_allowIncomplete) // don't normally allow statements like a, or a + 2, without assigning the value
                stmt = stmt.ValidateExpression();
            return stmt;
        }
Exemplo n.º 2
0
 public override bool Walk(ExpressionStatement node)
 {
     node.Parent = _currentScope;
     return base.Walk(node);
 }