LibCST/libcst/matchers
martin 48668dfabb
Support parsing of t-strings #1374 (#1398)
#1343
Adds support to parse t-strings

Couple things of note:

TemplatedString* is largely a copy of FormattedString*
Since clients operate of libcst objects I consider this this part of a public API - following the python grammar (where TStrings are distinct from FStrings) seems like a good way to avoid changes to the API in the future.
Within the tokenizer we reuse the fstring machinery
I consider this an implementation detail, fstrings and tstrings are (for now) identical, we can change this later without changes to the public api.
Since 2 -> we have a new FTStringType enum
We need to discriminate between f and t strings to know which token to return, a bit clumsy to use in my opinion - so looking for feedback here on how to improve this.
2025-09-09 11:16:20 -04:00
..
tests fix PEP 604 union annotations in decorators (#828) 2022-11-29 15:24:24 -07:00
__init__.py Support parsing of t-strings #1374 (#1398) 2025-09-09 11:16:20 -04:00
_decorators.py Several trivial refactors (#770) 2022-09-14 14:33:45 +01:00
_matcher_base.py Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00
_return_types.py Support parsing of t-strings #1374 (#1398) 2025-09-09 11:16:20 -04:00
_visitors.py fix certain matchers breaking under multiprocessing by initializing them late (#1204) 2024-09-25 11:29:54 +01:00