Parent

RPStringScanner

Public Instance Methods

begin_of_line?() click to toggle source
    # File lib/ruby_parser_extras.rb, line 62
62:   def begin_of_line?
63:     pos == 0 or string[pos-1] == \n\
64:   end
current_line() click to toggle source

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
extra_lines_added() click to toggle source
    # File lib/ruby_parser_extras.rb, line 36
36:   def extra_lines_added
37:     @extra_lines_added ||= 0
38:   end
extra_lines_added=(val) click to toggle source
    # File lib/ruby_parser_extras.rb, line 40
40:   def extra_lines_added= val
41:     @extra_lines_added = val
42:   end
getch() click to toggle source
    # 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
Also aliased as: old_getch
lineno() click to toggle source
    # File lib/ruby_parser_extras.rb, line 44
44:   def lineno
45:     string[0...pos].count("\n") + 1 - extra_lines_added
46:   end
old_getch() click to toggle source
Alias for: getch
old_scan(re) click to toggle source
Alias for: scan
scan(re) click to toggle source
    # 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
Also aliased as: old_scan
unread(c) click to toggle source

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
unread_many(str) click to toggle source
    # File lib/ruby_parser_extras.rb, line 56
56:   def unread_many str # TODO: remove this entirely - we should not need it
57:     warn({:unread_many => caller[0]}.inspect) if ENV['TALLY']
58:     self.extra_lines_added += str.count("\n")
59:     string[pos, 0] = str
60:   end
was_begin_of_line() click to toggle source
    # File lib/ruby_parser_extras.rb, line 66
66:   def was_begin_of_line # TODO: kill me
67:     pos <= 2 or string[pos-2] == \n\
68:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.