use of com.google.javascript.jscomp.parsing.parser.trees.EmptyStatementTree in project closure-compiler by google.
the class Parser method parseEmptyStatement.
// 12.3 Empty Statement
private EmptyStatementTree parseEmptyStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.SEMI_COLON);
return new EmptyStatementTree(getTreeLocation(start));
}
use of com.google.javascript.jscomp.parsing.parser.trees.EmptyStatementTree in project closure-compiler by google.
the class Parser method parseCatch.
private CatchTree parseCatch() {
SourcePosition start = getTreeStartLocation();
CatchTree catchBlock;
eat(TokenType.CATCH);
ParseTree exception = new EmptyStatementTree(new SourceRange(getTreeEndLocation(), getTreeStartLocation()));
if (peekToken().type == TokenType.OPEN_PAREN) {
eat(TokenType.OPEN_PAREN);
if (peekPatternStart()) {
exception = parsePattern(PatternKind.INITIALIZER);
} else {
exception = parseIdentifierExpression();
}
eat(TokenType.CLOSE_PAREN);
} else {
recordFeatureUsed(Feature.OPTIONAL_CATCH_BINDING);
}
BlockTree catchBody = parseBlock();
catchBlock = new CatchTree(getTreeLocation(start), exception, catchBody);
return catchBlock;
}
Aggregations