
15 Oct
2008
15 Oct
'08
3:29 p.m.
On Wed, 15 Oct 2008, Andrew Coppin wrote:
Suppose this is the top-level parser for my language. Now suppose the user supplies an expression with a syntax error half way through it. What I *want* to happen is for an error to be raised. What *actually* happens is that Parsec just ignores all input after that point. So if "+" is not a valid token, but the user writes
x = 1; y = 2; z = 3 + z; w = 4;
then what my program receives back is "x = 1; y = 2; z = 3"
That'll teach me not to scan-read when I'm tired! expressions = do es <- many1 expression eof return es -- flippa@flippac.org Society does not owe people jobs. Society owes it to itself to find people jobs.