diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-01 15:22:08 -0300 |
---|---|---|
committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-06 10:39:07 -0300 |
commit | f6ba87ca8899cd753306ffbca475b16c367995a3 (patch) | |
tree | b68e10e175ea4d9203dfca4577d4db7ee636e8fb /compile.c | |
parent | 4a6bdbd6dc160c4614105f0478d398b2222429e0 (diff) | |
download | ruby-f6ba87ca8899cd753306ffbca475b16c367995a3.tar.gz |
[PRISM] Implement compilation for MultiWriteNodes, fix MultiTargetNodes
Compilation now works for MultiWriteNodes and MultiTargetNodes, with
nesting on MultiWrites. See the tests added in this commit for example
behavior.
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -5274,7 +5274,6 @@ compile_massign0(rb_iseq_t *iseq, LINK_ANCHOR *const pre, LINK_ANCHOR *const rhs int llen = 0; int lpos = 0; - int expand = 1; while (lhsn_count) { llen++; @@ -5312,7 +5311,6 @@ compile_massign0(rb_iseq_t *iseq, LINK_ANCHOR *const pre, LINK_ANCHOR *const rhs } } - if (!state->nested) { NO_CHECK(COMPILE(rhs, "normal masgn rhs", rhsn)); } @@ -5320,9 +5318,7 @@ compile_massign0(rb_iseq_t *iseq, LINK_ANCHOR *const pre, LINK_ANCHOR *const rhs if (!popped) { ADD_INSN(rhs, node, dup); } - if (expand) { - ADD_INSN2(rhs, node, expandarray, INT2FIX(llen), INT2FIX(lhs_splat)); - } + ADD_INSN2(rhs, node, expandarray, INT2FIX(llen), INT2FIX(lhs_splat)); return COMPILE_OK; } |