bpo-42997: Improve error message for missing : before suites#24292
Merged
pablogsal merged 10 commits intopython:masterfrom Feb 2, 2021
Merged
bpo-42997: Improve error message for missing : before suites#24292pablogsal merged 10 commits intopython:masterfrom
pablogsal merged 10 commits intopython:masterfrom
Conversation
lysnikolaou
reviewed
Jan 26, 2021
Member
lysnikolaou
left a comment
There was a problem hiding this comment.
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>
Member
Author
|
I have added a new section to the highlighting code in the grammar docs so the new symbol do not appear |
gvanrossum
reviewed
Feb 1, 2021
lysnikolaou
approved these changes
Feb 1, 2021
Member
lysnikolaou
left a comment
There was a problem hiding this comment.
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.
adorilson
pushed a commit
to adorilson/cpython
that referenced
this pull request
Mar 13, 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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