context.createNewForLoop(Arity.procArityOf(forNode.getVarNode()).getValue(),
closureBody, closureArgs, hasMultipleArgsHead, argsNodeId, inspector);
}
public void compileGlobalAsgn(Node node, BodyCompiler context, boolean expr) {
final GlobalAsgnNode globalAsgnNode = (GlobalAsgnNode) node;
CompilerCallback value = new CompilerCallback() {
public void call(BodyCompiler context) {
compile(globalAsgnNode.getValueNode(), context, true);
}
};
if (globalAsgnNode.getName().length() == 2) {
switch (globalAsgnNode.getName().charAt(1)) {
case '_':
context.getVariableCompiler().assignLastLine(value);
break;
case '~':
context.getVariableCompiler().assignBackRef(value);
break;
default:
context.assignGlobalVariable(globalAsgnNode.getName(), value);
}
} else {
context.assignGlobalVariable(globalAsgnNode.getName(), value);
}
// TODO: don't require pop
if (!expr) context.consumeCurrentValue();
}