Closed dfremont closed 10 months ago
Ah, that explains why it looked funny after I regenerated it!
Thanks for looking this over, Pablo. I'll mark this ready for review in case you and Matthieu want to merge it without fixing the 3.12 test failures.
The linting failures should be fixed before merging.
Fixed!
Thanks. The regeneration test still seems unhappy though.
Whoops, I should have run tox
. The problem is that the PythonParserGenerator
gets its list of tokens from the token
package, which prior to 3.12 doesn't include FSTRING_START
etc. I've added them manually.
Thanks for the PR @dfremont !
As pointed out in #93, in Python 3.12 the PEP 701 changes to f-string tokenization cause Pegen to fail on grammars which contain f-strings in their actions (such as the Python grammar). This PR adds support for the new tokens to Pegen and changes the metagrammar to restore f-string support under 3.12 (while preserving support under older versions of Python).
Two things this PR does not currently do:
data/python.gram
) for 3.12.