method
collect_first_comment
v1_8_6_287 -
Show latest stable
- Class:
RDoc::Fortran95parser
collect_first_comment(body)private
Collect comment for file entity
# File lib/rdoc/parsers/parse_f95.rb, line 1039
def collect_first_comment(body)
comment = ""
not_comment = ""
comment_start = false
comment_end = false
body.split("\n").each{ |line|
if comment_end
not_comment << line
not_comment << "\n"
elsif /^\s*?!\s?(.*)$/i =~ line
comment_start = true
comment << $1
comment << "\n"
elsif /^\s*?$/i =~ line
comment_end = true if comment_start && COMMENTS_ARE_UPPER
else
comment_end = true
not_comment << line
not_comment << "\n"
end
}
return comment, not_comment
end Related methods
- Instance methods
- scan
- Class methods
- new
- Private methods
-
block_end? -
block_start? -
check_external_aliases -
check_public_methods -
collect_first_comment -
comment_out? -
continuous_line? -
definition_info -
find_arguments -
find_comments -
find_namelists -
find_visibility -
initialize_external_method -
initialize_public_method -
parse_program_or_module -
parse_subprogram -
parse_visibility -
progress -
remove_empty_head_lines -
remove_header_marker -
remove_private_comments -
remove_trailing_alias -
semicolon_to_linefeed -
set_visibility -
united_to_one_line