aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/pony/locals.scm
blob: a27e501a333d9befc96f1b1f88d94148f7d392dd (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
; Scopes
[
  (use_statement)
  (actor_definition)
  (class_definition)
  (primitive_definition)
  (interface_definition)
  (trait_definition)
  (struct_definition)
  (constructor)
  (method)
  (behavior)
  (if_statement)
  (iftype_statement)
  (elseif_block)
  (elseiftype_block)
  (else_block)
  (for_statement)
  (while_statement)
  (try_statement)
  (with_statement)
  (repeat_statement)
  (recover_statement)
  (match_statement)
  (case_statement)
  (parenthesized_expression)
  (tuple_expression)
  (array_literal)
  (object_literal)
] @local.scope

; References
(identifier) @local.reference

; Definitions
(field
  name: (identifier) @local.definition.field)

(use_statement
  (identifier) @local.definition.import)

(constructor
  (identifier) @local.definition.method)

(method
  (identifier) @local.definition.method)

(behavior
  (identifier) @local.definition.method)

(actor_definition
  (identifier) @local.definition.type)

(type_alias
  (identifier) @local.definition.type)

(class_definition
  (identifier) @local.definition.type)

(primitive_definition
  (identifier) @local.definition.type)

(interface_definition
  (identifier) @local.definition.type)

(trait_definition
  (identifier) @local.definition.type)

(struct_definition
  (identifier) @local.definition.type)

(parameter
  name: (identifier) @local.definition.parameter)

(variable_declaration
  (identifier) @local.definition.var)

(for_statement
  [
    (identifier) @local.definition.var
    (tuple_expression
      (identifier) @local.definition.var)
  ])

(with_elem
  (identifier) @local.definition.var)