on master help sign in
Merge pull request #567 from phadej/export-jsstring-scientific

Export jstring_ and scientific parsers

commit5fd9078dbd06b479cd53468db83deb6d34c40d35 authorAdam Bergmark <adam@bergmark.nl> dateTue 18 Jul 2017, 15:46 (9 years ago) parentcfb3cb981fec00
3 files changed+7−3
Data/Aeson/Parser.hs+2−1 Data/Aeson/Parser/Internal.hs+4−1 aeson.cabal+1−1
Data/Aeson/Parser.hs+2−1
@@ -33,6 +33,7 @@ module Data.Aeson.Parser
3333 json
3434 , value
3535 , jstring
36+ , scientific
3637 -- * Strict parsers
3738 -- $strict
3839 , json'
@@ -46,7 +47,7 @@ module Data.Aeson.Parser
4647
4748import Prelude ()
4849
49−import Data.Aeson.Parser.Internal (decodeStrictWith, decodeWith, eitherDecodeStrictWith, eitherDecodeWith, json, json', jstring, value, value')
50+import Data.Aeson.Parser.Internal (decodeStrictWith, decodeWith, eitherDecodeStrictWith, eitherDecodeWith, json, json', jstring, scientific, value, value')
5051
5152-- $lazy
5253--
Data/Aeson/Parser/Internal.hs+4−1
@@ -23,6 +23,8 @@ module Data.Aeson.Parser.Internal
2323 json, jsonEOF
2424 , value
2525 , jstring
26+ , jstring_
27+ , scientific
2628 -- * Strict parsers
2729 , json', jsonEOF'
2830 , value'
@@ -334,7 +336,7 @@ decimal0 = do
334336 then fail "leading zero"
335337 else return (B.foldl' step 0 digits)
336338
337−{-# INLINE scientific #-}
339+-- | Parse a JSON number.
338340scientific :: Parser Scientific
339341scientific = do
340342 let minus = 45
@@ -364,3 +366,4 @@ scientific = do
364366 (A.satisfy (\ex -> ex == littleE || ex == bigE) *>
365367 fmap (Sci.scientific signedCoeff . (e +)) (signed decimal)) <|>
366368 return (Sci.scientific signedCoeff e)
369+{-# INLINE scientific #-}
aeson.cabal+1−1
@@ -93,6 +93,7 @@ library
9393 Data.Aeson.Encoding.Internal
9494 Data.Aeson.Internal
9595 Data.Aeson.Internal.Time
96+ Data.Aeson.Parser.Internal
9697
9798 -- Deprecated modules
9899 exposed-modules:
@@ -101,7 +102,6 @@ library
101102 other-modules:
102103 Data.Aeson.Encoding.Builder
103104 Data.Aeson.Internal.Functions
104− Data.Aeson.Parser.Internal
105105 Data.Aeson.Parser.Unescape
106106 Data.Aeson.Parser.Time
107107 Data.Aeson.Types.FromJSON