mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-11 23:25:22 +00:00
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:
parent
6980037ad9
commit
704eb40108
9 changed files with 20667 additions and 18194 deletions
36405
parser/src/python.rs
generated
36405
parser/src/python.rs
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue