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-2.5.1 lib/rbs/char_scanner.rb
rbs-2.5.0 lib/rbs/char_scanner.rb
rbs-2.4.0 lib/rbs/char_scanner.rb
rbs-2.3.2 lib/rbs/char_scanner.rb
rbs-2.3.1 lib/rbs/char_scanner.rb
rbs-2.3.0 lib/rbs/char_scanner.rb
rbs-2.2.2 lib/rbs/char_scanner.rb
rbs-2.2.1 lib/rbs/char_scanner.rb
rbs-2.2.0 lib/rbs/char_scanner.rb
rbs-2.1.0 lib/rbs/char_scanner.rb
rbs-2.0.0 lib/rbs/char_scanner.rb
rbs-2.0.0.pre2 lib/rbs/char_scanner.rb
rbs-2.0.0.pre1 lib/rbs/char_scanner.rb
rbs-1.8.1 lib/rbs/char_scanner.rb
rbs-1.8.0 lib/rbs/char_scanner.rb
rbs-1.7.1 lib/rbs/char_scanner.rb
rbs-1.7.0 lib/rbs/char_scanner.rb
rbs-1.7.0.beta.5 lib/rbs/char_scanner.rb
rbs-1.7.0.beta.4 lib/rbs/char_scanner.rb
rbs-1.7.0.beta.3 lib/rbs/char_scanner.rb