fix another parser bug
This commit is contained in:
parent
b3d30e7d70
commit
6ef38df881
1 changed files with 9 additions and 9 deletions
|
@ -43,8 +43,9 @@ buildContentIdentifierList l = case l of
|
|||
| S8.any (`elem` [':', '\r', '\n']) c || "!" `S8.isPrefixOf` c =
|
||||
charUtf8 '!' <> byteString (toB64' c)
|
||||
| otherwise = byteString c
|
||||
go (c:cs) = buildcid c <> charUtf8 ':' <> go cs
|
||||
go [] = mempty
|
||||
go (c:[]) = buildcid c
|
||||
go (c:cs) = buildcid c <> charUtf8 ':' <> go cs
|
||||
|
||||
parseLog :: L.ByteString -> ContentIdentifierLog
|
||||
parseLog = parseLogNew parseContentIdentifierList
|
||||
|
@ -59,12 +60,11 @@ parseContentIdentifierList = do
|
|||
return $ if "!" `S8.isPrefixOf` b
|
||||
then ContentIdentifier $ fromMaybe b (fromB64Maybe' (S.drop 1 b))
|
||||
else ContentIdentifier b
|
||||
listparser first rest = do
|
||||
cid <- cidparser
|
||||
ifM A8.atEnd
|
||||
( return (first :| reverse (cid:rest))
|
||||
listparser first rest = ifM A8.atEnd
|
||||
( return (first :| reverse rest)
|
||||
, do
|
||||
_ <- A8.char ':'
|
||||
cid <- cidparser
|
||||
listparser first (cid:rest)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue