Replies: 1 comment 5 replies
-
If I understand well you want the "why" the template rule failed ? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to figure out how to make the parser report errors where they happen, as opposed to failing the enclosing rule. Other parser generators have a feature called "CUT" which means "don't try any more alternatives once you reach this point".
Here's an example: I'm trying to parse a structure like this:
The error result I get back says that the problem is on line 1 - because the 'template' rule failed to parse. But what we'd really like to show the user is that the problem is on line 4.
If I could put a CUT at the end of each property, the parser would know that everything up to that point is OK, and it's only when we get to the bad property that things go off the rails.
Beta Was this translation helpful? Give feedback.
All reactions