-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjulia.xml
474 lines (439 loc) · 17.8 KB
/
julia.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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
Julia syntax highlighting file for the KDE editors Kate and Kwrite
====================================================================
This was adapted from the Matlab syntax highlighting file
Most of this XML file is straightforward. Only the character ' (')
needs nontrivial treatment, since it is both a postfix operator indicating
complex conjugate transpose (adjoint) and a character delimiter. It is an
adjoint operator in the following positions:
1) immediately after an identifier (variable, function, but not keyword)
2) immediately after a number literal
3) immediately after the closing parenthesis ), ] and }
4) immediately after a simple transpose operator .'
5) immediately after another adjoint operator '
Otherwise it is a character delimiter.
This is implemented using look-ahead regexps. If one of the entities in the
above cases 1-4 (identifier, number literal, ...) matches and look-ahead
shows that it is followed by a ', the entity is highlighted and control is
passed to the special context _adjoint, whose sole purpose is to correctly
highlight a series of ' (thus covering case 5 as well). _adjoint immediately
returns to the default context _normal.
Author: Timothy E. Holy, Washington University in St. Louis
-->
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Julia" section="Sources" version="0.3" kateversion="2.4" extensions="*.jl" casesensitive="1" priority="5" license="MIT">
<highlighting>
<list name="block_begin">
<item> begin </item>
<item> do </item>
<item> for </item>
<item> function </item>
<item> if </item>
<item> struct </item>
<item> let </item>
<item> quote </item>
<item> try </item>
<item> mutable struct </item>
<item> while </item>
</list>
<list name="block_eb">
<item> catch </item>
<item> finally </item>
<item> else </item>
<item> elseif </item>
</list>
<list name="block_end">
<item> end </item>
</list>
<list name="keywords">
<item> abstract type </item>
<item> primitive type </item>
<item> break </item>
<item> ccall </item>
<item> const </item>
<item> continue </item>
<item> export </item>
<item> global </item>
<item> import </item>
<item> importall </item>
<item> in </item>
<item> local </item>
<item> macro </item>
<item> module </item>
<item> baremodule </item>
<item> return </item>
<item> typealias </item>
<item> using </item>
</list>
<list name="types">
<item> AbstractArray </item>
<item> AbstractMatrix </item>
<item> AbstractRange </item>
<item> AbstractRemoteRef </item>
<item> AbstractSparseMatrix </item>
<item> AbstractVector </item>
<item> Any </item>
<item> Array </item>
<item> Associative </item>
<item> Bidiagonal </item>
<item> BitArray </item>
<item> BigFloat </item>
<item> BigInt </item>
<item> BitMatrix </item>
<item> BitVector </item>
<item> Bool </item>
<item> Char </item>
<item> CharString </item>
<item> Cholesky </item>
<item> CholeskyPivoted </item>
<item> Cmd </item>
<item> Colon </item>
<item> Complex </item>
<item> Complex64 </item>
<item> Complex128 </item>
<item> ComplexPair </item>
<item> DArray </item>
<item> Diagonal </item>
<item> Dict </item>
<item> Dims </item>
<item> EachLine </item>
<item> Eigen </item>
<item> Enumerate </item>
<item> EnvDict </item>
<item> Exception </item>
<item> Expr </item>
<item> FileMonitor </item>
<item> Filter </item>
<item> AbstractFloat </item>
<item> Float16 </item>
<item> Float32 </item>
<item> Float64 </item>
<item> Function </item>
<item> GeneralizedSchur </item>
<item> GeneralizedSVD </item>
<item> HeapSort </item>
<item> Hermitian </item>
<item> Hessenberg </item>
<item> Int </item>
<item> Int8 </item>
<item> Int16 </item>
<item> Int32 </item>
<item> Int64 </item>
<item> Int128 </item>
<item> Integer </item>
<item> BitSet </item>
<item> ImaginaryUnit </item>
<item> IO </item>
<item> IOBuffer </item>
<item> IOStream </item>
<item> LocalProcess </item>
<item> LU </item>
<item> Irrational </item>
<item> Matrix </item>
<item> NTuple </item>
<item> Number </item>
<item> ObjectIdDict </item>
<item> PollingFileWatcher </item>
<item> QR </item>
<item> QRPivoted </item>
<item> OrdinalRange </item>
<item> PipeBuffer </item>
<item> ProcessGroup </item>
<item> Ptr </item>
<item> RangeIndex </item>
<item> Rational </item>
<item> Real </item>
<item> Regex </item>
<item> RegexMatch </item>
<item> RegexMatchIterator </item>
<item> RepString </item>
<item> RevString </item>
<item> Reverse </item>
<item> Schur </item>
<item> Set </item>
<item> Signed </item>
<item> SparseMatrixCSC </item>
<item> SpawnNullStream </item>
<item> StridedArray </item>
<item> StridedMatrix </item>
<item> StridedVecOrMat </item>
<item> StridedVector </item>
<item> String </item>
<item> SubArray </item>
<item> SubDArray </item>
<item> SubOrDArray </item>
<item> SubString </item>
<item> SVD </item>
<item> Symbol </item>
<item> Symmetric </item>
<item> SymTridiagonal </item>
<item> TCPSocket </item>
<item> Task </item>
<item> TimeoutAsyncWork </item>
<item> TmStruct </item>
<item> Triangular </item>
<item> Tridiagonal </item>
<item> Tuple </item>
<item> Type </item>
<item> UInt </item>
<item> UInt8 </item>
<item> UInt16 </item>
<item> UInt32 </item>
<item> UInt64 </item>
<item> UInt128 </item>
<item> Union </item>
<item> UnitRange </item>
<item> Unsigned </item>
<item> UVError </item>
<item> VecOrMat </item>
<item> Vector </item>
<item> VersionNumber </item>
<item> Void </item>
<item> WeakKeyDict </item>
<item> WeakRef </item>
<item> Zip </item>
<item> AbstractRNG </item>
<item> MersenneTwister </item>
<item> Condition </item>
<item> IPv4 </item>
<item> IPv6 </item>
<item> ClusterManager </item>
<item> RawFD </item>
<item> WindowsRawSocket </item>
<item> PipeBuffer </item>
<item> UV_READABLE </item>
<item> UV_WRITEABLE </item>
<item> Stat </item>
<item> Factorization </item>
<item> BunchKaufman </item>
<item> CholeskyDense </item>
<item> CholeskyPivotedDense </item>
<item> LUDense </item>
<item> LUTridiagonal </item>
<item> LDLTTridiagonal </item>
<item> QRDense </item>
<item> QRPivotedDense </item>
<item> SVDDense </item>
<item> GSVDDense </item>
<item> InsertionSort </item>
<item> QuickSort </item>
<item> MergeSort </item>
<item> TimSort </item>
<item> Cchar </item>
<item> Cuchar </item>
<item> Cshort </item>
<item> Cushort </item>
<item> Cint </item>
<item> Cuint </item>
<item> Clong </item>
<item> Culong </item>
<item> Cptrdiff_t </item>
<item> Csize_t </item>
<item> Cssize_t </item>
<item> Clonglong </item>
<item> Culonglong </item>
<item> Cintmax_t </item>
<item> Cuintmax_t </item>
<item> Cfloat </item>
<item> Cdouble </item>
<item> Cwchar_t </item>
<item> ArgumentError </item>
<item> ProcessExitedException </item>
<item> DisconnectException </item>
<item> EOFError </item>
<item> ErrorException </item>
<item> KeyError </item>
<item> LoadError </item>
<item> MethodError </item>
<item> ParseError </item>
<item> SystemError </item>
<item> TypeError </item>
<item> Collections </item>
<item> Order </item>
<item> Sys </item>
<item> Test </item>
<item> Pkg </item>
<item> Pkg2 </item>
<item> Operators </item>
<item> Meta </item>
<item> Graphics </item>
<item> Profile </item>
</list>
<list name="constants">
<item> ARGS </item>
<item> C_NULL </item>
<item> CPU_CORES </item>
<item> DL_LOAD_PATH </item>
<item> ENDIAN_BOM </item>
<item> ENV </item>
<item> Inf </item>
<item> Inf32 </item>
<item> LOAD_PATH </item>
<item> MS_ASYNC </item>
<item> MS_INVALIDATE </item>
<item> MS_SYNC </item>
<item> NaN </item>
<item> NaN32 </item>
<item> RTLD_LOCAL </item>
<item> RTLD_GLOBAL </item>
<item> RTLD_LAZY </item>
<item> RTLD_NOW </item>
<item> RTLD_NOLOAD </item>
<item> RTLD_NODELETE </item>
<item> RTLD_DEEPBIND </item>
<item> RTLD_FIRST </item>
<item> STDERR </item>
<item> STDIN </item>
<item> STDOUT </item>
<item> VERSION </item>
<item> WORD_SIZE </item>
</list>
<list name="math-constants">
<item> im </item>
<item> π </item>
<item> pi </item>
<item> ℯ </item>
<item> e </item>
<item> γ </item>
<item> eulergamma </item>
<item> catalan </item>
<item> φ </item>
<item> golden </item>
</list>
<contexts>
<context name="_normal" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces />
<!-- Blocks -->
<keyword context="#stay" attribute="Keyword" String="block_begin" beginRegion="block" />
<keyword context="#stay" attribute="Keyword" String="block_eb" endRegion="block" beginRegion="block" />
<keyword context="#stay" attribute="Keyword" String="block_end" endRegion="block" />
<StringDetect String="#BEGIN" context="region_marker" attribute="FoldingComment" beginRegion="user_region" />
<StringDetect String="#END" context="region_marker" attribute="FoldingComment" endRegion="user_region" />
<!-- Keywords, types, and comments -->
<keyword context="#stay" attribute="Keyword" String="keywords" />
<keyword context="#stay" attribute="Data Type" String="types" />
<keyword context="#stay" attribute="Constant" String="constants" />
<keyword context="#stay" attribute="Math Constant" String="math-constants" />
<Detect2Chars char="#" char1="=" context="multiline-comment" attribute="Comment"/>
<DetectChar char="#" context="1-comment" attribute="Comment"/>
<!-- Lists and arrays -->
<!-- <DetectChar char="(" context="nested" beginRegion="nested" attribute="Delimiter" />
<DetectChar char="[" context="squared" beginRegion="squared" attribute="Delimiter" />
<DetectChar char="{" context="curly" beginRegion="curly" attribute="Delimiter" /> -->
<!-- Strings -->
<DetectChar attribute="String" context="String" char="""/>
<!-- Multi-character operators -->
<StringDetect context="#stay" attribute="Operator" String="..."/>
<StringDetect context="#stay" attribute="Operator" String="::"/>
<StringDetect context="#stay" attribute="Operator" String=">>>"/>
<StringDetect context="#stay" attribute="Operator" String=">>"/>
<StringDetect context="#stay" attribute="Operator" String="<<"/>
<StringDetect context="#stay" attribute="Operator" String="=="/>
<StringDetect context="#stay" attribute="Operator" String="!="/>
<StringDetect context="#stay" attribute="Operator" String="<="/>
<StringDetect context="#stay" attribute="Operator" String=">="/>
<StringDetect context="#stay" attribute="Operator" String="&&"/>
<StringDetect context="#stay" attribute="Operator" String="||"/>
<StringDetect context="#stay" attribute="Operator" String=".*"/>
<StringDetect context="#stay" attribute="Operator" String=".^"/>
<StringDetect context="#stay" attribute="Operator" String="./"/>
<StringDetect context="#stay" attribute="Operator" String=".'"/>
<StringDetect context="#stay" attribute="Operator" String="+="/>
<StringDetect context="#stay" attribute="Operator" String="-="/>
<StringDetect context="#stay" attribute="Operator" String="*="/>
<StringDetect context="#stay" attribute="Operator" String="/="/>
<StringDetect context="#stay" attribute="Operator" String="&="/>
<StringDetect context="#stay" attribute="Operator" String="|="/>
<StringDetect context="#stay" attribute="Operator" String="$="/>
<StringDetect context="#stay" attribute="Operator" String=">>>="/>
<StringDetect context="#stay" attribute="Operator" String=">>="/>
<StringDetect context="#stay" attribute="Operator" String="<<="/>
<!-- Look-ahead for adjoint ' after variable, number literal, closing braces and .' -->
<RegExpr context="_adjoint" attribute="Variable" String="[a-zA-Z]\w*(?=')" />
<RegExpr context="_adjoint" attribute="Float" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?(im)?(?=')" />
<RegExpr context="_adjoint" attribute="Delimiter" String="[\)\]}](?=')" />
<RegExpr context="_adjoint" attribute="Operator" String="\.'(?=')" />
<!-- If ' is not the adjoint operator, it starts a character or an unterminated char -->
<RegExpr context="#stay" attribute="Char" String="'[^']*(''[^']*)*'(?=[^']|$)" />
<RegExpr context="#stay" attribute="Incomplete Char" String="'[^']*(''[^']*)*" />
<!-- Identifiers, numbers and braces -->
<!-- We can't use HlCHex, Int, and Float because we need to allow the "im" at the end of complex numbers -->
<DetectIdentifier context="#stay" attribute="Variable" />
<RegExpr context="#stay" attribute="Hex" String="0x[0-9a-fA-F]+(im)?" />
<RegExpr context="#stay" attribute="Float" String="(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?(im)?" />
<AnyChar context="#stay" attribute="Delimiter" String="()[]{}"/>
<!-- Single-character operators -->
<AnyChar context="#stay" attribute="Operator" String="*+-/\&|<>~$!^=,;:@"/>
</context>
<!-- Context for user block (#BEGIN...#END) -->
<context name="region_marker" lineEndContext="#pop" attribute="FoldingComment" >
<IncludeRules context="1-comment" />
</context>
<!-- Contexts entered after beginning a list or array -->
<context name="nested" attribute="Normal text" lineEndContext="#stay">
<DetectChar char=")" context="#pop" endRegion="nested" attribute="Delimiter" />
</context>
<context name="squared" attribute="Normal text" lineEndContext="#stay">
<DetectChar char="]" context="#pop" endRegion="squared" attribute="Delimiter" />
</context>
<context name="curly" attribute="Normal text" lineEndContext="#stay">
<DetectChar char="}" context="#pop" endRegion="curly" attribute="Delimiter" />
</context>
<!-- Context entered after encountering an ' adjoint operator -->
<context name="_adjoint" attribute="Operator" lineEndContext="#pop">
<RegExpr context="#pop" attribute="Operator" String="'+" />
</context>
<!-- Context entered after encountering an " (string) -->
<context attribute="String" lineEndContext="#pop" name="String">
<DetectSpaces />
<DetectIdentifier />
<LineContinue attribute="String" context="#stay"/>
<HlCStringChar attribute="String Char" context="#stay"/>
<DetectChar attribute="String" context="#pop" char="""/>
</context>
<!-- 1-line comment: #pop@EOL -->
<context name="1-comment" lineEndContext="#pop" attribute="Comment">
<IncludeRules context="##Alerts" />
<DetectSpaces />
<DetectIdentifier />
</context>
<!-- multi-line comment: -->
<context name="multiline-comment" lineEndContext="#stay" attribute="Comment">
<Detect2Chars attribute="Comment" context="#pop" char="=" char1="#" endRegion="Comment"/>
<IncludeRules context="##Alerts" />
<DetectSpaces />
<DetectIdentifier />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Variable" defStyleNum="dsNormal" />
<itemData name="Operator" defStyleNum="dsNormal"/>
<itemData name="Math Constant" defStyleNum="dsDecVal" />
<itemData name="Decimal" defStyleNum="dsDecVal" />
<itemData name="Float" defStyleNum="dsFloat" />
<itemData name="Hex" defStyleNum="dsBaseN" />
<itemData name="Delimiter" defStyleNum="dsNormal" />
<itemData name="String" defStyleNum="dsString"/>
<itemData name="Char" defStyleNum="dsChar"/>
<itemData name="Incomplete Char" defStyleNum="dsChar"/>
<itemData name="System" defStyleNum="dsBaseN"/>
<itemData name="Keyword" defStyleNum="dsKeyword"/>
<itemData name="Constant" defStyleNum="dsKeyword"/>
<itemData name="Data Type" defStyleNum="dsDataType"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="FoldingComment" defStyleNum="dsComment" />
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#" />
<comment name="multiLine" start="#=" end="=#" />
</comments>
<keywords casesensitive="1" weakDeliminator=""/>
</general>
</language>
<!-- It's recommended to put the following line in the Variables field under Settings->Configure Kate->Open/Save->Modes&Filetypes -->
<!-- kate: space-indent on; indent-width 4; mixed-indent off; indent-mode cstyle; -->