Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information