summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authorydah <[email protected]>2024-09-10 16:41:27 +0900
committerYuichiro Kaneko <[email protected]>2024-09-11 18:01:16 +0900
commitd03e0d1c35638fcd3b474bf604c855f132356e6d (patch)
treefc528b850c077ada83b5da5b20198c3a8abcde46 /ast.c
parentf7ffa76377ead1760dcb0a84db282facb461ecd7 (diff)
Implement BREAK, NEXT and REDO NODE locations
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11584
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ast.c b/ast.c
index 9219caf653..47e7cf595e 100644
--- a/ast.c
+++ b/ast.c
@@ -783,10 +783,22 @@ node_locations(VALUE ast_value, const NODE *node)
return rb_ary_new_from_args(2,
location_new(nd_code_loc(node)),
location_new(&RNODE_AND(node)->operator_loc));
+ case NODE_BREAK:
+ return rb_ary_new_from_args(2,
+ location_new(nd_code_loc(node)),
+ location_new(&RNODE_BREAK(node)->keyword_loc));
+ case NODE_NEXT:
+ return rb_ary_new_from_args(2,
+ location_new(nd_code_loc(node)),
+ location_new(&RNODE_NEXT(node)->keyword_loc));
case NODE_OR:
return rb_ary_new_from_args(2,
location_new(nd_code_loc(node)),
location_new(&RNODE_OR(node)->operator_loc));
+ case NODE_REDO:
+ return rb_ary_new_from_args(2,
+ location_new(nd_code_loc(node)),
+ location_new(&RNODE_REDO(node)->keyword_loc));
case NODE_UNDEF:
return rb_ary_new_from_args(2,
location_new(nd_code_loc(node)),