Skip to content

Commit 2239d54

Browse files
committed
parse.y: narrow excessed_comma to block_param_def
1 parent cded315 commit 2239d54

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

parse.y

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5008,12 +5008,6 @@ block_param : f_arg ',' f_opt_arg(primary_value) ',' f_rest_arg opt_args_tail(bl
50085008
$$ = new_args(p, $1, 0, $3, 0, $4, &@$);
50095009
/*% ripper: params!($:1, Qnil, $:3, Qnil, *$:4[0..2]) %*/
50105010
}
5011-
| f_arg excessed_comma
5012-
{
5013-
$$ = new_args_tail(p, 0, 0, 0, &@2);
5014-
$$ = new_args(p, $1, 0, $2, 0, $$, &@$);
5015-
/*% ripper: params!($:1, Qnil, $:2, Qnil, Qnil, Qnil, Qnil) %*/
5016-
}
50175011
| f_arg ',' f_rest_arg ',' f_arg opt_args_tail(block_args_tail)
50185012
{
50195013
$$ = new_args(p, $1, 0, $3, $5, $6, &@$);
@@ -5075,6 +5069,15 @@ block_param_def : '|' opt_block_param opt_bv_decl '|'
50755069
$$ = $2;
50765070
/*% ripper: block_var!($:2, $:3) %*/
50775071
}
5072+
| '|' f_arg excessed_comma opt_bv_decl '|'
5073+
{
5074+
p->max_numparam = ORDINAL_PARAM;
5075+
p->ctxt.in_argdef = 0;
5076+
$$ = new_args_tail(p, 0, 0, 0, &@3);
5077+
$$ = new_args(p, $2, 0, $3, 0, $$, &@$);
5078+
/*% ripper: params!($:2, Qnil, $:3, Qnil, Qnil, Qnil, Qnil) %*/
5079+
/*% ripper: block_var!($:$, $:4) %*/
5080+
}
50785081
;
50795082

50805083
opt_block_param : /* none */

0 commit comments

Comments
 (0)