method
parse_class
v1_9_2_180 -
Show latest stable
- Class:
RDoc::Parser::Ruby
parse_class(container, single, tk, comment)public
No documentation available.
# File lib/rdoc/parser/ruby.rb, line 542
def parse_class(container, single, tk, comment)
container, name_t = get_class_or_module container
case name_t
when TkCONSTANT
name = name_t.name
superclass = "Object"
if TkLT === peek_tk then
get_tk
skip_tkspace
superclass = get_class_specification
superclass = "<unknown>" if superclass.empty?
end
cls_type = single == SINGLE ? RDoc::SingleClass : RDoc::NormalClass
cls = container.add_class cls_type, name, superclass
read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
cls.record_location @top_level
cls.comment = comment
@stats.add_class cls
parse_statements cls
when TkLSHFT
case name = get_class_specification
when "self", container.name
parse_statements container, SINGLE
when /\A[A-Z]/
other = RDoc::TopLevel.find_class_named name
unless other then
other = container.add_module RDoc::NormalModule, name
other.record_location @top_level
other.comment = comment
end
@stats.add_class other
read_documentation_modifiers other, RDoc::CLASS_MODIFIERS
parse_statements(other, SINGLE)
end
else
warn("Expected class name or '<<'. Got #{name_t.class}: #{name_t.text.inspect}")
end
end