use of com.google.javascript.jscomp.parsing.parser.trees.ConditionalExpressionTree in project closure-compiler by google.
the class Parser method parseConditional.
// 11.12 Conditional Expression
private ParseTree parseConditional(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree condition = parseShortCircuit(expressionIn);
if (peek(TokenType.QUESTION)) {
eat(TokenType.QUESTION);
ParseTree left = parseAssignment(expressionIn);
eat(TokenType.COLON);
ParseTree right = parseAssignment(expressionIn);
return new ConditionalExpressionTree(getTreeLocation(start), condition, left, right);
}
return condition;
}
Aggregations