Method: RDoc::Parser::C#find_const_comment

Defined in:
lib/rdoc/parser/c.rb

#find_const_comment(type, const_name, class_name = nil) ⇒ Object

Finds a comment matching type and const_name either above the comment or in the matching Document- section.



774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/rdoc/parser/c.rb', line 774

def find_const_comment(type, const_name, class_name = nil)
  @const_table ||= {}
  @const_table[@content] ||= gen_const_table @content
  table = @const_table[@content]

  comment =
    table[[type, const_name]] ||
    (class_name && table[class_name + "::" + const_name]) ||
    table[const_name] ||
    ''

  RDoc::Comment.new comment, @top_level, :c
end