use of com.google.javascript.jscomp.parsing.parser.trees.DoWhileStatementTree in project closure-compiler by google.
the class Parser method parseDoWhileStatement.
// 12.6 Iteration Statements
// 12.6.1 The do-while Statement
private ParseTree parseDoWhileStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.DO);
ParseTree body = parseStatement();
eat(TokenType.WHILE);
eat(TokenType.OPEN_PAREN);
ParseTree condition = parseExpression();
eat(TokenType.CLOSE_PAREN);
// The semicolon after the "do-while" is optional.
if (peek(TokenType.SEMI_COLON)) {
eat(TokenType.SEMI_COLON);
}
return new DoWhileStatementTree(getTreeLocation(start), body, condition);
}
Aggregations