[ruby/rdoc] Treat Proc#call syntax sugar for constant correctly
https://github.com/ruby/rdoc/commit/957d041ae0
This commit is contained in:
parent
819b604037
commit
e50e552693
@ -379,6 +379,10 @@ class RDoc::Parser::Ruby < RDoc::Parser
|
|||||||
|
|
||||||
get_tk
|
get_tk
|
||||||
skip_tkspace_without_nl
|
skip_tkspace_without_nl
|
||||||
|
if :on_lparen == peek_tk[:kind] # ProcObjectInConstant::()
|
||||||
|
parse_method_or_yield_parameters
|
||||||
|
break
|
||||||
|
end
|
||||||
name_t = get_tk
|
name_t = get_tk
|
||||||
unless :on_const == name_t[:kind] || :on_ident == name_t[:kind]
|
unless :on_const == name_t[:kind] || :on_ident == name_t[:kind]
|
||||||
raise RDoc::Error, "Invalid class or module definition: #{given_name}"
|
raise RDoc::Error, "Invalid class or module definition: #{given_name}"
|
||||||
|
@ -830,6 +830,17 @@ end
|
|||||||
assert_equal @top_level, blah.file
|
assert_equal @top_level, blah.file
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_parse_call_syntax_sugar_for_constant
|
||||||
|
util_parser <<-CODE
|
||||||
|
Foo = proc{}
|
||||||
|
Foo::()
|
||||||
|
CODE
|
||||||
|
|
||||||
|
assert_nothing_raised do
|
||||||
|
@parser.scan
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_parse_class_multi_ghost_methods
|
def test_parse_class_multi_ghost_methods
|
||||||
util_parser <<-'CLASS'
|
util_parser <<-'CLASS'
|
||||||
class Foo
|
class Foo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user