Hi Gabe,

So I'm wondering, is there a way I can ask Parslet to show me the last matched rule when it encounters parsing errors?  That way, I'd know right away that it matched a needlessly greedy rule that I wasn't expecting.

No, currently there is not.

A thought: While your input is linear, your parser is not. The rule 'before' might actually be hard to define. It involves some kind of sequence/repetition, but subsequent sequences might not be on the same level at all…

This example (https://github.com/kschiess/parslet/blob/master/example/deepest_errors.rb) shows how to use a different error reporter than the one that is default. It uses another strategy for keeping track of errors. Maybe that output helps?

(Just looking at the error reporter API might inspire you to build a custom error reporter for your case. )

best of luck
kaspar

Reply via email to