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.
Show source
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
subprogram.start_collecting_tokens
subprogram.add_token Token.new(1,1).set_text(code)
subprogram
end