From 93aaa0bcce829b880d8f52a9168d17c93ecde85b Mon Sep 17 00:00:00 2001 From: Kazuki Tsujimoto Date: Sun, 1 Mar 2020 14:23:51 +0900 Subject: Allow trailing comma in hash pattern (cherry picked from commit d25a4f413dce6ad3a8baaf61591415b9a8cce082) --- parse.y | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'parse.y') diff --git a/parse.y b/parse.y index c767637adf..b1a7e08e54 100644 --- a/parse.y +++ b/parse.y @@ -4053,6 +4053,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, &@$); -- cgit v1.2.3