public void receiveBlockClosureArg(final Node node, IRScope s) { if (node != null) buildBlockArgsAssignment(node, s, null, 0, true, true, false); }
public void receiveBlockClosureArg(final Node node, IRScope s) { if (node != null) buildBlockArgsAssignment(node, s, null, 0, true, true, false); }
public void receiveBlockArgs(final IterNode node, IRScope s) { buildBlockArgsAssignment(node.getVarNode(), s, null, 0, true, false, false); }
public void receiveBlockArgs(final IterNode node, IRScope s) { buildBlockArgsAssignment(node.getVarNode(), s, null, 0, true, false, false); }
public void receiveBlockArgs(final IterNode node) { Node args = node.getVarNode(); if (args instanceof ArgsNode) { // regular blocks ((IRClosure) scope).setArgumentDescriptors(Helpers.argsNodeToArgumentDescriptors(((ArgsNode) args))); receiveArgs((ArgsNode)args); } else { // for loops -- reuse code in IRBuilder:buildBlockArgsAssignment buildBlockArgsAssignment(args, null, 0, false); } }
public void receiveBlockArgs(final IterNode node) { Node args = node.getVarNode(); if (args instanceof ArgsNode) { // regular blocks ((IRClosure) scope).setArgumentDescriptors(Helpers.argsNodeToArgumentDescriptors(((ArgsNode) args))); receiveArgs((ArgsNode)args); } else { // for loops -- reuse code in IRBuilder:buildBlockArgsAssignment buildBlockArgsAssignment(args, null, 0, false); } }
public void buildVersionSpecificBlockArgsAssignment(Node node) { if (!(scope instanceof IRFor)) throw new NotCompilableException("Should not have come here for block args assignment in 1.9 mode: " + node); // Argh! For-loop bodies and regular iterators are different in terms of block-args! switch (node.getNodeType()) { case MULTIPLEASGNNODE: { ListNode sourceArray = ((MultipleAsgnNode) node).getPre(); int i = 0; for (Node an: sourceArray.children()) { // Use 1.8 mode version for this buildBlockArgsAssignment(an, null, i, false); i++; } break; } default: throw new NotCompilableException("Can't build assignment node: " + node); } }
public void buildVersionSpecificBlockArgsAssignment(Node node) { if (!(scope instanceof IRFor)) throw new NotCompilableException("Should not have come here for block args assignment in 1.9 mode: " + node); // Argh! For-loop bodies and regular iterators are different in terms of block-args! switch (node.getNodeType()) { case MULTIPLEASGNNODE: { ListNode sourceArray = ((MultipleAsgnNode) node).getPre(); int i = 0; for (Node an: sourceArray.children()) { // Use 1.8 mode version for this buildBlockArgsAssignment(an, null, i, false); i++; } break; } default: throw new NotCompilableException("Can't build assignment node: " + node); } }
for (Node an: sourceArray.childNodes()) { if (values == null) { buildBlockArgsAssignment(an, s, argsArray, i, false, false, false); } else { Variable rhsVal = s.getNewTemporaryVariable(); buildBlockArgsAssignment(argsNode, s, argsArray, i, false, false, true); // rest of the argument array!
for (Node an: sourceArray.childNodes()) { if (values == null) { buildBlockArgsAssignment(an, s, argsArray, i, false, false, false); } else { Variable rhsVal = s.getNewTemporaryVariable(); buildBlockArgsAssignment(argsNode, s, argsArray, i, false, false, true); // rest of the argument array!