In Files

  • rdoc/markup/parser.rb

Parent

Class/Module Index [+]

Quicksearch

RDoc::Markup::Parser::MyStringScanner

A simple wrapper of StringScanner that is aware of the current column and lineno

Public Class Methods

new(input) click to toggle source
 
               # File rdoc/markup/parser.rb, line 419
def initialize(input)
  @line = @column = 0
  @s = StringScanner.new input
end
            

Public Instance Methods

[](i) click to toggle source
 
               # File rdoc/markup/parser.rb, line 452
def [](i)
  @s[i]
end
            
eos?() click to toggle source
 
               # File rdoc/markup/parser.rb, line 444
def eos?
  @s.eos?
end
            
matched() click to toggle source
 
               # File rdoc/markup/parser.rb, line 448
def matched
  @s.matched
end
            
newline!() click to toggle source
 
               # File rdoc/markup/parser.rb, line 439
def newline!
  @column = 0
  @line += 1
end
            
pos() click to toggle source
 
               # File rdoc/markup/parser.rb, line 435
def pos
  [@column, @line]
end
            
scan(re) click to toggle source
 
               # File rdoc/markup/parser.rb, line 424
def scan(re)
  ret = @s.scan(re)
  @column += ret.length if ret
  ret
end
            
unscan(s) click to toggle source
 
               # File rdoc/markup/parser.rb, line 430
def unscan(s)
  @s.pos -= s.bytesize
  @column -= s.length
end