Skip to content
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

Fixes to the python grammar #1351

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

MegaIng
Copy link
Member

@MegaIng MegaIng commented Oct 7, 2023

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.

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.

1 participant