aboutsummaryrefslogtreecommitdiffstats
path: root/ast.c
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2023-12-28 12:38:24 +0900
committerYuichiro Kaneko <spiketeika@gmail.com>2023-12-29 18:32:27 +0900
commit1ade170a6cac402d362d90bbf12e566d6a4f9ba1 (patch)
tree7bb01bb33a31122ecc7733f81842323022c3265a /ast.c
parent6f33e3c53dd97426b91b97b7239a1b9a3dd6a446 (diff)
downloadruby-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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ast.c b/ast.c
index 50a54a9f4b..33b2f61aa2 100644
--- a/ast.c
+++ b/ast.c
@@ -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: