mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 18:00:07 -04:00
fix(python): add support for typed (kw)args (PEP 484) (#5875)
This commit is contained in:
parent
757b4f6afb
commit
4a4dbe1cb1
1 changed files with 14 additions and 4 deletions
|
|
@ -138,15 +138,25 @@
|
||||||
|
|
||||||
; Variadic parameters *args, **kwargs
|
; Variadic parameters *args, **kwargs
|
||||||
(parameters
|
(parameters
|
||||||
(list_splat_pattern
|
(list_splat_pattern ; *args
|
||||||
; *args
|
|
||||||
(identifier) @variable.parameter))
|
(identifier) @variable.parameter))
|
||||||
|
|
||||||
(parameters
|
(parameters
|
||||||
(dictionary_splat_pattern
|
(dictionary_splat_pattern ; **kwargs
|
||||||
; **kwargs
|
|
||||||
(identifier) @variable.parameter))
|
(identifier) @variable.parameter))
|
||||||
|
|
||||||
|
; Typed variadic parameters
|
||||||
|
(parameters
|
||||||
|
(typed_parameter
|
||||||
|
(list_splat_pattern ; *args: type
|
||||||
|
(identifier) @variable.parameter)))
|
||||||
|
|
||||||
|
(parameters
|
||||||
|
(typed_parameter
|
||||||
|
(dictionary_splat_pattern ; *kwargs: type
|
||||||
|
(identifier) @variable.parameter)))
|
||||||
|
|
||||||
|
; Lambda parameters
|
||||||
(lambda_parameters
|
(lambda_parameters
|
||||||
(list_splat_pattern
|
(list_splat_pattern
|
||||||
(identifier) @variable.parameter))
|
(identifier) @variable.parameter))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue