Skip to content

[3.9] bpo-42123: Run the parser two times and only enable invalid rules on the second run (GH-22111) #23011

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

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

lysnikolaou
Copy link
Member

@lysnikolaou lysnikolaou commented Oct 27, 2020

  • Implement running the parser a second time for the errors messages

The first parser run is only responsible for detecting whether
there is a SyntaxError or not. If there isn't the AST gets returned.
Otherwise, the parser is run a second time with all the invalid_*
rules enabled so that all the customized error messages get produced.

(cherry picked from commit bca7014)

https://bugs.python.org/issue42123

…es on the second run (pythonGH-22111)

* Implement running the parser a second time for the errors messages

The first parser run is only responsible for detecting whether
there is a `SyntaxError` or not. If there isn't the AST gets returned.
Otherwise, the parser is run a second time with all the `invalid_*`
rules enabled so that all the customized error messages get produced.

(cherry picked from commit bca7014)
@lysnikolaou lysnikolaou merged commit 24a7c29 into python:3.9 Oct 28, 2020
@lysnikolaou lysnikolaou deleted the backport-bca7014-3.9 branch October 28, 2020 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants