method
get_class_or_module
ruby latest stable - Class:
RDoc::RubyParser
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.
get_class_or_module(container)private
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/parsers/parse_rb.rb, line 1801
def get_class_or_module(container)
skip_tkspace
name_t = get_tk
# class ::A -> A is in the top level
if name_t.kind_of?(TkCOLON2)
name_t = get_tk
container = @top_level
end
skip_tkspace(false)
while peek_tk.kind_of?(TkCOLON2)
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(NormalModule, name_t.name)
end
get_tk
name_t = get_tk
end
skip_tkspace(false)
return [container, name_t]
end Related methods
- Instance methods
- scan
- Class methods
- new
- Private methods
-
add_token_listener -
collect_first_comment -
error -
get_bool -
get_class_or_module -
get_class_specification -
get_constant -
get_constant_with_optional_parens -
get_symbol_or_name -
get_tk -
get_tkread -
look_for_directives_in -
make_message -
parse_alias -
parse_attr -
parse_attr_accessor -
parse_call_parameters -
parse_class -
parse_constant -
parse_include -
parse_method -
parse_method_or_yield_parameters -
parse_method_parameters -
parse_module -
parse_require -
parse_statements -
parse_symbol_arg -
parse_symbol_in_arg -
parse_toplevel_statements -
parse_visibility -
parse_yield -
parse_yield_parameters -
peek_read -
peek_tk -
progress -
read_directive -
read_documentation_modifiers -
remove_private_comments -
remove_token_listener -
skip_for_variable -
skip_method -
skip_optional_do_after_expression -
skip_tkspace -
skip_tkspace_comment -
unget_tk -
warn