class RDoc::Parser::Ruby
def parse_comment(container, tk, comment)
def parse_comment(container, tk, comment) line_no = tk.line_no column = tk.char_no singleton = !!comment.sub!(/(^# +:?)(singleton-)(method:)/, '\1\3') # REFACTOR if comment.sub!(/^# +:?method: *(\S*).*?\n/i, '') then name = $1 unless $1.empty? meth = RDoc::GhostMethod.new get_tkread, name meth.singleton = singleton meth.start_collecting_tokens indent = TkSPACE.new nil, 1, 1 indent.set_text " " * column position_comment = TkCOMMENT.new nil, line_no, 1 position_comment.set_text "# File #{@top_level.absolute_name}, line #{line_no}" meth.add_tokens [position_comment, NEWLINE_TOKEN, indent] meth.params = '' extract_call_seq comment, meth return unless meth.name container.add_method meth if meth.document_self meth.comment = comment @stats.add_method meth elsif comment.sub!(/# +:?(attr(_reader|_writer|_accessor)?:) *(\S*).*?\n/i, '') then rw = case $1 when 'attr_reader' then 'R' when 'attr_writer' then 'W' else 'RW' end name = $3 unless $3.empty? att = RDoc::Attr.new get_tkread, name, rw, comment container.add_attribute att @stats.add_method att end end