From 7efe4e088165cfa182fed92e24c95508714750ab Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 20 Jan 2018 05:47:59 +0000 Subject: [PATCH] parse.y: moved excessed_comma * parse.y (block_param): embed excessed_comma event result in place of rest argument, instead of dispatching with the whole parameters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/parse.y b/parse.y index 10e7f84a8d..69e97e09e9 100644 --- a/parse.y +++ b/parse.y @@ -2888,8 +2888,16 @@ block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail } | f_arg ',' { - $$ = new_args(p, $1, Qnone, 1, Qnone, new_args_tail(p, Qnone, Qnone, Qnone, &@1), &@$); - /*% ripper: excessed_comma!("$$") %*/ +#ifndef RIPPER + /* magic number for rest_id in iseq_set_arguments() */ + const ID excessed_comma = 1; +#else + const VALUE excessed_comma = + /*% ripper: excessed_comma! %*/ + ; +#endif + $$ = new_args_tail(p, Qnone, Qnone, Qnone, &@1); + $$ = new_args(p, $1, Qnone, excessed_comma, Qnone, $$, &@$); } | f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail {