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
This commit is contained in:
ktsj 2019-04-20 03:37:22 +00:00
parent 27f75cf3dc
commit 243842f68a
4 changed files with 23 additions and 16 deletions

4
ast.c
View file

@ -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: