summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-05 11:26:48 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-05 14:23:42 +0900
commit696022a0cb8938c23e5297dd3b6acdec30f2f045 (patch)
treed4a3f8cbb58342441fc627ffcbd04a25c5666d1b /ast.c
parentf5f3b35b9320e0dfaf3c40f00d866dcb595d54ef (diff)
Differentiate `NODE_BREAK`/`NODE_NEXT`/`NODE_RETURN`
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ast.c b/ast.c
index 7090a889ec..622547965f 100644
--- a/ast.c
+++ b/ast.c
@@ -416,9 +416,11 @@ node_children(rb_ast_t *ast, const NODE *node)
case NODE_FOR_MASGN:
return rb_ary_new_from_node_args(ast, 1, RNODE_FOR_MASGN(node)->nd_var);
case NODE_BREAK:
+ return rb_ary_new_from_node_args(ast, 1, RNODE_BREAK(node)->nd_stts);
case NODE_NEXT:
+ return rb_ary_new_from_node_args(ast, 1, RNODE_NEXT(node)->nd_stts);
case NODE_RETURN:
- return rb_ary_new_from_node_args(ast, 1, RNODE_BREAK(node)->nd_stts);
+ return rb_ary_new_from_node_args(ast, 1, RNODE_RETURN(node)->nd_stts);
case NODE_REDO:
return rb_ary_new_from_node_args(ast, 0);
case NODE_RETRY: