mirror of
https://github.com/circuithub/rel8.git
synced 2024-09-11 16:05:41 +03:00
Make Composite's text parser handle text containing double quotes (#304)
This commit is contained in:
parent
2d9b6abc74
commit
91e7a1bfab
@ -194,9 +194,10 @@ parseRow = parse $ do
|
|||||||
unquoted = A.takeWhile1 (A.notInClass ",\"()")
|
unquoted = A.takeWhile1 (A.notInClass ",\"()")
|
||||||
quoted = A.char '"' *> contents <* A.char '"'
|
quoted = A.char '"' *> contents <* A.char '"'
|
||||||
where
|
where
|
||||||
contents = fold <$> many (unquote <|> unescape)
|
contents = fold <$> many (unquote <|> unescape <|> quote)
|
||||||
where
|
where
|
||||||
unquote = A.takeWhile1 (A.notInClass "\"\\")
|
unquote = A.takeWhile1 (A.notInClass "\"\\")
|
||||||
unescape = A.char '\\' *> do
|
unescape = A.char '\\' *> do
|
||||||
BS.singleton <$> do
|
BS.singleton <$> do
|
||||||
A.char '\\' <|> A.char '"'
|
A.char '\\' <|> A.char '"'
|
||||||
|
quote = "\"" <$ A.string "\"\""
|
||||||
|
Loading…
Reference in New Issue
Block a user