Search in sources :

Example 1 with UnaryExpressionTree

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

the class Parser method parseUnaryExpression.

// 11.4 Unary Operator
private ParseTree parseUnaryExpression() {
    SourcePosition start = getTreeStartLocation();
    if (peekUnaryOperator()) {
        Token operator = nextToken();
        ParseTree operand = parseUnaryExpression();
        return new UnaryExpressionTree(getTreeLocation(start), operator, operand);
    } else if (peekAwaitExpression()) {
        return parseAwaitExpression();
    } else {
        return parseUpdateExpression();
    }
}
Also used : UnaryExpressionTree(com.google.javascript.jscomp.parsing.parser.trees.UnaryExpressionTree) SourcePosition(com.google.javascript.jscomp.parsing.parser.util.SourcePosition) ParseTree(com.google.javascript.jscomp.parsing.parser.trees.ParseTree)

Aggregations

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