in src/main/java/org/apache/sling/scripting/sightly/impl/compiler/optimization/reduce/ExpressionReducer.java [61:78]
private EvalResult eval(ExpressionNode node) {
try {
return node.accept(this);
} catch (SightlyCompilerException e) {
if (node instanceof BinaryOperation) {
BinaryOperation binaryOperation = (BinaryOperation) node;
Expression parentExpression = binaryOperation.getParentExpression();
if (parentExpression != null) {
throw new SightlyCompilerException(e.getMessage(), parentExpression.getRawText());
}
}
throw e;
} catch (Exception e) {
// evaluating constant expressions may lead to errors (like division by zero)
// in this case we leave the nodes as-is.
return EvalResult.nonConstant(node);
}
}