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 '"')))

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to