
30 Jun
2010
30 Jun
'10
1:20 a.m.
Antoine Latter wrote:
For Parsec, in the absence of the "try" combinator, a parser will never back-track once it consumes a portion of the input.
Thanks for reminding me.
If "try" is pushed out into the leaves of you parser, you shouldn't run in to too much trouble with excessive backtracking.
I agree.
What problems are you running in to?
Unfortunately I have an existing, mostly working and quite complex parser which does indeed use Parsec.try quite close to the root of the tree. I have tried on a number of ocassions to refactor this to remove this particular usage of Parsec.try without success. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/