should support recursive mlhs decomposition, e.g. (a,b),c = [1,2],3

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-11-22 12:16:59 +09:00
parent b28ec1bc88
commit bce75e2746
2 changed files with 15 additions and 3 deletions
+13 -1
View File
@@ -953,6 +953,18 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val)
}
break;
case NODE_MASGN:
gen_vmassignment(s, tree->car, sp, val);
break;
push();
gen_call(s, tree, attrsym(s, sym(tree->cdr->car)), sp, NOVAL);
pop();
if (val) {
genop_peep(s, MKOP_AB(OP_MOVE, cursp(), sp), val);
}
break;
default:
#ifdef ENABLE_STDIO
printf("unknown lhs %d\n", type);
@@ -1006,7 +1018,7 @@ gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val)
}
}
}
else {
else if (val) {
pop();
}
}