Permalink
Browse files

Merge pull request #33 from nagachika/fix_rescue_syntax

postfix rescue statement cannot receive Exception class specification.
  • Loading branch information...
2 parents e7d236c + 152d22b commit 7e42272564ea26c9e1cd57e7d872256de848a15d @tenderlove tenderlove committed Oct 4, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/psych/scalar_scanner.rb
@@ -74,13 +74,19 @@ def tokenize string
end
i
when FLOAT
- return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
+ begin
+ return Float(string.gsub(/[,_]/, ''))
+ rescue ArgumentError
+ end
@string_cache[string] = true
string
else
if string.count('.') < 2
- return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
+ begin
+ return Integer(string.gsub(/[,_]/, ''))
+ rescue ArgumentError
+ end
end
@string_cache[string] = true

0 comments on commit 7e42272

Please sign in to comment.