Unnamed repository; edit this file 'description' to name the repository.
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
; Modules
(attribute
  name: (atom) @_attr
  (arguments (atom) @definition.module)
 (#eq? @_attr "module"))

; Constants
((attribute
    name: (atom) @_attr
    (arguments
      .
      [
        (atom) @definition.constant
        (call function: [(variable) (atom)] @definition.macro)
      ]))
 (#eq? @_attr "define"))

; Record definitions
((attribute
   name: (atom) @_attr
   (arguments
     .
     (atom) @definition.struct))
 (#eq? @_attr "record"))

; Function specs
((attribute
    name: (atom) @_attr
    (stab_clause name: (atom) @definition.interface))
 (#eq? @_attr "spec"))

; Types
((attribute
    name: (atom) @_attr
    (arguments
      (binary_operator
        left: [
          (atom) @definition.type
          (call function: (atom) @definition.type)
        ]
        operator: "::")))
 (#any-of? @_attr "type" "opaque"))

; Functions
(function_clause name: (atom) @definition.function)