StringScanner
# File lib/ruby_parser_extras.rb, line 62 62: def begin_of_line? 63: pos == 0 or string[pos-1] == \n\ 64: 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 32 32: def current_line # HAHA fuck you (HACK) 33: string[0..pos][/\A.*__LINE__/].split(/\n/).size 34: end
# File lib/ruby_parser_extras.rb, line 36 36: def extra_lines_added 37: @extra_lines_added ||= 0 38: end
# File lib/ruby_parser_extras.rb, line 40 40: def extra_lines_added= val 41: @extra_lines_added = val 42: end
# File lib/ruby_parser_extras.rb, line 72 72: def getch 73: c = self.old_getch 74: p :getch => [c, caller.first] 75: c 76: end
# File lib/ruby_parser_extras.rb, line 44 44: def lineno 45: string[0...pos].count("\n") + 1 - extra_lines_added 46: end
# File lib/ruby_parser_extras.rb, line 79 79: def scan re 80: s = old_scan re 81: p :scan => [s, caller.first] if s 82: s 83: 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 50 50: def unread c # TODO: remove this entirely - we should not need it 51: return if c.nil? # UGH 52: warn({:unread => caller[0]}.inspect) if ENV['TALLY'] 53: string[pos, 0] = c 54: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.