method
parse_class
v1_9_1_378 -
Show latest stable
- Class:
RDoc::Parser::Ruby
parse_class(container, single, tk, comment)public
No documentation available.
# File lib/rdoc/parser/ruby.rb, line 1873
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(true)
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
@stats.add_class cls
read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
cls.record_location @top_level
parse_statements cls
cls.comment = comment
when TkLSHFT
case name = get_class_specification
when "self", container.name
parse_statements(container, SINGLE)
else
other = RDoc::TopLevel.find_class_named(name)
unless other
# other = @top_level.add_class(NormalClass, name, nil)
# other.record_location(@top_level)
# other.comment = comment
other = RDoc::NormalClass.new "Dummy", nil
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