use of org.springframework.expression.spel.ast.OperatorPower in project spring-framework by spring-projects.
the class InternalSpelExpressionParser method eatPowerIncDecExpression.
// powerExpr : unaryExpression (POWER^ unaryExpression)? (INC || DEC) ;
private SpelNodeImpl eatPowerIncDecExpression() {
SpelNodeImpl expr = eatUnaryExpression();
if (peekToken(TokenKind.POWER)) {
//consume POWER
Token t = nextToken();
SpelNodeImpl rhExpr = eatUnaryExpression();
checkRightOperand(t, rhExpr);
return new OperatorPower(toPos(t), expr, rhExpr);
}
if (expr != null && peekToken(TokenKind.INC, TokenKind.DEC)) {
//consume INC/DEC
Token t = nextToken();
if (t.getKind() == TokenKind.INC) {
return new OpInc(toPos(t), true, expr);
}
return new OpDec(toPos(t), true, expr);
}
return expr;
}
Aggregations