# File lib/rcodetools/doc.rb, line 49
49: def __prepare_line(x)
50: v = "#{VAR}"
51: result = "#{VAR}_result"
52: klass = "#{VAR}_klass"
53: flag = "#{VAR}_flag"
54: which_methods = "#{VAR}_methods"
55: ancestor_class = "#{VAR}_ancestor_class"
56: idx = 1
57: recv = x[:recv] || x[:klass] || raise(ArgumentError, "need :recv or :klass")
58: meth = x[:meth_or_constant] || x[:meth]
59: debugprint "recv=#{recv}", "meth=#{meth}"
60: if meth
61: # imported from fastri/MagicHelp
62: code = #{v} = (#{recv})$stderr.print("#{MARKER}[#{idx}] => " + #{v}.class.to_s + " ")if Module === #{v} and '#{meth}' =~ /^[A-Z]/ and #{v}.const_defined?('#{meth}') #{result} = #{v}.to_s + "::#{meth}"else #{__magic_help_code result, v, meth.dump}end$stderr.puts(#{result})exit
63: else
64: code = #{v} = (#{recv})$stderr.print("#{MARKER}[#{idx}] => " + #{v}.class.to_s + " ")$stderr.puts(#{v}.to_s)exit
65: end
66: oneline_ize(code)
67: end
overridable by module
# File lib/rcodetools/doc.rb, line 87
87: def _doc(code, lineno, column)
88: end
# File lib/rcodetools/doc.rb, line 90
90: def doc(code, lineno, column=nil)
91: _doc(code, lineno, column) or runtime_data(code, lineno, column).to_s
92: end
# File lib/rcodetools/doc.rb, line 19
19: def prepare_line(expr, column)
20: set_expr_and_postfix!(expr, column){|c|
21: withop_re = /^.{#{c-1}}[#{OPERATOR_CHARS}]+/
22: if expr =~ withop_re
23: withop_re
24: else
25: /^.{#{c}}[\w#{OPERATOR_CHARS}]*/
26: end
27: }
28: recv = expr
29:
30: # When expr already knows receiver and method,
31: return(__prepare_line :recv => expr.eval_string, :meth => expr.meth) if expr.eval_string
32:
33: case expr
34: when /^(?:::)?([A-Z].*)(?:::|\.)(.*)$/ # nested constants / class methods
35: __prepare_line :klass => $1, :meth_or_constant => $2
36: when /^(?:::)?[A-Z]/ # normal constants
37: __prepare_line :klass => expr
38: when /\.([^.]*)$/ # method call
39: __prepare_line :recv => Regexp.last_match.pre_match, :meth => $1
40: when /^(.+)(\[\]=?)$/ # [], []=
41: __prepare_line :recv => $1, :meth => $2
42: when /[#{OPERATOR_CHARS}]+$/ # operator
43: __prepare_line :recv => Regexp.last_match.pre_match, :meth => $&
44: else # bare words
45: __prepare_line :recv => "self", :meth => expr
46: end
47: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.