lib/jsonpath.rb in jsonpath-0.4.1 vs lib/jsonpath.rb in jsonpath-0.4.2
- old
+ new
@@ -15,11 +15,11 @@
while not scanner.eos?
if token = scanner.scan(/\$/)
@path << token
elsif token = scanner.scan(/@/)
@path << token
- elsif token = scanner.scan(/[a-zA-Z_]+/)
+ elsif token = scanner.scan(/[a-zA-Z0-9_]+/)
@path << "['#{token}']"
elsif token = scanner.scan(/'(.*?)'/)
@path << "[#{token}]"
elsif token = scanner.scan(/\[/)
count = 1
@@ -36,11 +36,14 @@
end
@path << token
elsif token = scanner.scan(/\.\./)
@path << token
elsif scanner.scan(/\./)
+ nil
elsif token = scanner.scan(/\*/)
@path << token
+ elsif token = scanner.scan(/[><=] \d+/)
+ @path.last << token
elsif token = scanner.scan(/./)
@path.last << token
end
end
end