Look for the name of a class of module (optionally with a leading
or
with
separated named) and return the ultimate name and container
# File lib/rdoc/parser/ruby.rb, line 1558
def get_class_or_module(container)
skip_tkspace
name_t = get_tk
# class ::A -> A is in the top level
if TkCOLON2 === name_t then
name_t = get_tk
container = @top_level
end
skip_tkspace(false)
while TkCOLON2 === peek_tk do
prev_container = container
container = container.find_module_named(name_t.name)
if !container
# warn("Couldn't find module #{name_t.name}")
container = prev_container.add_module RDoc::NormalModule, name_t.name
end
get_tk
name_t = get_tk
end
skip_tkspace(false)
return [container, name_t]
end