Search in sources :

Example 1 with ForOfStatementTree

use of com.google.javascript.jscomp.parsing.parser.trees.ForOfStatementTree in project closure-compiler by google.

the class Parser method parseForOfStatement.

// The for-of Statement
// for  (  { let | var }?  identifier  of  expression  )  statement
private ParseTree parseForOfStatement(SourcePosition start, ParseTree initializer) {
    eatPredefinedString(PredefinedName.OF);
    ParseTree collection = parseExpression();
    eat(TokenType.CLOSE_PAREN);
    ParseTree body = parseStatement();
    return new ForOfStatementTree(getTreeLocation(start), initializer, collection, body);
}
Also used : ForOfStatementTree(com.google.javascript.jscomp.parsing.parser.trees.ForOfStatementTree) ParseTree(com.google.javascript.jscomp.parsing.parser.trees.ParseTree)

Aggregations

ForOfStatementTree (com.google.javascript.jscomp.parsing.parser.trees.ForOfStatementTree)1 ParseTree (com.google.javascript.jscomp.parsing.parser.trees.ParseTree)1