Parent

RPStringScanner

Public Instance Methods

begin_of_line?() click to toggle source
    # File lib/ruby_parser_extras.rb, line 54
54:   def begin_of_line?
55:     pos == 0 or string[pos-1] == \n\
56:   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 33
33:   def current_line # HAHA fuck you (HACK)
34:     string[0..pos][/\A.*__LINE__/].split(/\n/).size
35:   end
getch() click to toggle source
    # 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
Also aliased as: old_getch
lineno() click to toggle source
    # File lib/ruby_parser_extras.rb, line 37
37:   def lineno
38:     string[0...pos].count("\n") + 1
39:   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 71
71:     def scan re
72:       s = old_scan re
73:       p :scan => [s, caller.first] if s
74:       s
75:     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 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
unread_many(str) click to toggle source
    # File lib/ruby_parser_extras.rb, line 49
49:   def unread_many str # TODO: remove this entirely - we should not need it
50:     warn({:unread_many => caller[0]}.inspect) if ENV['TALLY']
51:     string[pos, 0] = str
52:   end
was_begin_of_line() click to toggle source
    # File lib/ruby_parser_extras.rb, line 58
58:   def was_begin_of_line # TODO: kill me
59:     pos <= 2 or string[pos-2] == \n\
60:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.