parse_method(container, single, tk, comment)
public
Parses a normal method defined by def
Show source
def parse_method(container, single, tk, comment)
singleton = nil
added_container = false
name = nil
column = tk.char_no
offset = tk.seek
line_no = tk.line_no
start_collecting_tokens
add_token tk
token_listener self do
prev_container = container
name, container, singleton = parse_method_name container
added_container = container != prev_container
end
return unless name
meth = RDoc::AnyMethod.new get_tkread, name
meth.singleton = single == SINGLE ? true : singleton
record_location meth
meth.offset = offset
meth.line = line_no
meth.start_collecting_tokens
indent = TkSPACE.new 0, 1, 1
indent.set_text " " * column
token = TkCOMMENT.new 0, line_no, 1
token.set_text "# File #{@top_level.relative_name}, line #{line_no}"
meth.add_tokens [token, NEWLINE_TOKEN, indent]
meth.add_tokens @token_stream
parse_method_params_and_body container, single, meth, added_container
comment.normalize
comment.extract_call_seq meth
meth.comment = comment
@stats.add_method meth
end