if (vhEval.dataType == DataType.ERROR)
return vhEval;
if (vhEval.size != children.length) {
IllegalArgumentException ia = new IllegalArgumentException("Wrong number of parameters: Expected " + (vhEval.size - 1)
+ ", got " + (children.length - 1));
return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, ia));
}
oldVHs = new ValueHolder[vhEval.size - 1];
for (int i = 1; i < vhEval.size; i++)
oldVHs[i - 1] = ctx.setVarLC(vhEval.getString(i).toLowerCase(), children[i].evaluate(ctx));
try {
Node n = (Node) ctx.getParser().parse(vhEval.getString(0));
return n.evaluate(ctx);
} catch (FormulaParseException e) {
return ValueHolder.valueOf(new EvaluateException(codeLine, codeColumn, e));
} finally {
if (oldVHs != null)
for (int i = 1; i < vhEval.size; i++)
ctx.setVarLC(vhEval.getString(i).toLowerCase(), oldVHs[i - 1]);
}