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

Pretty error messages for input parsing issues #19

Open
Vlek opened this issue Jan 31, 2021 · 1 comment
Open

Pretty error messages for input parsing issues #19

Vlek opened this issue Jan 31, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request
Projects
Milestone

Comments

@Vlek
Copy link
Owner

Vlek commented Jan 31, 2021

It would be nice if the error handler can output nicely formatted messages to point directly to the operation that caused the parser not to be able to work.

Example:

An exception occurred attempting to parse the input:
1 +
  ^
The addition operator expects a left and a right number.
@Vlek Vlek added the enhancement New feature or request label Jan 31, 2021
@Vlek Vlek added this to the 3.0 milestone Jan 31, 2021
@Vlek Vlek self-assigned this Jan 31, 2021
@Vlek Vlek added this to To do in Roll 3.0 Feb 9, 2021
@Vlek
Copy link
Owner Author

Vlek commented Jul 11, 2021

I think this is the way to do it: https://pyparsing-docs.readthedocs.io/en/latest/pyparsing.html#pyparsing.ParserElement.setFailAction

Already added a stub to the parser for an overall fail catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant