Add f-string parsing for Python 3.12 (PEP 701) by encukou · Pull Request #1027 · python-babel/babel
encukou
changed the title
Add F f-string parsing for Python 3.12 (PEP 701)
Add f-string parsing for Python 3.12 (PEP 701)
akx
self-requested a review
Since Python 3.12, f-strings are tokenized and parsed like the rest of Python's grammar, using the new tokens FSTRING_START, FSTRING_MIDDLE and FSTRING_END. Make the babel message extractor concatenate these three if they're adjacent to each other. If they're not, that means there are dynamic substitutions, so the f-string is ignored.
akx approved these changes Oct 1, 2023
akx
enabled auto-merge (squash)
encukou
deleted the
py3.12-fstring-extraction
branch
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