diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-10-07 15:51:21 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-10-07 15:51:21 -0700 |
commit | 57c468a5f8bd3ffc1cb93b07db6b823872316a18 (patch) | |
tree | dad229aa55917b157c2eba2f76d9da3a7e947866 /lib | |
parent | 98ce58ac328aca5f5d541c9118b5e4184b916bd3 (diff) | |
download | psych-57c468a5f8bd3ffc1cb93b07db6b823872316a18.zip |
fixing float parsing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/visitors/to_ruby.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb index bb80ad6..c757d25 100644 --- a/lib/psych/visitors/to_ruby.rb +++ b/lib/psych/visitors/to_ruby.rb @@ -22,6 +22,8 @@ module Psych Complex(o.value) when "!ruby/object:Rational" Rational(o.value) + when "tag:yaml.org,2002:float", "!float" + Float(ScalarScanner.new(o.value).tokenize.last) when "!ruby/regexp" o.value =~ /^\/(.*)\/([mix]*)$/ source = $1 |