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
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
87
88
89
90
91
92
93
94
95
96
97
; Expressions 

(call_expression
  function: (identifier) @function)

(call_expression
  function: (selector_expression
    field: (identifier) @function.method))


; Type Definitions

(type_declaration (identifier) @type)

(definition 
  relation: (identifier) @variable)


; Relation Definitions 

(relation_def (identifier) @variable.other.member)

(direct_relationship (identifier) @type)
(direct_relationship (conditional (identifier) @function))

(relation_ref 
  . (identifier) @type
  (identifier) @variable.other.member)

(indirect_relation
  . (identifier) @variable.other.member
    (identifier) @variable)


; Condition Defintions

(condition_declaration
  name: (identifier) @function)

(condition_declaration (param (identifier) @variable.parameter))

(binary_expression (identifier) @variable)

((type_identifier) @type.builtin
  (#any-of? @type.builtin "string" "int" "map" "uint" "list" "timestamp" "bool" "duration" "double" "ipaddress"))


; Operators

[
  "!="
  "%"
  "&"
  "&&"
  "&^"
  "*"
  "+"
  "-"
  "/"
  "<"
  "<<"
  "<="
  "=="
  ">"
  ">="
  ">>"
  "^"
  "|"
  "||"
] @operator

[
  "or"
  "and"
  "but not"
  "from"
  "with"
] @keyword.operator

; Keywords

[
  "model"
  "schema"
  "type"
  "relations"
  "define"
] @keyword

[
  "condition"
] @keyword.function

; Misc

(version) @constant.numeric
(comment) @comment