LibCST/libcst/_nodes
Zsolt Dollenstein 9286446f88
PEP 695 - Type Parameter Syntax (#1004)
This PR adds support for parsing and representing Type Parameters and Type Aliases as specified by PEP 695. What's missing are the scope rules, to be implemented in a future PR.

Notable (user visible) changes:

- new `TypeAlias` CST node, which is a `SmallStatement`
- new CST nodes to represent TypeVarLikes: `TypeVar`, `TypeVarTuple`, `ParamSpec`
- new helper CST nodes:  `TypeParameters` to serve as a container for multiple TypeVarLikes, and `TypeParam` which is a single item in a `TypeParameters` (owning the separating comma)
- extended `FunctionDef` and `ClassDef` with an optional `type_parameters` field, as well as `whitespace_after_type_parameters` to own the extra whitespace between type parameters and the following token
  - these new fields are added after all others to avoid breaking callers passing in fields as positional arguments
- in `FunctionDef` and `ClassDef`, `whitespace_after_name` now owns the whitespace before the type parameters if they exist
2023-08-28 22:07:22 +01:00
..
tests PEP 695 - Type Parameter Syntax (#1004) 2023-08-28 22:07:22 +01:00
__init__.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
base.py Fix Sentinal typo (#948) 2023-06-07 12:23:12 +01:00
deep_equals.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
expression.py Fix whitespace, fstring, walrus related parse errors (#939, #938, #937, #936, #935, #934, #933, #932, #931) 2023-06-07 12:37:16 +01:00
internal.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
module.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
op.py add slots to base classes, @add_slots takes bases into account (#605) 2022-01-16 14:14:32 +00:00
statement.py PEP 695 - Type Parameter Syntax (#1004) 2023-08-28 22:07:22 +01:00
whitespace.py add slots to base classes, @add_slots takes bases into account (#605) 2022-01-16 14:14:32 +00:00