Sha256: a3897efccc2eb1b7d83f9e2ce2daaa13363fdc24431aae7698fcec8d7736a529

Contents?: true

Size: 292 Bytes

Versions: 36

Compression:

Stored size: 292 Bytes

Contents

module RBS
  class CharScanner < StringScanner
    def initialize(string)
      super(string)
      @charpos = 0
    end

    alias original_charpos charpos

    def charpos
      @charpos
    end

    def scan(pattern)
      s = super
      @charpos += s.size if s
      s
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
rbs-1.7.0.beta.2 lib/rbs/char_scanner.rb
rbs-1.7.0.beta.1 lib/rbs/char_scanner.rb
rbs-1.6.2 lib/rbs/char_scanner.rb
rbs-1.6.1 lib/rbs/char_scanner.rb
rbs-1.6.0 lib/rbs/char_scanner.rb
rbs-1.5.1 lib/rbs/char_scanner.rb
rbs-1.5.0 lib/rbs/char_scanner.rb
rbs-1.4.0 lib/rbs/char_scanner.rb
rbs-1.3.3 lib/rbs/char_scanner.rb
rbs-1.3.2 lib/rbs/char_scanner.rb
rbs-1.3.1 lib/rbs/char_scanner.rb
rbs-1.3.0 lib/rbs/char_scanner.rb
rbs-1.2.1 lib/rbs/char_scanner.rb
rbs-1.2.0 lib/rbs/char_scanner.rb
rbs-1.1.1 lib/rbs/char_scanner.rb
rbs-1.1.0 lib/rbs/char_scanner.rb