Skip to content

Commit

Permalink
Make Composite's text parser handle text containing double quotes (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-circuithub authored Jan 9, 2024
1 parent 2d9b6ab commit 91e7a1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Rel8/Type/Composite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 "\"\""

0 comments on commit 91e7a1b

Please sign in to comment.