case FUNCTION_CALL:
Expression fn = operands.get(0);
if (is(fn, Operator.MEMBER_ACCESS)
|| is(fn, Operator.SQUARE_BRACKET)) {
Operation method = (Operation) fn;
JsonML methodName = is(fn, Operator.MEMBER_ACCESS)
? ((Reference) method.children().get(1)).toJsonMLStr()
: method.children().get(1).toJsonML();
return JsonMLBuilder.builder(TagType.InvokeExpr, pos)
.setAttribute(TagAttr.OP, method.getOperator().getSymbol())
.addChild(method.children().get(0))
.addChild(methodName)
.addChildren(operands.subList(1, n))
.build();
} else if (fn instanceof Reference
&& "eval".equals(((Reference) fn).getIdentifierName())) {
return JsonMLBuilder.builder(TagType.EvalExpr, pos)
.addChildren(operands.subList(1, n))
.build();
} else {
return JsonMLBuilder.builder(TagType.CallExpr, pos)
.addChildren(operands)
.build();
}
case MEMBER_ACCESS:
case SQUARE_BRACKET:
JsonML property;
if (op == Operator.MEMBER_ACCESS) {
property = ((Reference) operands.get(1)).toJsonMLStr();
} else {
property = operands.get(1).toJsonML();
}