for (Node an: masgnPre.childNodes()) {
if (values == null) {
buildArgsMasgn(an, s, argsArray, false, -1, -1, i, false);
} else {
Variable rhsVal = s.getNewTemporaryVariable();
s.addInstr(new ReqdArgMultipleAsgnInstr(rhsVal, values, i));
buildAssignment(an, s, rhsVal);
}
i++;
}
}
// Build an assignment for a splat, if any, with the rest of the operands!
Node restNode = multipleAsgnNode.getRest();
int postArgsCount = multipleAsgnNode.getPostCount();
if (restNode != null) {
if (restNode instanceof StarNode) {
// do nothing
} else if (values == null) {
buildArgsMasgn(restNode, s, argsArray, false, i, postArgsCount, 0, true); // rest of the argument array!
} else {
Variable rhsVal = s.getNewTemporaryVariable();
s.addInstr(new RestArgMultipleAsgnInstr(rhsVal, values, i, postArgsCount, 0));
buildAssignment(restNode, s, rhsVal); // rest of the argument array!
}
}
// Build assignments for rest of the operands
final ListNode masgnPost = multipleAsgnNode.getPost();
if (masgnPost != null) {
int j = 0;
for (Node an: masgnPost.childNodes()) {
if (values == null) {
buildArgsMasgn(an, s, argsArray, false, i, postArgsCount, j, false);
} else {
Variable rhsVal = s.getNewTemporaryVariable();
s.addInstr(new ReqdArgMultipleAsgnInstr(rhsVal, values, i, postArgsCount, j)); // Fetch from the end
buildAssignment(an, s, rhsVal);
}
j++;
}
}