on master help sign in
Reject floating point numbers that lack a fractional part

Once again, this was identified by JSONTestSuite, and is disallowed by RFC 7159.

commitecfca35a45286dbe2bbaf5f62354be393bc59b66 authorBryan O'Sullivan <bryano@fb.com> dateFri 28 Oct 2016, 15:35 (10 years ago) parentdf61ba7
2 files changed+1−6
Data/Aeson/Parser/Internal.hs+1−1 tests/UnitTests.hs−5
Data/Aeson/Parser/Internal.hs+1−1
@@ -328,7 +328,7 @@ scientific = do
328328 dotty <- A.peekWord8
329329 -- '.' -> ascii 46
330330 SP c e <- case dotty of
331− Just 46 -> A.anyWord8 *> (f <$> A.takeWhile isDigit_w8)
331+ Just 46 -> A.anyWord8 *> (f <$> A.takeWhile1 isDigit_w8)
332332 _ -> pure (SP n 0)
333333
334334 let !signedCoeff | positive = c
tests/UnitTests.hs−5
@@ -667,11 +667,6 @@ _blacklist = HashSet.fromList [
667667 , "i_string_not_in_unicode_range.json"
668668 , "i_string_truncated-utf-8.json"
669669 , "i_structure_UTF-8_BOM_empty_object.json"
670− , "n_number_-2..json"
671− , "n_number_0.e1.json"
672− , "n_number_2.e+3.json"
673− , "n_number_2.e-3.json"
674− , "n_number_2.e3.json"
675670 , "n_number_neg_int_starting_with_zero.json"
676671 , "n_number_real_without_fractional_part.json"
677672 , "n_number_with_leading_zero.json"