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

-- 
[EMAIL PROTECTED]

Society does not owe people jobs.
Society owes it to itself to find people jobs.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to