diff options
author | yui-knk <[email protected]> | 2023-12-29 22:34:35 +0900 |
---|---|---|
committer | Yuichiro Kaneko <[email protected]> | 2024-01-02 14:19:42 +0900 |
commit | 7a050638b19cf6996c498e0c5909c293008cc58a (patch) | |
tree | 00b12eeba0c2230618c9ae46ba3f393d064a42b0 /ast.c | |
parent | 91a0d1c4377bed985db58901065428bcb4bb691f (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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: |