Sha256: 575a9944840f71d3a72c978aa131f981676f5e91209a9763034c072cd112abbb

Contents?: true

Size: 465 Bytes

Versions: 11

Compression:

Stored size: 465 Bytes

Contents

require 'strscan'

module Shiba
  module Parsers
    class ShibaStringScanner < StringScanner
      def match_quoted_double_escape(quote)
        getch

        str = ""
        while ch = getch
          if ch == quote
            if peek(1) == quote
              str += ch
              str += getch
            else
              return str
            end
          else
            str += ch
          end
        end
        str
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shiba-0.9.4 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.9.3 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.9.2 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.9.1 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.9.0 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.8.1 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.6.4 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.6.3 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.6.2 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.6.1 lib/shiba/parsers/shiba_string_scanner.rb
shiba-0.6.0 lib/shiba/parsers/shiba_string_scanner.rb