From aa2e42d9715da479f3309b6e1a386241e5c7fdaa Mon Sep 17 00:00:00 2001 From: Shane O'Brien Date: Tue, 9 Jan 2024 01:12:38 +0000 Subject: [PATCH] Make Composite's text parser handle text containing double quotes --- src/Rel8/Type/Composite.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Rel8/Type/Composite.hs b/src/Rel8/Type/Composite.hs index 0f8d42d5..0a6a537e 100644 --- a/src/Rel8/Type/Composite.hs +++ b/src/Rel8/Type/Composite.hs @@ -194,9 +194,10 @@ parseRow = parse $ do unquoted = A.takeWhile1 (A.notInClass ",\"()") quoted = A.char '"' *> contents <* A.char '"' where - contents = fold <$> many (unquote <|> unescape) + contents = fold <$> many (unquote <|> unescape <|> quote) where unquote = A.takeWhile1 (A.notInClass "\"\\") unescape = A.char '\\' *> do BS.singleton <$> do A.char '\\' <|> A.char '"' + quote = "\"" <$ A.string "\"\""