lib/rouge/reader.rb in rouge-lang-0.0.2 vs lib/rouge/reader.rb in rouge-lang-0.0.3
- old
+ new
@@ -402,10 +402,14 @@
"line #{line} char #{char}: #{m}"
end
def read_number s
if NUMBER.match s
- eval s
+ if s =~ /[.eE]/
+ Float(s)
+ else
+ Integer(s)
+ end
else
reader_raise UnexpectedCharacterError, "#{s} in #read_number"
end
end