Skip to content
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

ability to emit warnings and halt compilation #68

Open
kurtbrose opened this issue Dec 30, 2016 · 0 comments
Open

ability to emit warnings and halt compilation #68

kurtbrose opened this issue Dec 30, 2016 · 0 comments

Comments

@kurtbrose
Copy link

kurtbrose commented Dec 30, 2016

parsley.ometa.runtime.ParseError has a very nice way of formatting / printing error messages

It would be nice if there was some way to access this from the grammar rules. For example, if there was a type of exception that would be picked up and have the line and character added.

Also, it would be nice if there was a way to emit a warning with a given message formatted in the same way as the ParseError.

(This can kinda-sorta be achieved via print str(grammar.input.head()[1].withMessage("whatever warning"), but there doesn't seem to be a way to get access to the grammar object itself from inside a rule.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant