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

Very unhelpful error messages for unmapped prefix operators in pratt parsers #980

Open
rscarson opened this issue Feb 15, 2024 · 0 comments

Comments

@rscarson
Copy link

Describe the bug
Unmapped prefix operators panic at 'expected operator, found

For example "-1" panics with:

Expected operator, found int_literal

Instead of something like expected operator, found PREFIX_NEG

To Reproduce

  • Create a grammar with a prefix operator, for example "-", and a literal
  • Do not map this operator with pratt
  • Attempt to use the operator; "-1" for example

Expected behavior
The error message should report the correct symbol in the grammar, not the next one

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

No branches or pull requests

2 participants