aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-16 07:24:53 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-16 07:24:53 +0000
commit4b6f3bce2502e6bbe0a600aef61c8c129fa2af3e (patch)
treeb5f5a66e14d6a0096fd8bf11bca56ee4db66437c /parse.y
parent56524df980f431116a00d0a0012700cbd8f4737f (diff)
downloadruby-4b6f3bce2502e6bbe0a600aef61c8c129fa2af3e.tar.gz
node.c: Stop double meaning of NODE_FOR by introducing NODE_FOR_MASGN
NODE_FOR was used both for "for"-statement itself and for multi-assignment of for-statement (for x, y, in...end). This change separates the two purposes, NODE_FOR for the former, and newly introduced NODE_FOR_MASGN for the latter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 739746ca22..55b4e96184 100644
--- a/parse.y
+++ b/parse.y
@@ -2580,7 +2580,7 @@ primary : literal
switch (nd_type($2)) {
case NODE_MASGN:
- m->nd_next = node_assign(p, $2, NEW_FOR(NEW_DVAR(id, &@2), 0, 0, &@2), &@2);
+ m->nd_next = node_assign(p, $2, NEW_FOR_MASGN(NEW_DVAR(id, &@2), &@2), &@2);
args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &@2), &@2);
break;
case NODE_LASGN:
@@ -2602,7 +2602,7 @@ primary : literal
add_mark_object(p, (VALUE)rb_imemo_alloc_new((VALUE)tbl, 0, 0, 0));
scope = NEW_NODE(NODE_SCOPE, tbl, $5, args, &@$);
tbl[0] = 1; tbl[1] = id;
- $$ = NEW_FOR(0, $4, scope, &@$);
+ $$ = NEW_FOR($4, scope, &@$);
fixpos($$, $2);
/*%
$$ = dispatch3(for, $2, $4, $5);