-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-42997: Improve error message for missing : before suites #24292
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicking here and there. Feel free to ignore.
Misc/NEWS.d/next/Core and Builtins/2021-01-26-13-14-19.bpo-42997.QUOPgP.rst
Outdated
Show resolved
Hide resolved
* Add to the peg generator a new directive ('&&') that allows to expect a token and hard fail the parsing if the token is not found. This allows to quickly emmit syntax errors for missing tokens. * Use the new grammar element to hard-fail if the ':' is missing before suites.
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
I have added a new section to the highlighting code in the grammar docs so the new symbol do not appear |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is such a long-awaited improvement! 🚀 Really good job! After this we can think about using the forced-expect operator in other places as well.
…H-24292) * Add to the peg generator a new directive ('&&') that allows to expect a token and hard fail the parsing if the token is not found. This allows to quickly emmit syntax errors for missing tokens. * Use the new grammar element to hard-fail if the ':' is missing before suites.
Add to the peg generator a new directive ('&&') that allows to expect
a token and hard fail the parsing if the token is not found. This
allows to quickly emit syntax errors for missing tokens.
Use the new grammar element to hard-fail if the ':' is missing before
suites.
See #24293 for a simpler (but more verbose) approach
https://bugs.python.org/issue42997