on master help sign in
Drop RFC 4627 conformance
commitc93e8a11ef72c3c11b8d65772663cc790acbda2c authorBryan O'Sullivan <bos@serpentine.com> dateMon 25 May 2015, 11:43 (11 years ago) parentd191a89
1 file changed+12−14
Data/Aeson/Parser/Internal.hs+12−14
Data/Aeson/Parser/Internal.hs+12−14
@@ -72,32 +72,30 @@ import qualified Data.HashMap.Strict as H
7272#define C_n 110
7373#define C_t 116
7474
75−-- | Parse a top-level JSON value. This must be either an object or
76−-- an array, per RFC 4627.
75+-- | Parse a top-level JSON value.
7776--
7877-- The conversion of a parsed value to a Haskell value is deferred
7978-- until the Haskell value is needed. This may improve performance if
8079-- only a subset of the results of conversions are needed, but at a
8180-- cost in thunk allocation.
81+--
82+-- This function is an alias for 'value'. In aeson 0.8 and earlier, it
83+-- parsed only object or array types, in conformance with the
84+-- now-obsolete RFC 4627.
8285json :: Parser Value
83−json = json_ object_ array_
86+json = value
8487
85−-- | Parse a top-level JSON value. This must be either an object or
86−-- an array, per RFC 4627.
88+-- | Parse a top-level JSON value.
8789--
8890-- This is a strict version of 'json' which avoids building up thunks
8991-- during parsing; it performs all conversions immediately. Prefer
9092-- this version if most of the JSON data needs to be accessed.
93+--
94+-- This function is an alias for 'value''. In aeson 0.8 and earlier, it
95+-- parsed only object or array types, in conformance with the
96+-- now-obsolete RFC 4627.
9197json' :: Parser Value
92−json' = json_ object_' array_'
93−
94−json_ :: Parser Value -> Parser Value -> Parser Value
95−json_ obj ary = do
96− w <- skipSpace *> A.satisfy (\w -> w == OPEN_CURLY || w == OPEN_SQUARE)
97− if w == OPEN_CURLY
98− then obj
99− else ary
100−{-# INLINE json_ #-}
98+json' = value'
10199
102100object_ :: Parser Value
103101object_ = {-# SCC "object_" #-} Object <$> objectValues jstring value