示例#1
0
        // ECMA-262 13.7 Iteration Statements

        public Node parseDoWhileStatement(Node node)
        {
            List<Node> body;
            Node test;
            bool oldInIteration;

            expectKeyword("do");

            oldInIteration = state.inIteration;
            state.inIteration = true;

            body = new List<Node>() { parseStatement() };

            state.inIteration = oldInIteration;

            expectKeyword("while");

            expect("(");

            test = parseExpression();

            expect(")");

            if (match(";"))
            {
                lex();
            }

            return node.finishDoWhileStatement(body, test);
        }