// TODO: don't require pop
if (!expr) context.consumeCurrentValue();
}
public void compileOpAsgnWithMethod(Node node, BodyCompiler context, boolean expr) {
final OpAsgnNode opAsgnNode = (OpAsgnNode) node;
final CompilerCallback receiverCallback = new CompilerCallback() {
public void call(BodyCompiler context) {
compile(opAsgnNode.getReceiverNode(), context, true); // [recv]
}
};
// eval new value, call operator on old value, and assign
ArgumentsCallback argsCallback = new ArgumentsCallback() {
public int getArity() {
return 1;
}
public void call(BodyCompiler context) {
compile(opAsgnNode.getValueNode(), context, true);
}
};
context.getInvocationCompiler().invokeOpAsgnWithMethod(opAsgnNode.getOperatorName(), opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);
// TODO: don't require pop
if (!expr) context.consumeCurrentValue();
}