aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/python/locals.scm
blob: f7d5937e9f043f9b3a724f8d59ea42f5eb28e11d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;; Scopes

[
  (module)
  (function_definition)
  (lambda)
] @local.scope

;; Definitions

; Parameters
(parameters
  (identifier) @local.definition)
(parameters
  (typed_parameter
    (identifier) @local.definition))
(parameters
  (default_parameter 
    name: (identifier) @local.definition))
(parameters 
  (typed_default_parameter 
    name: (identifier) @local.definition))
(parameters
  (list_splat_pattern ; *args
    (identifier) @local.definition))
(parameters
  (dictionary_splat_pattern ; **kwargs
    (identifier) @local.definition))
    
(lambda_parameters
  (identifier) @local.definition)
  
; Imports
(import_statement
  name: (dotted_name 
    (identifier) @local.definition))

(aliased_import
  alias: (identifier) @local.definition)

;; References

(identifier) @local.reference