Beispiel #1
0
        private Expression ParseArrayLiteral()
        {
            List<Expression> values = new List<Expression>();
            Eat(TokenKind.LeftBracket);
            var start = GetStart();

            if (!MaybeEat(TokenKind.RightBracket))
            {
                do
                {
                    Expression exp = ParseExpression();
                    if (exp == null)
                        return null;

                    values.Add(exp);
                } while (MaybeEat(TokenKind.Comma));
                Eat(TokenKind.RightBracket);
            }

            var ret = new ArrayLiteralExpression(values.ToArray());
            ret.SetLoc(_globalParent, start, GetEnd());
            return ret;
        }
Beispiel #2
0
 public override bool Walk(ArrayLiteralExpression node)
 {
     node.Parent = _currentScope;
     return base.Walk(node);
 }