summaryrefslogtreecommitdiffstats
path: root/kate/data/tcl.xml
blob: c65b6358ed8ef124f42a49699ba6c32ed65f8a4f (plain)
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
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">

<!-- Authors: Alexander Dederer & JM. Philippe -->
<!-- Copyright: BSD copyright & Irsid - Arcelor Innovation R&D -->
<!-- Ported to Kate 2.0/ KWrite 4.0 by Joseph Wenninger (Updated by Simon Robins)-->
<!--
    Updated by Pawel Salawa (boogie at scripts dot one dot pl)

    Revision history:
        1.10:
            - Fixed problem with single ':' character after variable name (it's no longer variable,
              because only double-colon is namespace delimiter and can be part of variable name).
            - Fixed problem with matching quote character next to regular character, for example:
              puts {"string"}
              In that case left bracked was marked as string, but it's no longer like that.
            - Fixed problem with variable names like: ${text\}test}
              It whole is valid variable name, because of escape character.
            - Fixed problem with marking ';' character as a comment when '#' character was after the ';'.
            - Fixed problem with marking options. '-' character after word-delimiter character caused
              marking that word-delimiter character as option too, even it wasn't white-space.
            - Few other minor optimalizations.
	1.09:
	    - Added fast comments support (Ctrl+d or whatever your shortcut is)
	    - Fixed single-character variables detection
	    - Fixed detection of varaibles with names containing serval namespace delimiters (::)
-->

<language name="Tcl/Tk" version="1.10" kateversion="2.4" section="Scripts" extensions="*.tcl;*.tk" mimetype="text/x-tcl">
  <highlighting>
    <list name="keywords">
      <item> after </item>
      <item> append  </item>
      <item> AppleScript  </item>
      <item> argv  </item>
      <item> argc  </item>
      <item> array  </item>
      <item> auto_execk  </item>
      <item> auto_load  </item>
      <item> auto_mkindex  </item>
      <item> auto_path  </item>
      <item> auto_reset  </item>
      <item> beep  </item>
      <item> bell  </item>
      <item> binary  </item>
      <item> bind  </item>
      <item> bindtags  </item>
      <item> bgerror  </item>
      <item> break  </item>
      <item> button  </item>
      <item> canvas  </item>
      <item> case  </item>
      <item> catch  </item>
      <item> cd  </item>
      <item> checkbutton  </item>
      <item> clipboard  </item>
      <item> clock  </item>
      <item> close  </item>
      <item> concat  </item>
      <item> console  </item>
      <item> continue  </item>
      <item> dde  </item>
      <item> destroy  </item>
      <item> else  </item>
      <item> elseif  </item>
      <item> encoding  </item>
      <item> entry  </item>
      <item> env  </item>
      <item> eof  </item>
      <item> error  </item>
      <item> errorCode  </item>
      <item> errorInfo  </item>
      <item> eval  </item>
      <item> event  </item>
      <item> exec  </item>
      <item> exit  </item>
      <item> expr  </item>
      <item> fblocked  </item>
      <item> fconfigure  </item>
      <item> fcopy  </item>
      <item> file  </item>
      <item> fileevent  </item>
      <item> flush  </item>
      <item> focus  </item>
      <item> font  </item>
      <item> for  </item>
      <item> foreach  </item>
      <item> format  </item>
      <item> frame  </item>
      <item> gets  </item>
      <item> glob  </item>
      <item> global  </item>
      <item> grab  </item>
      <item> grid  </item>
      <item> history  </item>
      <item> if  </item>
      <item> image  </item>
      <item> incr  </item>
      <item> info  </item>
      <item> interp  </item>
      <item> join  </item>
      <item> label  </item>
      <item> lappend  </item>
      <item> lindex  </item>
      <item> linsert  </item>
      <item> list  </item>
      <item> listbox  </item>
      <item> llength  </item>
      <item> load  </item>
      <item> lower  </item>
      <item> lrange  </item>
      <item> ltqreplace  </item>
      <item> lsearch  </item>
      <item> lsort  </item>
      <item> menu  </item>
      <item> menubutton  </item>
      <item> message  </item>
      <item> namespace  </item>
      <item> open  </item>
      <item> option  </item>
      <item> OptProc  </item>
      <item> pack  </item>
      <item> package  </item>
      <item> parray  </item>
      <item> pid  </item>
      <item> place  </item>
      <item> pkg_mkindex  </item>
      <item> proc  </item>
      <item> puts  </item>
      <item> pwd  </item>
      <item> radiobutton  </item>
      <item> raise  </item>
      <item> read  </item>
      <item> regexp  </item>
      <item> registry  </item>
      <item> regsub  </item>
      <item> rename  </item>
      <item> resource  </item>
      <item> return  </item>
      <item> scale  </item>
      <item> scan  </item>
      <item> scrollbar  </item>
      <item> seek  </item>
      <item> selection  </item>
      <item> send  </item>
      <item> set  </item>
      <item> socket  </item>
      <item> source  </item>
      <item> split  </item>
      <item> string  </item>
      <item> subst  </item>
      <item> switch  </item>
      <item> tclLog  </item>
      <item> tcl_endOfWord  </item>
      <item> tcl_findLibrary  </item>
      <item> tcl_library  </item>
      <item> tcl_patchLevel  </item>
      <item> tcl_platform  </item>
      <item> tcl_precision  </item>
      <item> tcl_rcFileName  </item>
      <item> tcl_rcRsrcName  </item>
      <item> tcl_startOfNextWord  </item>
      <item> tcl_startOfPreviousWord  </item>
      <item> tcl_traceCompile  </item>
      <item> tcl_traceExec  </item>
      <item> tcl_version  </item>
      <item> tcl_wordBreakAfter  </item>
      <item> tcl_wordBreakBefore  </item>
      <item> tell  </item>
      <item> text  </item>
      <item> time  </item>
      <item> tk  </item>
      <item> tkTabToWindow  </item>
      <item> tkwait  </item>
      <item> tk_chooseColor  </item>
      <item> tk_chooseDirectory  </item>
      <item> tk_focusFollowMouse  </item>
      <item> tk_focusNext  </item>
      <item> tk_focusPrev  </item>
      <item> tk_getOpenFile  </item>
      <item> tk_getSaveFile  </item>
      <item> tk_library  </item>
      <item> tk_messageBox  </item>
      <item> tk_optionMenu  </item>
      <item> tk_patchLevel  </item>
      <item> tk_popup  </item>
      <item> tk_strictMotif  </item>
      <item> tk_version  </item>
      <item> toplevel  </item>
      <item> trace  </item>
      <item> unknown  </item>
      <item> unset  </item>
      <item> update  </item>
      <item> uplevel  </item>
      <item> upvar  </item>
      <item> variable  </item>
      <item> vwait  </item>
      <item> while  </item>
      <item> winfo  </item>
      <item> wm  </item>
    </list>

    <list name="keywords-opt">
      <item> add </item>
      <item> args </item>
      <item> atime </item>
      <item> attributes </item>
      <item> body </item>
      <item> bytelength </item>
      <item> cancel </item>
      <item> channels </item>
      <item> clicks </item>
      <item> cmdcount </item>
      <item> commands </item>
      <item> compare </item>
      <item> complete </item>
      <item> convertfrom </item>
      <item> convertto </item>
      <item> copy </item>
      <item> default </item>
      <item> delete </item>
      <item> dirname </item>
      <item> equal </item>
      <item> executable </item>
      <item> exists </item>
      <item> extension </item>
      <item> first </item>
      <item> forget </item>
      <item> format </item>
      <item> functions </item>
      <item> globals </item>
      <item> hostname </item>
      <item> idle </item>
      <item> ifneeded </item>
      <item> index </item>
      <item> info </item>
      <item> is </item>
      <item> isdirectory </item>
      <item> isfile </item>
      <item> join </item>
      <item> last </item>
      <item> length </item>
      <item> level </item>
      <item> library </item>
      <item> link </item>
      <item> loaded </item>
      <item> locals </item>
      <item> lstat </item>
      <item> map </item>
      <item> match </item>
      <item> mkdir </item>
      <item> mtime </item>
      <item> nameofexecutable </item>
      <item> names </item>
      <item> nativename </item>
      <item> normalize </item>
      <item> number </item>
      <item> owned </item>
      <item> patchlevel </item>
      <item> pathtype </item>
      <item> present </item>
      <item> procs </item>
      <item> provide </item>
      <item> range </item>
      <item> readable </item>
      <item> readlink </item>
      <item> remove </item>
      <item> rename </item>
      <item> repeat </item>
      <item> tqreplace </item>
      <item> require </item>
      <item> rootname </item>
      <item> scan </item>
      <item> script </item>
      <item> seconds </item>
      <item> separator </item>
      <item> sharedlibextension </item>
      <item> size </item>
      <item> split </item>
      <item> stat </item>
      <item> system </item>
      <item> tail </item>
      <item> tclversion </item>
      <item> tolower </item>
      <item> totitle </item>
      <item> toupper </item>
      <item> trim </item>
      <item> trimleft </item>
      <item> trimright </item>
      <item> type </item>
      <item> unknown </item>
      <item> variable </item>
      <item> vars </item>
      <item> vcompare </item>
      <item> vdelete </item>
      <item> versions </item>
      <item> vinfo </item>
      <item> volumes </item>
      <item> vsatisfies </item>
      <item> wordend </item>
      <item> wordstart </item>
      <item> writable </item>

      <item> activate </item>
      <item> actual </item>
      <item> addtag </item>
      <item> append </item>
      <item> appname </item>
      <item> aspect </item>
      <item> atom </item>
      <item> atomname </item>
      <item> bbox </item>
      <item> bind </item>
      <item> broadcast </item>
      <item> canvasx </item>
      <item> canvasy </item>
      <item> caret </item>
      <item> cells </item>
      <item> cget </item>
      <item> children </item>
      <item> class </item>
      <item> clear </item>
      <item> client </item>
      <item> clone </item>
      <item> colormapfull </item>
      <item> colormapwindows </item>
      <item> command </item>
      <item> configure </item>
      <item> containing </item>
      <item> coords </item>
      <item> create </item>
      <item> current </item>
      <item> curselection </item>
      <item> dchars </item>
      <item> debug </item>
      <item> deiconify </item>
      <item> delta </item>
      <item> depth </item>
      <item> deselect </item>
      <item> dlineinfo </item>
      <item> dtag </item>
      <item> dump </item>
      <item> edit </item>
      <item> entrycget </item>
      <item> entryconfigure </item>
      <item> families </item>
      <item> tqfind </item>
      <item> flash </item>
      <item> focus </item>
      <item> focusmodel </item>
      <item> fpixels </item>
      <item> fraction </item>
      <item> frame </item>
      <item> generate </item>
      <item> tqgeometry </item>
      <item> get </item>
      <item> gettags </item>
      <item> grid </item>
      <item> group </item>
      <item> handle </item>
      <item> height </item>
      <item> hide </item>
      <item> iconbitmap </item>
      <item> iconify </item>
      <item> icontqmask </item>
      <item> iconname </item>
      <item> iconposition </item>
      <item> iconwindow </item>
      <item> icursor </item>
      <item> id </item>
      <item> identify </item>
      <item> image </item>
      <item> insert </item>
      <item> interps </item>
      <item> inuse </item>
      <item> invoke </item>
      <item> ismapped </item>
      <item> itemcget </item>
      <item> itemconfigure </item>
      <item> keys </item>
      <item> lower </item>
      <item> manager </item>
      <item> mark </item>
      <item> maxsize </item>
      <item> measure </item>
      <item> metrics </item>
      <item> minsize </item>
      <item> move </item>
      <item> name </item>
      <item> nearest </item>
      <item> overrideredirect </item>
      <item> own </item>
      <item> panecget </item>
      <item> paneconfigure </item>
      <item> panes </item>
      <item> parent </item>
      <item> pathname </item>
      <item> pixels </item>
      <item> pointerx </item>
      <item> pointerxy </item>
      <item> pointery </item>
      <item> positionfrom </item>
      <item> post </item>
      <item> postcascade </item>
      <item> postscript </item>
      <item> protocol </item>
      <item> proxy </item>
      <item> raise </item>
      <item> release </item>
      <item> reqheight </item>
      <item> reqwidth </item>
      <item> resizable </item>
      <item> rgb </item>
      <item> rootx </item>
      <item> rooty </item>
      <item> scale </item>
      <item> scaling </item>
      <item> screen </item>
      <item> screencells </item>
      <item> screendepth </item>
      <item> screenheight </item>
      <item> screenmmheight </item>
      <item> screenmmwidth </item>
      <item> screenvisual </item>
      <item> screenwidth </item>
      <item> search </item>
      <item> see </item>
      <item> select </item>
      <item> selection </item>
      <item> server </item>
      <item> set </item>
      <item> show </item>
      <item> sizefrom </item>
      <item> stackorder </item>
      <item> state </item>
      <item> status </item>
      <item> tag </item>
      <item> title </item>
      <item> toplevel </item>
      <item> transient </item>
      <item> types </item>
      <item> unpost </item>
      <item> useinputmethods </item>
      <item> validate </item>
      <item> values </item>
      <item> viewable </item>
      <item> visual </item>
      <item> visualid </item>
      <item> visualsavailable </item>
      <item> vrootheight </item>
      <item> vrootwidth </item>
      <item> vrootx </item>
      <item> vrooty </item>
      <item> width </item>
      <item> window </item>
      <item> windowingsystem </item>
      <item> withdraw </item>
      <item> x </item>
      <item> xview </item>
      <item> y </item>
    </list>

    <contexts>
      <context name = "Base" attribute = "Normal Text" lineEndContext="#stay">
      
        <!-- Virtual blocks -->
        <RegExpr attribute="Region Marker" context="#stay" String="#\s*BEGIN.*$" beginRegion="region" firstNonSpace="true"/>
        <RegExpr attribute="Region Marker" context="#stay" String="#\s*END.*$" endRegion="region" firstNonSpace="true"/>
        
        <!-- Standard -->
        <keyword String = "keywords" attribute = "Keyword" context="#stay"/>
        <keyword String = "keywords-opt" attribute = "Parameter" context="#stay"/>
        <Float attribute = "Float" context="#stay"/>
        <Int attribute ="Decimal" context="#stay"/>
        <RegExpr String="\\." attribute = "Char" context = "#stay"/>
        
        <!-- Options -->
        <RegExpr String = "\s-\w+" attribute = "Parameter" context="#stay"/>
        
        <!-- Variables -->
        <RegExpr String = "\$\{([^\}]|\\\})+\}" attribute = "Variable" context="#stay"/>
        <RegExpr String = "\$(::|\w)+" attribute = "Variable" context="#stay"/>
        
        <!-- Strings -->
        <RegExpr String = "&quot;{2}" attribute = "String" context="#stay"/>
        <RegExpr String = "&quot;" attribute = "String" context="String"/>
        
        <!-- Comments -->
        <DetectChar char = ";" attribute = "Normal Text" context="New command line" />
        <DetectChar char = "#" attribute = "Comment" context="Comment" firstNonSpace="true"/>
        
        <!-- Braces, brackets, etc -->
        <DetectChar char = "{" attribute = "Keyword" context="#stay" beginRegion="block"/>
        <DetectChar char = "}" attribute = "Keyword" context="#stay" endRegion="block"/>
        <DetectChar char = "[" attribute = "Keyword" context="#stay"/>
        <DetectChar char = "]" attribute = "Keyword" context="#stay"/>
        
      </context>

      <context name = "String" attribute = "String" lineEndContext="#stay">
        <RegExpr String="\\." attribute = "Char" context = "#stay"/>
        <DetectChar char="&quot;" attribute = "String" context = "#pop"/>
        <DetectChar char  = "$" attribute = "Variable" context="#stay"/>
      </context>

      <context name = "Comment" attribute = "Comment" lineEndContext="#pop"/>

      <context name = "New command line" attribute = "Normal Text" lineEndContext="#stay">
        <RegExpr String = "\s*#" attribute="Comment" context="Comment" />
        <RegExpr String = "." attribute="Normal Text" context="#pop" lookAhead="true" />
      </context>
    </contexts>

    <itemDatas>
      <itemData name = "Normal Text" defStyleNum = "dsNormal"/>
      <itemData name = "Keyword" defStyleNum = "dsKeyword"/>
      <itemData name = "Decimal" defStyleNum = "dsDecVal"/>
      <itemData name = "Float" defStyleNum = "dsFloat"/>
      <itemData name = "String" defStyleNum = "dsString"/>
      <itemData name = "Comment" defStyleNum = "dsComment"/>
      <itemData name = "Parameter" defStyleNum = "dsOthers"/>
      <itemData name = "Variable" defStyleNum = "dsDataType"/>
      <itemData name = "Char" defStyleNum="dsChar"/>
      <itemData name = "Region Marker" defStyleNum="dsRegionMarker"/>
    </itemDatas>

  </highlighting>

  <general>
    <comments>
	<comment name="singleLine" start="#" />
    </comments>
    <keywords casesensitive="1"/>
  </general>

</language>