diff options
author | yui-knk <spiketeika@gmail.com> | 2023-12-28 12:38:24 +0900 |
---|---|---|
committer | Yuichiro Kaneko <spiketeika@gmail.com> | 2023-12-29 18:32:27 +0900 |
commit | 1ade170a6cac402d362d90bbf12e566d6a4f9ba1 (patch) | |
tree | 7bb01bb33a31122ecc7733f81842323022c3265a /ast.c | |
parent | 6f33e3c53dd97426b91b97b7239a1b9a3dd6a446 (diff) | |
download | ruby-1ade170a6cac402d362d90bbf12e566d6a4f9ba1.tar.gz |
Introduce NODE_LINE
`__LINE__` was managed by `NODE_LIT` with `Integer` object.
This commit introduces `NODE_LINE` so that
1. `__LINE__` 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
@@ -692,6 +692,8 @@ node_children(rb_ast_t *ast, const NODE *node) NEW_CHILD(ast, RNODE_HSHPTN(node)->nd_pkwargs), kwrest); } + case NODE_LINE: + return rb_ary_new_from_args(1, rb_node_line_lineno_val(node)); case NODE_ERROR: return rb_ary_new_from_node_args(ast, 0); case NODE_ARGS_AUX: |