diff options
author | Vladimir Dementyev <dementiev.vm@gmail.com> | 2022-01-11 13:20:19 +0300 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-01-11 19:58:57 +0900 |
commit | b633c9ac1cc06610c09aaeba1faa2bf3da7d2be0 (patch) | |
tree | 8d64b13f28f7af5553495f641d3e1e232b28b564 /parse.y | |
parent | b5310b8975dffd18a90e149e00673b585101cab8 (diff) | |
download | ruby-b633c9ac1cc06610c09aaeba1faa2bf3da7d2be0.tar.gz |
Reduce p_args rules with p_rest
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -4319,21 +4319,13 @@ p_args : p_expr $$ = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &@$); %*/ } - | p_args_head tSTAR tIDENTIFIER + | p_args_head p_rest { - $$ = new_array_pattern_tail(p, $1, 1, $3, Qnone, &@$); + $$ = new_array_pattern_tail(p, $1, 1, $2, Qnone, &@$); } - | p_args_head tSTAR tIDENTIFIER ',' p_args_post + | p_args_head p_rest ',' p_args_post { - $$ = new_array_pattern_tail(p, $1, 1, $3, $5, &@$); - } - | p_args_head tSTAR - { - $$ = new_array_pattern_tail(p, $1, 1, 0, Qnone, &@$); - } - | p_args_head tSTAR ',' p_args_post - { - $$ = new_array_pattern_tail(p, $1, 1, 0, $4, &@$); + $$ = new_array_pattern_tail(p, $1, 1, $2, $4, &@$); } | p_args_tail ; |