mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
2 changed files with 8 additions and 1 deletions
|
@ -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>
|
||||
|
||||
* 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)
|
||||
|
||||
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
|
||||
@string_cache[string] = true
|
||||
return string
|
||||
|
|
Loading…
Add table
Reference in a new issue