зеркало из https://github.com/github/ruby.git
[ruby/prism] Allow returns in default parameter values
https://github.com/ruby/prism/commit/e98ea15596
This commit is contained in:
Родитель
5df5eba465
Коммит
96da3f16a0
|
@ -15446,7 +15446,6 @@ parse_return(pm_parser_t *parser, pm_node_t *node) {
|
|||
case PM_CONTEXT_CASE_IN:
|
||||
case PM_CONTEXT_CASE_WHEN:
|
||||
case PM_CONTEXT_DEFAULT_PARAMS:
|
||||
case PM_CONTEXT_DEF_PARAMS:
|
||||
case PM_CONTEXT_DEFINED:
|
||||
case PM_CONTEXT_ELSE:
|
||||
case PM_CONTEXT_ELSIF:
|
||||
|
@ -15492,6 +15491,7 @@ parse_return(pm_parser_t *parser, pm_node_t *node) {
|
|||
case PM_CONTEXT_BLOCK_RESCUE:
|
||||
case PM_CONTEXT_DEF_ELSE:
|
||||
case PM_CONTEXT_DEF_ENSURE:
|
||||
case PM_CONTEXT_DEF_PARAMS:
|
||||
case PM_CONTEXT_DEF_RESCUE:
|
||||
case PM_CONTEXT_DEF:
|
||||
case PM_CONTEXT_LAMBDA_BRACES:
|
||||
|
|
|
@ -181,3 +181,8 @@ end
|
|||
def foo(bar = (def baz(bar) = bar; 1)) = 2
|
||||
|
||||
def (class Foo; end).foo(bar = 1) = 2
|
||||
|
||||
module Foo
|
||||
def clone(opts = nil || (return self))
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче