
31 May
2008
31 May
'08
10:39 a.m.
Dimitry Golubovsky wrote:
Hi,
If a parser which updated user state fails, will such update be reverted?
Without actually checking, I would strongly suspect that yes, if a parser fails, all its state modifications are thrown away. (This is usually what you would want...)
Is there any bracket- or try-catch-finally-like mechanism for Parsec?
I don't think so. If you find yourself wanting to parse data differently depending on stuff you've already seen, you might find it easier to run a 2-pass parser of some kind.