Add parsing of type alias statements i.e. the type keyword (#97)

Extends #95
Closes #82 

Adds parsing of new `type` soft keyword for defining type aliases.

Supports type alias statements as defined in PEP 695 e.g. 

```python
# A non-generic type alias
type IntOrStr = int | str

# A generic type alias
type ListOrSet[T] = list[T] | set[T]

# A type alias that includes a forward reference
type AnimalOrVegetable = Animal | "Vegetable"

# A generic self-referential type alias
type RecursiveList[T] = T | list[RecursiveList[T]]
```

All type parameter kinds are supported as in #95.

Builds on soft keyword abstractions introduced in https://github.com/RustPython/RustPython/pull/4519
This commit is contained in:
Zanie Blue 2023-07-17 10:00:08 -05:00 committed by GitHub
parent 6980037ad9
commit 704eb40108
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 20667 additions and 18194 deletions

36405
parser/src/python.rs generated

File diff suppressed because it is too large Load diff