on master help sign in
Move skipSpace from value callsite to inside the definitions of value and value'
commitc33ad66d6661e9b3d608d8d8789313020f321191 authorMichael Maloney <tactics40@gmail.com> dateSun 10 May 2015, 23:22 (11 years ago) parentf954fd8
1 file changed+3−1
Data/Aeson/Parser/Internal.hs+3−1
Data/Aeson/Parser/Internal.hs+3−1
@@ -114,7 +114,7 @@ object_' = {-# SCC "object_'" #-} do
114114objectValues :: Parser Text -> Parser Value -> Parser (H.HashMap Text Value)
115115objectValues str val = do
116116 skipSpace
117− let pair = liftA2 (,) (str <* skipSpace) (char ':' *> skipSpace *> val)
117+ let pair = liftA2 (,) (str <* skipSpace) (char ':' *> val)
118118 H.fromList <$> commaSeparated pair CLOSE_CURLY
119119{-# INLINE objectValues #-}
120120
@@ -159,6 +159,7 @@ arrayValues val = do
159159-- to preserve interoperability and security.
160160value :: Parser Value
161161value = do
162+ skipSpace
162163 w <- A.peekWord8'
163164 case w of
164165 DOUBLE_QUOTE -> A.anyWord8 *> (String <$> jstring_)
@@ -174,6 +175,7 @@ value = do
174175-- | Strict version of 'value'. See also 'json''.
175176value' :: Parser Value
176177value' = do
178+ skipSpace
177179 w <- A.peekWord8'
178180 case w of
179181 DOUBLE_QUOTE -> do