suaveant has asked for the wisdom of the Perl Monks concerning the following question:
How would one just tell the parser to fail when a certain spot is reached? <commit> skips the remaining rules, but basically in my code I have a block { STUFF } and once I hit that first { if the rule doesn't succeed (like a missing }) I just want to stop the whole parse and try to make up a useful error message.
Is there something like <fatalcommit> or some combination of tags I can do this with. Or do I need to start a line with <uncommit> and force the parser to end some way in an action block?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Forcing parse to fail in PArse::RecDescent
by ikegami (Patriarch) on Sep 14, 2007 at 15:22 UTC | |
by suaveant (Parson) on Sep 14, 2007 at 17:31 UTC | |
by ikegami (Patriarch) on Sep 16, 2007 at 23:09 UTC | |
by suaveant (Parson) on Sep 17, 2007 at 15:09 UTC |