* ext/psych/lib/psych/scalar_scanner.rb: Updated the RegExp to catch
Strings earlier in the tokenization process. Thanks Kevin Menard! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b3fb872d9d
commit
ca0cf16734
@ -1,3 +1,8 @@
|
|||||||
|
Tue Oct 23 06:15:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
|
* ext/psych/lib/psych/scalar_scanner.rb: Updated the RegExp to catch
|
||||||
|
Strings earlier in the tokenization process. Thanks Kevin Menard!
|
||||||
|
|
||||||
Tue Oct 23 06:12:39 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
Tue Oct 23 06:12:39 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* ext/psych/lib/psych/visitors/to_ruby.rb: Handle nil tags specially
|
* ext/psych/lib/psych/visitors/to_ruby.rb: Handle nil tags specially
|
||||||
|
@ -24,7 +24,9 @@ module Psych
|
|||||||
return string if @string_cache.key?(string)
|
return string if @string_cache.key?(string)
|
||||||
|
|
||||||
case string
|
case string
|
||||||
when /^[A-Za-z_~]/
|
# Check for a String type, being careful not to get caught by hash keys, hex values, and
|
||||||
|
# special floats (e.g., -.inf).
|
||||||
|
when /^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/
|
||||||
if string.length > 5
|
if string.length > 5
|
||||||
@string_cache[string] = true
|
@string_cache[string] = true
|
||||||
return string
|
return string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user