StringScanner
# File lib/ruby_parser_extras.rb, line 54
54: def begin_of_line?
55: pos == 0 or string[pos-1] == \n\
56: end
if ENV[‘TALLY’] then
alias :old_getch :getch
def getch
warn({:getch => caller[0]}.inspect)
old_getch
end
end
# File lib/ruby_parser_extras.rb, line 33
33: def current_line # HAHA fuck you (HACK)
34: string[0..pos][/\A.*__LINE__/].split(/\n/).size
35: end
# File lib/ruby_parser_extras.rb, line 64
64: def getch
65: c = self.old_getch
66: p :getch => [c, caller.first]
67: c
68: end
# File lib/ruby_parser_extras.rb, line 37
37: def lineno
38: string[0...pos].count("\n") + 1
39: end
# File lib/ruby_parser_extras.rb, line 71
71: def scan re
72: s = old_scan re
73: p :scan => [s, caller.first] if s
74: s
75: end
TODO: once we get rid of these, we can make things like TODO: current_line and lineno much more accurate and easy to do
# File lib/ruby_parser_extras.rb, line 43
43: def unread c # TODO: remove this entirely - we should not need it
44: return if c.nil? # UGH
45: warn({:unread => caller[0]}.inspect) if ENV['TALLY']
46: string[pos, 0] = c
47: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.