use of com.google.javascript.jscomp.parsing.parser.trees.ComprehensionForTree in project closure-compiler by google.
the class Parser method parseComprehensionFor.
private ParseTree parseComprehensionFor() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.FOR);
eat(TokenType.OPEN_PAREN);
ParseTree initializer;
if (peekId()) {
initializer = parseIdentifierExpression();
} else {
initializer = parsePattern(PatternKind.ANY);
}
eatPredefinedString(PredefinedName.OF);
ParseTree collection = parseAssignmentExpression();
eat(TokenType.CLOSE_PAREN);
return new ComprehensionForTree(getTreeLocation(start), initializer, collection);
}
Aggregations