summaryrefslogtreecommitdiff
path: root/ext
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 /ext
parent56524df980f431116a00d0a0012700cbd8f4737f (diff)
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 'ext')
-rw-r--r--ext/-test-/ast/ast.c4
-rw-r--r--ext/objspace/objspace.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/ext/-test-/ast/ast.c b/ext/-test-/ast/ast.c
index ead7400..eab1cfb 100644
--- a/ext/-test-/ast/ast.c
+++ b/ext/-test-/ast/ast.c
@@ -198,10 +198,10 @@ node_children(rb_ast_t *ast, NODE *node)
loop:
return rb_ary_new_from_node_args(ast, 2, node->nd_cond, node->nd_body);
case NODE_ITER:
- goto iter;
case NODE_FOR:
- iter:
return rb_ary_new_from_node_args(ast, 2, node->nd_iter, node->nd_body);
+ case NODE_FOR_MASGN:
+ return rb_ary_new_from_node_args(ast, 1, node->nd_var);
case NODE_BREAK:
goto jump;
case NODE_NEXT:
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index e410941..c791f3a 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -382,6 +382,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_UNTIL);
COUNT_NODE(NODE_ITER);
COUNT_NODE(NODE_FOR);
+ COUNT_NODE(NODE_FOR_MASGN);
COUNT_NODE(NODE_BREAK);
COUNT_NODE(NODE_NEXT);
COUNT_NODE(NODE_REDO);