lib/sdl4r/parser.rb in sdl4r-0.9.3 vs lib/sdl4r/parser.rb in sdl4r-0.9.4
- old
+ new
@@ -18,17 +18,10 @@
module SDL4R
require 'base64'
- begin
- # Try to use the Flt library, which defines DecNum
- require "flt"
- rescue LoadError
- # Well, shouganai.
- end
-
require File.dirname(__FILE__) + '/sdl_binary'
require File.dirname(__FILE__) + '/sdl_time_span'
require File.dirname(__FILE__) + '/sdl_parse_error'
require File.dirname(__FILE__) + '/parser/tokenizer'
@@ -105,11 +98,11 @@
# def new_date_time(year, month, day, hour, min, sec, time_zone_offset)
# Time.utc(year, month, day, hour, min, sec)
# end
#
def new_date_time(year, month, day, hour, min, sec, time_zone_offset)
- DateTime.civil(year, month, day, hour, min, sec, time_zone_offset)
+ SDL4R::new_date_time(year, month, day, hour, min, sec, time_zone_offset)
end
private
# Parses the children tags of +parent+ until an end of block is found.
@@ -460,10 +453,10 @@
def Parser.parse_number(literal)
# we use the fact that Kernel.Integer() and Kernel.Float() raise ArgumentErrors
if literal =~ /(.*)(L)$/i
return Integer($1)
elsif literal =~ /([^BDF]*)(BD)$/i
- return (defined? Flt::DecNum) ? Flt::DecNum($1) : Float($1)
+ return BigDecimal($1)
elsif literal =~ /([^BDF]*)(F|D)$/i
return Float($1)
elsif literal.count(".e") == 0
return Integer(literal)
else