Skip to content

Commit

Permalink
Make Composite's text parser handle text containing double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-circuithub committed Jan 9, 2024
1 parent 2d9b6ab commit aa2e42d
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 aa2e42d

Please sign in to comment.