diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-03-03 15:48:53 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-03-03 16:19:49 +0900 |
commit | c8d0bf0156878df03a71fffc97c44abf7333d5d7 (patch) | |
tree | 9bc99adc20fa0538596d84b575ebbc25097771eb | |
parent | 1ad9364440f6685d2df3b855f5e22f644e9f1f43 (diff) |
Preserve `kwarg` flag and fix up f5c904c2a9
-rw-r--r-- | parse.y | 2 | ||||
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -3964,11 +3964,13 @@ p_expr_basic : p_value | tLBRACE { $<tbl>$ = push_pktbl(p); + $<flags>1 = p->in; p->in.kwarg = 0; } p_kwargs rbrace { pop_pktbl(p, $<tbl>2); + p->in.kwarg = $<flags>1.kwarg; $$ = new_hash_pattern(p, Qnone, $3, &@$); } | tLBRACE rbrace diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index 3eea523416..3c4314bbe4 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -1060,6 +1060,8 @@ END in {a: 2} false + in a: {b:}, c: + p c in {a: } _a = a |