1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Restore in_kwarg flag properly

This commit is contained in:
Nobuyoshi Nakada 2019-10-29 08:58:39 +09:00
parent da3774e5eb
commit b4229c0a90
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 2 additions and 1 deletions

View file

@ -1557,7 +1557,7 @@ expr : command_call
} }
p_top_expr_body p_top_expr_body
{ {
p->in_kwarg = !!$<num>2; p->in_kwarg = !!$<num>3;
/*%%%*/ /*%%%*/
$$ = NEW_CASE3($1, NEW_IN($4, NEW_TRUE(&@4), NEW_FALSE(&@4), &@4), &@$); $$ = NEW_CASE3($1, NEW_IN($4, NEW_TRUE(&@4), NEW_FALSE(&@4), &@4), &@$);
rb_warn0L(nd_line($$), "Pattern matching is experimental, and the behavior may change in future versions of Ruby!"); rb_warn0L(nd_line($$), "Pattern matching is experimental, and the behavior may change in future versions of Ruby!");

View file

@ -1186,6 +1186,7 @@ END
def test_modifier_in def test_modifier_in
assert_equal true, (1 in a) assert_equal true, (1 in a)
assert_equal 1, a assert_equal 1, a
assert_valid_syntax "p(({} in a:), a:\n 1)"
end end
end end
END_of_GUARD END_of_GUARD