
2 Mar
2011
2 Mar
'11
11:24 a.m.
Apologies if this has been answered already (I've got a bit lost with this thread), but the *try* here seems to be giving you precisely the behaviour you don't want. *try* means backtrack on failure, and try the next parser. So if you want ill formed strings to throw an error if they aren't properly enclosed in double quotes don't use try. <|> try $ (char '"' *> (StringLit . B.pack <$> manyTill (notChar '\n') (char '"')))