summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authorydah <[email protected]>2024-09-10 00:13:24 +0900
committerYuichiro Kaneko <[email protected]>2024-09-11 09:28:55 +0900
commit4e6091ce09154d735cca025a4d0130eecebbbc19 (patch)
treecea93508f61b03a15b6f28b402ecaea980426aeb /ast.c
parent1adcc41b94d49899b1809fba119f74501fc992b1 (diff)
Implement WHILE and UNTIL NODE locations
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11579
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ast.c b/ast.c
index 031031af95..9219caf653 100644
--- a/ast.c
+++ b/ast.c
@@ -806,6 +806,16 @@ node_locations(VALUE ast_value, const NODE *node)
location_new(nd_code_loc(node)),
location_new(&RNODE_WHEN(node)->keyword_loc),
location_new(&RNODE_WHEN(node)->then_keyword_loc));
+ case NODE_WHILE:
+ return rb_ary_new_from_args(3,
+ location_new(nd_code_loc(node)),
+ location_new(&RNODE_WHILE(node)->keyword_loc),
+ location_new(&RNODE_WHILE(node)->closing_loc));
+ case NODE_UNTIL:
+ return rb_ary_new_from_args(3,
+ location_new(nd_code_loc(node)),
+ location_new(&RNODE_UNTIL(node)->keyword_loc),
+ location_new(&RNODE_UNTIL(node)->closing_loc));
case NODE_ARGS_AUX:
case NODE_LAST:
break;