Ejemplo n.º 1
0
        private AstItem ReadWhileLoop(TokenIterator tokens)
        {
            //while a > 5 {...}
            tokens.PopExpected(TokenKind.While);
            var whileExpression = ReadExpression(tokens, TokenKind.CurlyBracketOpen);

            tokens.PopExpected(TokenKind.CurlyBracketOpen);
            var statements = ReadStatements(tokens);

            tokens.PopExpected(TokenKind.CurlyBracketClose);
            return(AstItem.WhileLoop(whileExpression, statements));
        }