Esempio n. 1
0
        // ECMA-262 13.6 If statement

        public Node parseIfStatement(Node node)
        {
            Node test;
            Node consequent, alternate;

            expectKeyword("if");

            expect("(");

            test = parseExpression();

            expect(")");

            consequent = parseStatement();

            if (matchKeyword("else"))
            {
                lex();
                alternate = parseStatement();
            }
            else
            {
                alternate = null;
            }

            return node.finishIfStatement(test, consequent, alternate);
        }