Sha256: 61c3bb83a53a310727d97909c36c05352d4e47344989a907412577158c4207d3

Contents?: true

Size: 274 Bytes

Versions: 42

Compression:

Stored size: 274 Bytes

Contents

unless StringScanner.method_defined? :charpos
  class StringScanner
    def charpos
      if string.respond_to?(:byteslice)
        string.byteslice(0, pos).length
      else
        string.unpack("@0a#{pos}").first.force_encoding("UTF-8").length
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
skylight-0.10.6 lib/sql_lexer/string_scanner.rb
skylight-0.10.5 lib/sql_lexer/string_scanner.rb
skylight-0.10.4 lib/sql_lexer/string_scanner.rb
skylight-1.0.0.beta4 lib/sql_lexer/string_scanner.rb
skylight-1.0.0.beta3 lib/sql_lexer/string_scanner.rb
skylight-0.10.3 lib/sql_lexer/string_scanner.rb
skylight-0.10.2 lib/sql_lexer/string_scanner.rb
skylight-1.0.0.beta2 lib/sql_lexer/string_scanner.rb
skylight-0.10.0 lib/sql_lexer/string_scanner.rb
skylight-0.9.4 lib/sql_lexer/string_scanner.rb
skylight-0.9.3 lib/sql_lexer/string_scanner.rb
skylight-0.9.2 lib/sql_lexer/string_scanner.rb
skylight-0.9.1 lib/sql_lexer/string_scanner.rb
skylight-0.9.0 lib/sql_lexer/string_scanner.rb
skylight-0.8.1 lib/sql_lexer/string_scanner.rb
skylight-0.8.0 lib/sql_lexer/string_scanner.rb
skylight-0.8.0.beta.3 lib/sql_lexer/string_scanner.rb
skylight-0.8.0.beta.1 lib/sql_lexer/string_scanner.rb
skylight-0.7.1 lib/sql_lexer/string_scanner.rb
skylight-0.7.0.beta.3 lib/sql_lexer/string_scanner.rb