find_const_comment(type, const_name, class_name = nil)
public
Finds a comment matching type and const_name either above
the comment or in the matching Document- section.
# File lib/rdoc/parser/c.rb, line 769
def find_const_comment(type, const_name, class_name = nil)
comment = if @content =~ %((?>^\s*/\*.*?\*/\s+))
rb_define_#{type}\((?:\s*(\w+),)?\s*
"#{const_name}"\s*,
.*?\)\s*;%mi then
$1
elsif class_name and
@content =~ %Document-(?:const|global|variable):\s
#{class_name}::#{const_name}
\s*?\n((?>.*?\*/))%m then
"/*\n#{$1}"
elsif @content =~ %Document-(?:const|global|variable):
\s#{const_name}
\s*?\n((?>.*?\*/))%m then
"/*\n#{$1}"
else
''
end
RDoc::Comment.new comment, @top_level
end