
15 Oct
2008
15 Oct
'08
3:27 p.m.
On Wed, 15 Oct 2008, Andrew Coppin wrote:
Suppose this is the top-level parser for my language.
<snip>
Does anybody know how to fix this irratiting quirk? I can see why it happens, but not how to fix it.
One of: expressions = many1 (try expression <|> myFail) where myFail = {- eat your way to the next expression -} or do a prepass splitting your input up into expressions and feed the individual expressions into Parsec. Parsec's not designed to do error recovery as such, so it's something you need to work out how to handle if you need it. -- flippa@flippac.org 'In Ankh-Morpork even the shit have a street to itself... Truly this is a land of opportunity.' - Detritus, Men at Arms