aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/snakemake/locals.scm
blob: 8b5e7c0b49ba343a0313219bed7806068fe05575 (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
; inherits: python

(rule_definition
  name: (identifier) @local.definition.type) @local.scope

(rule_inheritance
  alias: (as_pattern_target) @local.definition.type) @local.scope

(checkpoint_definition
  name: (identifier) @local.definition.type) @local.scope

(module_definition
  name: (identifier) @local.definition.type) @local.scope

; use rule A from X
(rule_import
  (rule_import_list
    (identifier) @local.definition.import)
  .
  module_name: (identifier) .) @local.scope

; use rule A from X as A_fromX
; use rule A from X as *_fromX
; use rule * from X as *_fromX
(rule_import
  alias: (as_pattern_target) @local.definition.import .) @local.scope

; use rule A from X with:
(rule_import
  (rule_import_list
    (identifier) @local.definition.type)
  .
  module_name: (identifier)
  .
  "with") @local.scope

; use rule A from X as Y with:
(rule_import
  alias: (as_pattern_target) @local.definition.type
  "with") @local.scope