summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authorydah <[email protected]>2024-09-05 11:07:13 +0900
committerYuichiro Kaneko <[email protected]>2024-09-05 13:03:28 +0900
commit32680f543c6fc515870d4f5c6829607dc67d59ef (patch)
treeb374d3dc7b41e582a28b48d04540e29db81648b7 /ast.c
parent294dad22d7ac5f307d567cff897507b9fd9d05e9 (diff)
Implement AND/OR NODE operator locations
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11543
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ast.c b/ast.c
index 12366dd432..67d121e1ce 100644
--- a/ast.c
+++ b/ast.c
@@ -779,6 +779,14 @@ node_locations(VALUE ast_value, const NODE *node)
return rb_ary_new_from_args(2,
location_new(nd_code_loc(node)),
location_new(&RNODE_ALIAS(node)->keyword_loc));
+ case NODE_AND:
+ return rb_ary_new_from_args(2,
+ location_new(nd_code_loc(node)),
+ location_new(&RNODE_AND(node)->operator_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_UNDEF:
return rb_ary_new_from_args(2,
location_new(nd_code_loc(node)),