Flowdock
method

parse_class

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: RDoc::RubyParser
parse_class(container, single, tk, comment, &block) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rdoc/parsers/parse_rb.rb, line 1733
    def parse_class(container, single, tk, comment, &block)
      progress("c")

      @stats.num_classes += 1

      container, name_t = get_class_or_module(container)

      case name_t
      when TkCONSTANT
        name = name_t.name
        superclass = "Object"

        if peek_tk.kind_of?(TkLT)
          get_tk
          skip_tkspace(true)
          superclass = get_class_specification
          superclass = "<unknown>" if superclass.empty?
        end

        if single == SINGLE
          cls_type = SingleClass
        else
          cls_type = NormalClass
        end

        cls = container.add_class(cls_type, name, superclass)
        read_documentation_modifiers(cls, 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, &block)
        else
          other = TopLevel.find_class_named(name)
          unless other
#            other = @top_level.add_class(NormalClass, name, nil)
#            other.record_location(@top_level)
#            other.comment = comment
            other = NormalClass.new("Dummy", nil)
          end
          read_documentation_modifiers(other, CLASS_MODIFIERS)
          parse_statements(other, SINGLE, &block)
        end

      else
        warn("Expected class name or '<<'. Got #{name_t.class}: #{name_t.text.inspect}")
      end
    end
Register or log in to add new notes.