Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_9_1_378) is shown here.
parse_subprogram(subprogram, params, comment, code, before_contains=nil, function=nil, prefix=nil)private
Parse arguments, comment, code of subroutine and function. Return AnyMethod object.
# File lib/rdoc/parser/f95.rb, line 1007
def parse_subprogram(subprogram, params, comment, code,
before_contains=nil, function=nil, prefix=nil)
subprogram.singleton = false
prefix = "" if !prefix
arguments = params.sub(/\(/, "").sub(/\)/, "").split(",") if params
args_comment, params_opt =
find_arguments(arguments, code.sub(/^s*?contains\s*?(!.*?)?$.*/m, ""),
nil, nil, true)
params_opt = "( " + params_opt + " ) " if params_opt
subprogram.params = params_opt || ""
namelist_comment = find_namelists(code, before_contains)
block_comment = find_comments comment
if function
subprogram.comment = "<b><em> Function </em></b> :: <em>#{prefix}</em>\n"
else
subprogram.comment = "<b><em> Subroutine </em></b> :: <em>#{prefix}</em>\n"
end
subprogram.comment << args_comment if args_comment
subprogram.comment << block_comment if block_comment
subprogram.comment << namelist_comment if namelist_comment
# For output source code
subprogram.start_collecting_tokens
subprogram.add_token Token.new(1,1).set_text(code)
subprogram
end Related methods
- Instance methods
- scan
- 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 -
remove_empty_head_lines -
remove_header_marker -
remove_private_comments -
remove_trailing_alias -
semicolon_to_linefeed -
set_visibility -
united_to_one_line