bpo-42997: Improve error message for missing : before suites #24292
Conversation
|
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 |
|
This is such a long-awaited improvement! |
58fb156
into
python:master
11 checks passed
11 checks passed
bedevere/news
News entry found in Misc/NEWS.d
ncoghlan
added a commit
to ncoghlan/cpython
that referenced
this pull request
Feb 8, 2021
…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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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