Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python] Fix string replacement fields (#3797)
* [Python] Fix string replacement fields Fixes #3649 This commit closely implements python's format string syntax. see: https://docs.python.org/3.11/library/string.html#format-string-syntax It means, replacement field names must be valid qualified identifiers, even though python syntactically resolves all kinds of key names. Replacement field termination is handled separately for each kind of quotation. * [Python] Refactor f-strings This commit ... 1. aligns implementation of f-string replacement fields with normal string replacements. 2. implements f-string replacements for each kind of quotation in order to correctly bailout at EOL or terminating quotation mark type. Note: Nested quotes are supported in replacement expressions only as of python 3.12. They keep unsupported in format-specs. 3. moves escaped braces back into f-string-replacements context and adjusts its include positions (moves them before normal `escaped-chars`). 4. removes `meta.format-spec` from `:` to align scoping with replacement fields in normal strings. 5. adds some tests to verify syntax being prepared for python 3.12
- Loading branch information