aboutsummaryrefslogtreecommitdiffstats
path: root/ast.c
diff options
context:
space:
mode:
authorktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-20 03:37:22 +0000
committerktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-20 03:37:22 +0000
commit243842f68a97a34a36a7e8c690efe7e18bf81e91 (patch)
tree01e3cc7f31dd70d6bb1e1e44bc83d576eb031456 /ast.c
parent27f75cf3dc74ad70d065a7d8a14dbaa0eeac1023 (diff)
downloadruby-243842f68a97a34a36a7e8c690efe7e18bf81e91.tar.gz
Avoid usage of the dummy empty BEGIN node
Use NODE_SPECIAL_NO_NAME_REST instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ast.c b/ast.c
index 5945df95ce..3e25c89a55 100644
--- a/ast.c
+++ b/ast.c
@@ -634,10 +634,12 @@ node_children(rb_ast_t *ast, NODE *node)
case NODE_ARYPTN:
{
struct rb_ary_pattern_info *apinfo = node->nd_apinfo;
+ VALUE rest = NODE_NAMED_REST_P(apinfo->rest_arg) ? NEW_CHILD(ast, apinfo->rest_arg) :
+ ID2SYM(rb_intern("NODE_SPECIAL_NO_NAME_REST"));
return rb_ary_new_from_args(4,
NEW_CHILD(ast, node->nd_pconst),
NEW_CHILD(ast, apinfo->pre_args),
- NEW_CHILD(ast, apinfo->rest_arg),
+ rest,
NEW_CHILD(ast, apinfo->post_args));
}
case NODE_HSHPTN: