@@ -723,7 +723,7 @@ takeEndByEsc isEsc isSep (Parser pstep pinitial pextract) =
724 extract (Left' s) = pextract s
724 extract (Left' s) = pextract s
725 extract (Right' _) =
725 extract (Right' _) =
726− throwM $ ParseError "takeEndByEsc: trailing escape, end of input"
726+ throwM $ ParseError "takeEndByEsc: trailing escape"
728-- | See 'Streamly.Internal.Data.Parser.takeEndBy_'.
728-- | See 'Streamly.Internal.Data.Parser.takeEndBy_'.
@@ -765,7 +765,7 @@ takeStartBy cond (Fold fstep finitial fextract) =
766 case res of
766 case res of
767 FL.Partial s -> IPartial (Left' s)
767 FL.Partial s -> IPartial (Left' s)
768− FL.Done _ -> IError "takeStartBy : bad finitial"
768+ FL.Done _ -> IError "takeStartBy: fold done without input"
770 {-# INLINE process #-}
770 {-# INLINE process #-}
771 process s a = do
771 process s a = do
@@ -778,8 +778,7 @@ takeStartBy cond (Fold fstep finitial fextract) =
778 step (Left' s) a =
778 step (Left' s) a =
779 if cond a
779 if cond a
780 then process s a
780 then process s a
781− else error $ "takeStartBy : token begins with an element which "
781+ else return $ Error "takeStartBy: missing frame start"
782− ++ "fails the predicate"
783 step (Right' s) a =
782 step (Right' s) a =
784 if not (cond a)
783 if not (cond a)
785 then process s a
784 then process s a
@@ -1342,7 +1341,7 @@ deintercalate
1344 errMsg p status =
1343 errMsg p status =
1345− error $ "sepBy: " ++ p ++ " parser cannot "
1344+ error $ "deintercalate: " ++ p ++ " parser cannot "
1346 ++ status ++ " without input"
1345 ++ status ++ " without input"
1348 initial = do
1347 initial = do
@@ -1392,7 +1391,7 @@ deintercalate
1392 IDone _ -> errMsg "left" "succeed"
1391 IDone _ -> errMsg "left" "succeed"
1393 IError _ -> errMsg "left" "fail"
1392 IError _ -> errMsg "left" "fail"
1394 FL.Done c -> return $ Done n c
1393 FL.Done c -> return $ Done n c
1395− else return $ Error "sepBy: infinite loop"
1394+ else error "deintercalate: infinite loop"
1396 Error err -> return $ Error err
1395 Error err -> return $ Error err
1398 extract (DeintercalateL fs sL) = do
1397 extract (DeintercalateL fs sL) = do
@@ -1469,7 +1468,7 @@ sepBy
1469 IPartial sp -> return $ Partial n $ SepByInit fs sp
1468 IPartial sp -> return $ Partial n $ SepByInit fs sp
1470 IDone _ -> errMsg "content" "succeed"
1469 IDone _ -> errMsg "content" "succeed"
1471 IError _ -> errMsg "content" "fail"
1470 IError _ -> errMsg "content" "fail"
1472− else return $ Error "sepBy: infinite loop"
1471+ else error "sepBy: infinite loop"
1473 Error err -> return $ Error err
1472 Error err -> return $ Error err
1475 extract (SepByInit fs sp) = do
1474 extract (SepByInit fs sp) = do