Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #33 from nagachika/fix_rescue_syntax

postfix rescue statement cannot receive Exception class specification.
  • Loading branch information...
commit 7e42272564ea26c9e1cd57e7d872256de848a15d 2 parents e7d236c + 152d22b
@tenderlove authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/psych/scalar_scanner.rb
View
10 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
Please sign in to comment.
Something went wrong with that request. Please try again.