зеркало из https://github.com/github/ruby.git
Restore `in_kwarg` flag properly
This commit is contained in:
Родитель
da3774e5eb
Коммит
b4229c0a90
2
parse.y
2
parse.y
|
@ -1557,7 +1557,7 @@ expr : command_call
|
|||
}
|
||||
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), &@$);
|
||||
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
|
||||
assert_equal true, (1 in a)
|
||||
assert_equal 1, a
|
||||
assert_valid_syntax "p(({} in a:), a:\n 1)"
|
||||
end
|
||||
end
|
||||
END_of_GUARD
|
||||
|
|
Загрузка…
Ссылка в новой задаче