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.
This PR updates the Python grammar to be a bit more up-to-date and correct, and it suggests a set of tests that could be run, although I am not sure if it's a good idea to include those in the repo.
As I wrote @erezsh on gitter, a big problem is that the
with
statement can't be done correctly, which is why those tests currently get commented out during downloading of the files from the Cpython github. Not sure if there is a good solution for us. This syntax change is part of the reason CPython switched over the PEG parser away from something in the LR family. The changes to the python grammar are very fine grained since I have had bad experiences with trying to do a monolithic change to that grammar, but this could be squished later.This is a draft since the grammar changes are incomplete, and the tests definitely aren't ready to be uploaded (if they should exists at all).
Note that the grammar changes are in some sense backwards incompatible. Unsure if we care about that.