use of com.google.javascript.jscomp.parsing.parser.trees.BinaryOperatorTree in project closure-compiler by google.
the class Parser method parseBitwiseXOR.
// 11.10 Bitwise XOR
private ParseTree parseBitwiseXOR(Expression expressionIn) {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseBitwiseAND(expressionIn);
while (peek(TokenType.CARET)) {
Token operator = eat(TokenType.CARET);
ParseTree right = parseBitwiseAND(expressionIn);
left = new BinaryOperatorTree(getTreeLocation(start), left, operator, right);
}
return left;
}
use of com.google.javascript.jscomp.parsing.parser.trees.BinaryOperatorTree in project closure-compiler by google.
the class Parser method parseExponentiationExpression.
private ParseTree parseExponentiationExpression() {
SourcePosition start = getTreeStartLocation();
ParseTree left = parseUnaryExpression();
if (peek(TokenType.STAR_STAR)) {
// -x**y is a syntax error
if (left.type == ParseTreeType.UNARY_EXPRESSION) {
reportError("Unary operator '%s' requires parentheses before '**'", left.asUnaryExpression().operator);
}
Token operator = nextToken();
ParseTree right = parseExponentiationExpression();
return new BinaryOperatorTree(getTreeLocation(start), left, operator, right);
} else {
return left;
}
}
Aggregations