aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2020-03-01 14:23:51 +0900
committerNARUSE, Yui <naruse@airemix.jp>2020-03-27 14:57:36 +0900
commit93aaa0bcce829b880d8f52a9168d17c93ecde85b (patch)
tree2fc71514137e3b41ec3cd0fe2a1e152fc8e3c327 /parse.y
parent5ccf57f23eb7a35ac699edc2fc598c47fa1844a0 (diff)
downloadruby-93aaa0bcce829b880d8f52a9168d17c93ecde85b.tar.gz
Allow trailing comma in hash pattern
(cherry picked from commit d25a4f413dce6ad3a8baaf61591415b9a8cce082)
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 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, &@$);