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:
parent
da3774e5eb
commit
b4229c0a90
2 changed files with 2 additions and 1 deletions
2
parse.y
2
parse.y
|
@ -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!");
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue