def find_body class_name, meth_name, meth_obj, file_content, quiet = false
case file_content
when %((?>/\*.*?\*/\s*)?)
((?:(?:static|SWIGINTERN)\s+)?
(?:intern\s+)?VALUE\s+
\s*(\([^)]*\))([^;]|$))%m then
comment = $1
body = $2
offset = $~.offset(2).first
remove_private_comments comment if comment
body = $& if /#{Regexp.escape body}[^(]*?\{.*?^\}/ =~ file_content
override_comment = find_override_comment class_name, meth_obj
comment = override_comment if override_comment
find_modifiers comment, meth_obj if comment
meth_obj.start_collecting_tokens
tk = RDoc::RubyToken::Token.new nil, 1, 1
tk.set_text body
meth_obj.add_token tk
meth_obj.comment = strip_stars comment
meth_obj.offset = offset
meth_obj.line = file_content[0, offset].count("\n") + 1
body
when %((?>/\*.*?\*/\s*))^\s*(\
comment = $1
body = $2
offset = $~.offset(2).first
find_body class_name, $3, meth_obj, file_content, true
find_modifiers comment, meth_obj
meth_obj.start_collecting_tokens
tk = RDoc::RubyToken::Token.new nil, 1, 1
tk.set_text body
meth_obj.add_token tk
meth_obj.comment = strip_stars(comment) + meth_obj.comment.to_s
meth_obj.offset = offset
meth_obj.line = file_content[0, offset].count("\n") + 1
body
when %^\s*\#\s*define\s+#{meth_name}\s+(\w+)% then
# with no comment we hope the aliased definition has it and use it's
# definition
body = find_body(class_name, $1, meth_obj, file_content, true)
return body if body
warn "No definition for #{meth_name}" if @options.verbosity > 1
false
else # No body, but might still have an override comment
comment = find_override_comment class_name, meth_obj
if comment then
find_modifiers comment, meth_obj
meth_obj.comment = strip_stars comment
''
else
warn "No definition for #{meth_name}" if @options.verbosity > 1
false
end
end
end