mirror of
https://github.com/vim/vim.git
synced 2025-10-28 09:27:14 -04:00
`type` became a soft keyword in Python 3.12. In that form, it is a
statement that declares a type alias:
# type_stmt ::= 'type' identifier [type_params] "=" expression
type Point = tuple[float, float]
To implement support for this, this change does three things:
1. adds a `pythonType` group (linked to `Type`)
2. matches `type` followed by an identifier as `pythonStatement`
3. continues to match `type` in other forms as `pythonBuiltin`
Ref:
- https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
- https://docs.python.org/3/reference/simple_stmts.html#the-type-statement
closes: #18090
Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>