lib/hexapdf/content/parser.rb in hexapdf-0.4.0 vs lib/hexapdf/content/parser.rb in hexapdf-0.5.0
- old
+ new
@@ -117,13 +117,14 @@
# See: HexaPDF::Tokenizer#parse_number
def parse_number
if (val = @ss.scan(/[+-]?\d++(?!\.)/))
val.to_i
- else
- val = @ss.scan(/[+-]?(?:\d+\.\d*|\.\d+)/)
+ elsif (val = @ss.scan(/[+-]?(?:\d+\.\d*|\.\d+)/))
val << '0'.freeze if val.getbyte(-1) == 46 # dot '.'
Float(val)
+ else
+ parse_keyword
end
end
# Stub implementation to prevent errors for not-overridden methods.
def prepare_string_scanner(*)