Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix scalar_scanner to understand strings starting with an underscore and containing only digits #80

Merged
merged 1 commit into from

2 participants

@kreynolds

Title is self-explanatory

@tenderlove
Owner

Thanks!

@tenderlove tenderlove merged commit 06c8c7f into from
@kreynolds

Always a pleasure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 7, 2012
  1. @kreynolds
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.