Use String#unpack instead of String#codepoints.
The latter returns an Enumerable which on Ruby 1.9.3 doesn't have #length available. Besides this it's better to just return an Array since we'll iterate over every character anyway.
This commit is contained in:
parent
a2452b6371
commit
19c1d66287
|
@ -95,7 +95,7 @@ module Oga
|
|||
# @return [Array]
|
||||
#
|
||||
def lex(data)
|
||||
@data = data.codepoints
|
||||
@data = data.unpack('U*')
|
||||
lexer_start = self.class.lexer_start
|
||||
eof = data.length
|
||||
|
||||
|
|
Loading…
Reference in New Issue