-
Notifications
You must be signed in to change notification settings - Fork 1
/
zig.xml
298 lines (290 loc) · 10.8 KB
/
zig.xml
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?xml version="1.0" encoding="UTF-8"?>
<!-- kate: indent-width 2; -->
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY int "(?:[0-9](?:_?[0-9])*)">
<!ENTITY bin_int "(?:[01](?:_?[01])*)">
<!ENTITY oct_int "(?:[0-7](?:_?[0-7])*)">
<!ENTITY hex_int "(?:[0-9A-Fa-f](?:_?[0-9A-Fa-f])*)">
<!ENTITY exp_float "(?:[eE][+-]?∫)">
<!ENTITY exp_hexfloat "(?:[pP][-+]?∫)">
<!ENTITY char_escape "(?:\\(?:[nrt\\\'\"]|x[0-9a-fA-F]{2}|u{[0-9a-fA-F]{1,6}}))">
]>
<language name="Zig" section="Sources"
version="1" kateversion="5.0"
indenter="cstyle"
extensions="*.zig"
mimetype="text/x-zigsrc"
priority="5"
author="Celeste Wouters ([email protected])" license="LGPL">
<highlighting>
<list name="controlflow">
<item>async</item>
<item>await</item>
<item>break</item>
<item>catch</item>
<item>continue</item>
<item>defer</item>
<item>else</item>
<item>errdefer</item>
<item>for</item>
<item>if</item>
<item>orelse</item>
<item>resume</item>
<item>return</item>
<item>suspend</item>
<item>switch</item>
<item>try</item>
<item>unreachable</item>
<item>while</item>
</list>
<list name="keywords">
<item>and</item>
<item>asm</item>
<item>callconv</item>
<item>enum</item>
<item>error</item>
<item>export</item>
<item>extern</item>
<item>false</item>
<item>fn</item>
<item>inline</item>
<item>nosuspend</item>
<item>noinline</item>
<item>null</item>
<item>opaque</item>
<item>opaque</item>
<item>pub</item>
<item>linksection</item>
<item>struct</item>
<item>test</item>
<item>true</item>
<item>undefined</item>
<item>union</item>
<item>usingnamespace</item>
<item>var</item>
<item>...</item>
</list>
<list name="attributes">
<item>align</item>
<item>allowzero</item>
<item>comptime</item>
<item>const</item>
<item>noalias</item>
<item>packed</item>
<item>threadlocal</item>
<item>volatile</item>
</list>
<list name="types">
<item>isize</item>
<item>usize</item>
<item>c_short</item>
<item>c_ushort</item>
<item>c_int</item>
<item>c_uint</item>
<item>c_long</item>
<item>c_ulong</item>
<item>c_longlong</item>
<item>c_ulonglong</item>
<item>c_longdouble</item>
<item>c_void</item>
<item>f16</item>
<item>f32</item>
<item>f64</item>
<item>f128</item>
<item>bool</item>
<item>void</item>
<item>noreturn</item>
<item>type</item>
<item>anyerror</item>
<item>comptime_int</item>
<item>comptime_float</item>
<item>anyframe</item>
<item>anytype</item>
</list>
<list name="builtins">
<item>@addWithOverflow</item>
<item>@alignCast</item>
<item>@alignOf</item>
<item>@as</item>
<item>@asyncCall</item>
<item>@atomicLoad</item>
<item>@atomicRmw</item>
<item>@atomicStore</item>
<item>@bitCast</item>
<item>@bitOffsetOf</item>
<item>@bitReverse</item>
<item>@bitSizeOf</item>
<item>@boolToInt</item>
<item>@breakpoint</item>
<item>@byteSwap</item>
<item>@call</item>
<item>@cDefine</item>
<item>@ceil</item>
<item>@cImport</item>
<item>@cInclude</item>
<item>@clz</item>
<item>@cmpxchgStrong</item>
<item>@cmpxchgWeak</item>
<item>@compileError</item>
<item>@compileLog</item>
<item>@cos</item>
<item>@ctz</item>
<item>@cUndef</item>
<item>@divExact</item>
<item>@divFloor</item>
<item>@divTrunc</item>
<item>@embedFile</item>
<item>@enumToInt</item>
<item>@errorName</item>
<item>@errorReturnTrace</item>
<item>@errorToInt</item>
<item>@errSetCast</item>
<item>@exp2</item>
<item>@exp</item>
<item>@export</item>
<item>@extern</item>
<item>@fabs</item>
<item>@fence</item>
<item>@field</item>
<item>@fieldParentPtr</item>
<item>@floatCast</item>
<item>@floatToInt</item>
<item>@floor</item>
<item>@frameAddress</item>
<item>@frame</item>
<item>@Frame</item>
<item>@frameSize</item>
<item>@hasDecl</item>
<item>@hasField</item>
<item>@import</item>
<item>@intCast</item>
<item>@intToEnum</item>
<item>@intToError</item>
<item>@intToFloat</item>
<item>@intToPtr</item>
<item>@log10</item>
<item>@log2</item>
<item>@log</item>
<item>@maximum</item>
<item>@memcpy</item>
<item>@memset</item>
<item>@minimum</item>
<item>@mod</item>
<item>@mulAdd</item>
<item>@mulWithOverflow</item>
<item>@offsetOf</item>
<item>@panic</item>
<item>@popCount</item>
<item>@ptrCast</item>
<item>@ptrToInt</item>
<item>@reduce</item>
<item>@rem</item>
<item>@returnAddress</item>
<item>@round</item>
<item>@select</item>
<item>@setAlignStack</item>
<item>@setCold</item>
<item>@setEvalBranchQuota</item>
<item>@setFloatMode</item>
<item>@setRuntimeSafety</item>
<item>@shlExact</item>
<item>@shlWithOverflow</item>
<item>@shrExact</item>
<item>@shuffle</item>
<item>@sin</item>
<item>@sizeOf</item>
<item>@splat</item>
<item>@sqrt</item>
<item>@src</item>
<item>@subWithOverflow</item>
<item>@tagName</item>
<item>@This</item>
<item>@truncate</item>
<item>@trunc</item>
<item>@typeInfo</item>
<item>@Type</item>
<item>@typeName</item>
<item>@TypeOf</item>
<item>@unionInit</item>
<item>@wasmMemoryGrow</item>
<item>@wasmMemorySize</item>
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
<DetectSpaces />
<keyword attribute="Control Flow" context="#stay" String="controlflow"/>
<keyword attribute="Keyword" context="#stay" String="keywords"/>
<keyword attribute="Type Attribute" context="#stay" String="attributes"/>
<keyword attribute="Data Type" context="#stay" String="types"/>
<!-- Match non-power of two ints -->
<RegExpr attribute="Data Type" context="#stay" String="[ui]0*(?:6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|\d{1,4})(?!\d)" />
<keyword attribute="Builtin" context="#stay" String="builtins"/>
<DetectIdentifier />
<DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
<DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
<!-- Match numbers -->
<RegExpr attribute="Decimal" context="Number" String="\.?[0-9]" lookAhead="true" />
<RegExpr attribute="Char" context="#stay" String="'(?:.|&char_escape;)'" />
<HlCChar attribute="Char" context="#stay"/>
<DetectChar attribute="String" context="String" char="""/>
<Detect2Chars attribute="Multiline String" context="MLString" char="\" char1="\"/>
<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
<AnyChar attribute="Symbol" context="#stay" String=":!%&()+,-/.*<=>?[]|~^;"/>
</context>
<context attribute="Multiline String" lineEndContext="#pop" name="MLString">
</context>
<context attribute="String" lineEndContext="#pop" name="String">
<LineContinue attribute="String" context="#stay"/>
<RegExpr attribute="String Char" context="#stay" String="&char_escape;" />
<DetectChar attribute="String" context="#pop" char="""/>
</context>
<context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
<LineContinue attribute="Comment" context="#stay"/>
<IncludeRules context="##Alerts" />
</context>
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
<IncludeRules context="##Alerts" />
</context>
<context name="Number" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Float" context="#pop" String="\.∫&exp_float;?|∫(?:&exp_float;|\.∫?&exp_float;?)|0x(?:\.&hex_int;&exp_hexfloat;?|&hex_int;(?:&exp_hexfloat;|\.&hex_int;?&exp_hexfloat;?))" />
<IncludeRules context="Integer" />
</context>
<context name="Integer" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Hex" context="#pop" String="0x&hex_int;(?!\w)" />
<RegExpr attribute="Binary" context="#pop" String="0b&bin_int;(?!\w)" />
<RegExpr attribute="Octal" context="#pop" String="0o&oct_int;(?!\w)" />
<RegExpr attribute="Decimal" context="#pop" String="(?:0(?![xbo])|[1-9])(?:_?[0-9])*(?!\w)" />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Type Attribute" defStyleNum="dsAttribute" spellChecking="false"/>
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Builtin" defStyleNum="dsBuiltIn" spellChecking="false"/>
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Binary" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
<itemData name="Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="String Char" defStyleNum="dsSpecialChar"/>
<itemData name="Multiline String" defStyleNum="dsString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="//" />
<comment name="multiLine" start="/*" end="*/" />
</comments>
<keywords casesensitive="1" additionalDeliminator="'"" />
</general>
</language>