use of org.elasticsearch.painless.node.SIfElse in project elasticsearch by elastic.
the class Walker method visitIf.
@Override
public ANode visitIf(IfContext ctx) {
AExpression expression = (AExpression) visit(ctx.expression());
SBlock ifblock = (SBlock) visit(ctx.trailer(0));
if (ctx.trailer().size() > 1) {
SBlock elseblock = (SBlock) visit(ctx.trailer(1));
return new SIfElse(location(ctx), expression, ifblock, elseblock);
} else {
return new SIf(location(ctx), expression, ifblock);
}
}
Aggregations