- = case parseOnly (finishOff extMapP) $ A.toByteString src of
- Right xs → case compile xs of
- Right m → ExtMap m
- Left e → error ("Duplicate extension: " ⧺ show e)
- Left err → error ("Unparsable extension map: " ⧺ err)
-
-extMapP ∷ Parser [(MIMEType, [Text])]
-extMapP = catMaybes <$> P.many (try comment <|> try validLine <|> emptyLine)
+ = case LP.parse pairs src of
+ LP.Fail _ eCtx e
+ → error $ "Unparsable extension map: "
+ ⧺ intercalate ", " eCtx
+ ⧺ ": "
+ ⧺ e
+ LP.Done _ xs
+ → case compile xs of
+ Right m → ExtMap m
+ Left e → error ("Duplicate extension: " ⧺ show e)