summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2020-03-01 14:23:51 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2020-03-01 14:35:48 +0900
commitd25a4f413dce6ad3a8baaf61591415b9a8cce082 (patch)
tree3a70e1d5db878ae2dfbe58f0c97d92e7e43df720 /parse.y
parent356e032e1a622c9e34c1c48b516861db10b3b31b (diff)
Allow trailing comma in hash pattern
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index cc6f4b7417..8314f07759 100644
--- a/parse.y
+++ b/parse.y
@@ -4071,6 +4071,10 @@ p_kwargs : p_kwarg ',' p_kwrest
{
$$ = new_hash_pattern_tail(p, new_unique_key_hash(p, $1, &@$), 0, &@$);
}
+ | p_kwarg ','
+ {
+ $$ = new_hash_pattern_tail(p, new_unique_key_hash(p, $1, &@$), 0, &@$);
+ }
| p_kwrest
{
$$ = new_hash_pattern_tail(p, new_hash(p, Qnone, &@$), $1, &@$);