diff options
author | yui-knk <spiketeika@gmail.com> | 2024-01-01 01:31:28 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2024-01-09 16:07:19 +0900 |
commit | db476cc71cb6c690bd5b32cebebf7ebcbff604ad (patch) | |
tree | 3fa0bfc4a58f6016e7cad7304e951b063f94209f /ast.c | |
parent | f82a6172a2a96815f9478410116d35c76b56efb5 (diff) | |
download | ruby-db476cc71cb6c690bd5b32cebebf7ebcbff604ad.tar.gz |
Introduce NODE_SYM to manage symbol literal
`:sym` was managed by `NODE_LIT` with `Symbol` object.
This commit introduces `NODE_SYM` so that
1. Symbol literal is detectable from AST Node
2. Reduce dependency on ruby object
Diffstat (limited to 'ast.c')
-rw-r--r-- | ast.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -581,6 +581,8 @@ node_children(rb_ast_t *ast, const NODE *node) } return rb_ary_new_from_args(3, RNODE_DSTR(node)->nd_lit, head, next); } + case NODE_SYM: + return rb_ary_new_from_args(1, rb_node_sym_string_val(node)); case NODE_EVSTR: return rb_ary_new_from_node_args(ast, 1, RNODE_EVSTR(node)->nd_body); case NODE_ARGSCAT: |