Search in sources :

Example 1 with ThrowStatementTree

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

the class Parser method parseThrowStatement.

// 12.13 Throw Statement
private ParseTree parseThrowStatement() {
    SourcePosition start = getTreeStartLocation();
    eat(TokenType.THROW);
    ParseTree value = null;
    if (peekImplicitSemiColon()) {
        reportError("semicolon/newline not allowed after 'throw'");
    } else {
        value = parseExpression();
    }
    eatPossiblyImplicitSemiColon();
    return new ThrowStatementTree(getTreeLocation(start), value);
}
Also used : SourcePosition(com.google.javascript.jscomp.parsing.parser.util.SourcePosition) ThrowStatementTree(com.google.javascript.jscomp.parsing.parser.trees.ThrowStatementTree) ParseTree(com.google.javascript.jscomp.parsing.parser.trees.ParseTree)

Aggregations

ParseTree (com.google.javascript.jscomp.parsing.parser.trees.ParseTree)1 ThrowStatementTree (com.google.javascript.jscomp.parsing.parser.trees.ThrowStatementTree)1 SourcePosition (com.google.javascript.jscomp.parsing.parser.util.SourcePosition)1