Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #80 from kreynolds/master

Fix scalar_scanner to understand strings starting with an underscore and containing only digits
  • Loading branch information...
commit 06c8c7f7de84cb5a29df01d05149f92f99ea967b 2 parents 2bced7c + 7e7a7df
@tenderlove authored
View
2  lib/psych/scalar_scanner.rb
@@ -24,7 +24,7 @@ def tokenize string
return string if @string_cache.key?(string)
case string
- when /^[A-Za-z~]/
+ when /^[A-Za-z_~]/
if string.length > 5
@string_cache[string] = true
return string
View
4 test/psych/test_scalar_scanner.rb
@@ -87,5 +87,9 @@ def test_scan_float
def test_scan_true
assert_equal true, ss.tokenize('true')
end
+
+ def test_scan_strings_starting_with_underscores
+ assert_equal "_100", ss.tokenize('_100')
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.