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.



794
795
796
797
798
799
800
801
802
803
804
805
806
# File 'lib/rdoc/parser/c.rb', line 794

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] ||
    ''

  new_comment comment, @top_level, :c
end