Reduce p_args rules with p_rest

This commit is contained in:
Vladimir Dementyev 2022-01-11 13:20:19 +03:00 committed by Nobuyoshi Nakada
parent b5310b8975
commit b633c9ac1c
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

16
parse.y
View File

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