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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
;; fallback for identifiers
(ident) @variable

;; Comments

(comment) @comment

; CryptoVerif-only opaque blocks
(proof) @comment.unused
(def) @comment.unused

;; Types
(type_def
  name: (ident) @type)

(typeid) @type
(typeid
  (ident) @type)

(decl_table
  name: (ident) @type)

;; Function & Macro Definitions

(function_def
  name: (ident) @function)

(function_macro_def
  name: (ident) @function.macro)

(decl_pred
  name: (ident) @function)

(decl_event
  name: (ident) @function)

;; Function Calls

(term_function_call
  name: (ident) @function)
(term_function_call
 (term (ident) @variable.parameter))

(pterm_function_call
  name: (ident) @function)
(pterm_function_call
 (pterm (ident) @variable.parameter))

(decl_process_macro
  name: (ident) @function)
(decl_process_macro
 (typedecl (ident) @variable.parameter))

(gterm_function_call
  name: (ident) @function)
(gterm_function_call
 (gterm (ident) @variable.parameter))

(gformat_function_call
  name: (ident) @function)
(gformat_function_call
 (gformat (ident) @variable.parameter))

(process_function_call
  name: (ident) @function)
(process_function_call
 (pterm (ident) @variable.parameter))

(process_input "in" @function.builtin)
(process_input
 (pterm (ident) @variable.parameter))
(process_input
 (pattern (ident) @variable.parameter))
(process_input
 (pattern (pattern (ident) @variable.parameter)))

(process_output "out" @function.builtin)
(process_output
 (pterm (ident) @variable.parameter))
(process_output
 (pterm (pterm (ident) @variable.parameter)))

;; Literals

(nat) @constant.numeric
(int) @constant.numeric
(string) @string

[
  "true"
  "false"
] @constant.builtin.boolean

"fail" @constant.builtin

(process_final_item
  "0" @constant.builtin)

;; Keywords

[
  "among"
  "axiom"
  "choice"
  "clauses"
  "const"
  "def"
  "elimtrue"
  "else"
  "equation"
  "equivalence"
  "event"
  "expand"
  "fail"
  "forall"
  "foreach"
  "free"
  "fun"
  "get"
  "if"
  "inj-event"
  "insert"
  "lemma"
  "let"
  "letfun"
  "letproba"
  "new"
  "noninterf"
  "noselect"
  "not"
  "nounif"
  "otherwise"
  "param"
  "phase"
  "pred"
  "proba"
  "process"
  "proof"
  "public_vars"
  "putbegin"
  "query"
  "reduc"
  "restriction"
  "secret"
  "select"
  "set"
  "suchthat"
  "sync"
  "table"
  "then"
  "type"
  "weaksecret"
  "yield"
] @keyword

(decl_channel "channel" @keyword) ; "channel" can also be used as type, hence the restriction
(process_let "in" @keyword) ; "in" can is keyword in "let ... in", but builtin function otherwise

;; Operators

[
  "="
  "<>"
  "<="
  ">="
  "<"
  ">"
  "+"
  "-"
  "==>"
  "<-"
  "<-R"
  "->"
  "<->"
  "<=>"
  "||"
  "&&"
  "|"
  "!"
] @keyword.operator

;; Punctuation

[
  "."
  ","
  ";"
  ":"
] @punctuation.delimiter

[
  "("
  ")"
  "["
  "]"
  "{"
  "}"
] @punctuation.bracket

;; Options

(option) @attribute
(nounifoption) @attribute