Class: RPStringScanner

### Home Classes Methods

### In Files

- lib/ruby_parser_extras.rb

### Parent

StringScanner

### Methods

- #charpos
- #d
- #getch
- #old_getch
- #old_scan
- #scan
- #string_to_pos
- #unread_many

### Files

- Manifest.txt
- README.txt

### Class/Module Index

Quicksearch

- RubyParserStuff
- RubyParserStuff::Environment
- RubyParserStuff::Keyword
- RubyParserStuff::Keyword::KWtable
- RubyParserStuff::Ruby18Parser
- RubyParserStuff::Ruby19Parser
- RubyParserStuff::Ruby20Parser
- RubyParserStuff::Ruby21Parser
- RubyParserStuff::RubyParser
- RubyParserStuff::RubyParser::SyntaxError
- RubyParserStuff::Sexp
- RubyParserStuff::StackState
- RubyParserStuff::String
- RubyLexer
- RubyLexer::ScanError
- RPStringScanner
- Ruby18Parser
- Ruby19Parser
- Ruby20Parser
- Ruby21Parser

No matching classes.

# RPStringScanner

### Public Instance Methods

charpos() click to toggle source

    # File lib/ruby_parser_extras.rb, line 50
    def charpos
      string_to_pos.length
    end

d(o) click to toggle source

    # File lib/ruby_parser_extras.rb, line 87
    def d o
      $stderr.puts o.inspect
    end

getch() click to toggle source

    # File lib/ruby_parser_extras.rb, line 72
    def getch
      c = self.old_getch
      p :getch => [c, caller.first]
      c
    end

Also aliased as: old_getch
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
    def scan re
      s = old_scan re
      where = caller.first.split(/:/).first(2).join(":")
      d :scan => [s, where] if s
      s
    end

Also aliased as: old_scan
string_to_pos() click to toggle source

    # File lib/ruby_parser_extras.rb, line 41
    def string_to_pos
      string.byteslice(0, pos)
    end

unread_many(str) click to toggle source

    # File lib/ruby_parser_extras.rb, line 61
    def unread_many str # TODO: remove this entirely - we should not need it
      warn({:unread_many => caller[0]}.inspect) if ENV['TALLY']
      begin
        string[charpos, 0] = str
      rescue IndexError
        # HACK -- this is a bandaid on a dirty rag on an open festering wound
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.