-
Notifications
You must be signed in to change notification settings - Fork 5
add rule names to errors #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There probably is a better way to do this, but this is what was easy.
This is closer to The Right Way™ to do this. Not sure about adding all those Repr() methods, though.
|
I think this is a reasonable approach to solving this problem. My only concern is that adding the extra Repr() method to Term might not be optimal; perhaps a more intelligible approach would be a single function that type switches? There are advantages (cleaner) and disadvantages (does more work, easier to forget to add a new type e.g. disjunction terms) to doing it thus. |
|
I'm not a fan of this method of displaying. Consider having a gopp.ParseError type that encapsulates all this I like the "Expected X at Y" message for when you're debugging the On Fri, Aug 16, 2013 at 12:33 AM, Branden J Brown
|
|
This might be better. The Repr methods are still there; they could be useful for things like reconstructing/formatting a grammar, should the desire arise. |
There probably is a better way to do this, but this is what was easy.