Parses the name of a metaprogrammed method. comment is used to
determine the name while tk is used in an error message if the name cannot be
determined.
# File lib/rdoc/parser/ruby.rb, line 1231
def parse_meta_method_name comment, tk # :nodoc:
if comment.text.sub!(/^# +:?method: *(\S*).*?\n/, '') then
return $1 unless $1.empty?
end
name_t = get_tk
case name_t
when TkSYMBOL then
name_t.text[1..-1]
when TkSTRING then
name_t.value[1..-2]
when TkASSIGN then # ignore
remove_token_listener self
nil
else
warn "unknown name token #{name_t.inspect} for meta-method '#{tk.name}'"
'unknown'
end
end