bytestringparser-temporary 0.4.0 → 0.4.1
raw patch · 2 files changed
+7/−13 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.ParserCombinators.Attoparsec: parseTest :: (Show a) => Parser a -> ByteString -> IO ()
+ Data.ParserCombinators.Attoparsec: parseTest :: Show a => Parser a -> ByteString -> IO ()
- Data.ParserCombinators.Attoparsec.Char8: parseTest :: (Show a) => Parser a -> ByteString -> IO ()
+ Data.ParserCombinators.Attoparsec.Char8: parseTest :: Show a => Parser a -> ByteString -> IO ()
- Data.ParserCombinators.Attoparsec.Internal: parseTest :: (Show a) => Parser a -> ByteString -> IO ()
+ Data.ParserCombinators.Attoparsec.Internal: parseTest :: Show a => Parser a -> ByteString -> IO ()
Files
bytestringparser-temporary.cabal view
@@ -1,5 +1,5 @@ name: bytestringparser-temporary-version: 0.4.0+version: 0.4.1 license: BSD3 license-file: LICENSE category: Text, Parsing
src/Data/ParserCombinators/Attoparsec/Internal.hs view
@@ -281,18 +281,12 @@ takeWhile1 :: (Word8 -> Bool) -> Parser LB.ByteString takeWhile1 p = Parser $ \s@(S sb lb n) ->- let (h, t) = SB.span p sb- in if SB.null h- then Left (sb +: lb, [])- else if SB.null t- then case unParser (nextChunk *> takeWhile p) s of- Left err -> Left err- Right (xs, s') ->- let bs = h +: xs- in if LB.null bs- then Left (sb +: lb, [])- else Right (bs, s')- else Right (oneChunk h, S t lb (n + length64 h))+ case unParser (takeWhile p) s of+ Left err -> Left err+ Right (bs, s') -> if LB.null bs+ then Left (sb +: lb, [msg])+ else Right (bs, s')+ where msg = "Expected at least one byte to satisfy criterion." {-# INLINE takeWhile1 #-} -- | Skip over characters while the predicate is true.