class RDoc::Parser::Ruby

def parse_class_singleton(container, name, comment) # :nodoc:

:nodoc:
def parse_class_singleton(container, name, comment) # :nodoc:
  other = @store.find_class_named name
  unless other then
    if name =~ /^::/ then
      name = $'
      container = @top_level
    end
    other = container.add_module RDoc::NormalModule, name
    record_location other
    # class << $gvar
    other.ignore if name.empty?
    other.add_comment comment, @top_level
  end
  # notify :nodoc: all if not a constant-named class/module
  # (and remove any comment)
  unless name =~ /\A(::)?[A-Z]/ then
    other.document_self = nil
    other.document_children = false
    other.clear_comment
  end
  @top_level.add_to_classes_or_modules other
  @stats.add_class other
  read_documentation_modifiers other, RDoc::CLASS_MODIFIERS
  parse_statements(other, SINGLE)
  other
end