1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/psych/lib/psych/scalar_scanner.rb: use constants rather than

calculating Inf and NaN.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2013-01-17 01:49:55 +00:00
parent 66013dc6d0
commit 679a646e37
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Thu Jan 17 10:48:56 2013 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/scalar_scanner.rb: use constants rather than
calculating Inf and NaN.
Thu Jan 17 10:21:05 2013 Eric Hodel <drbrain@segment7.net>
* doc/syntax/miscellaneous.rdoc: Added Ending an Expression and

View file

@ -68,11 +68,11 @@ module Psych
string
end
when /^\.inf$/i
1 / 0.0
Float::INFINITY
when /^-\.inf$/i
-1 / 0.0
-Float::INFINITY
when /^\.nan$/i
0.0 / 0.0
Float::NAN
when /^:./
if string =~ /^:(["'])(.*)\1/
@symbol_cache[string] = $2.sub(/^:/, '').to_sym