summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authoryui-knk <[email protected]>2023-12-29 22:34:35 +0900
committerYuichiro Kaneko <[email protected]>2024-01-02 14:19:42 +0900
commit7a050638b19cf6996c498e0c5909c293008cc58a (patch)
tree00b12eeba0c2230618c9ae46ba3f393d064a42b0 /ast.c
parent91a0d1c4377bed985db58901065428bcb4bb691f (diff)
Introduce NODE_FILE
`__FILE__` was managed by `NODE_STR` with `String` object. This commit introduces `NODE_FILE` and `struct rb_parser_string` so that 1. `__FILE__` is detectable from AST Node 2. Reduce dependency ruby object
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ast.c b/ast.c
index 33b2f61aa2..6c3b2bf04c 100644
--- a/ast.c
+++ b/ast.c
@@ -694,6 +694,8 @@ node_children(rb_ast_t *ast, const NODE *node)
}
case NODE_LINE:
return rb_ary_new_from_args(1, rb_node_line_lineno_val(node));
+ case NODE_FILE:
+ return rb_ary_new_from_args(1, rb_node_file_path_val(node));
case NODE_ERROR:
return rb_ary_new_from_node_args(ast, 0);
case NODE_ARGS_AUX: