highlight.tcl.html 4.76 KB
Newer Older
1 2 3 4
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight.tcl</title>
5
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Tcl/Tk) - Theme (Breeze Light)"/>
6
</head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
7 8 9 10 11 12 13 14 15 16 17 18 19 20
<span style="color:#898887;"># tcl syntax highlighting sample script for Kate</span>
<span style="color:#898887;">#</span>
<span style="color:#898887;"># author: JM. Philippe 15/03/04</span>

<span style="color:#898887;"># escaped characters</span>
<span style="font-weight:bold;">set</span> String <span style="color:#924c9d;">\{</span>
<span style="font-weight:bold;">set</span> String <span style="color:#924c9d;">\{</span>
<span style="font-weight:bold;">set</span> String <span style="color:#924c9d;">\&quot;</span>
<span style="font-weight:bold;">set</span> String <span style="color:#bf0303;">&quot; </span><span style="color:#924c9d;">\&quot;</span><span style="color:#bf0303;"> &quot;</span>
<span style="font-weight:bold;">set</span> String <span style="color:#bf0303;">&quot; </span><span style="color:#924c9d;">\{</span><span style="color:#bf0303;"> &quot;</span>

<span style="color:#898887;">#comments and not comments</span>
<span style="color:#898887;"># is comments</span>
;<span style="color:#898887;">#is comments</span>
21
	<span style="color:#898887;"># is comments</span>
22
<span style="color:#898887;"># &lt;h1&gt; is html comment &lt;/h1&gt;</span>
23
<span style="font-weight:bold;">puts</span> ok;	<span style="color:#898887;"># is comments</span>
24 25 26 27 28
<span style="font-weight:bold;">set</span> String <span style="font-weight:bold;">[string</span> <span style="color:#006e28;">map</span> <span style="font-weight:bold;">{</span>&lt;/a&gt; <span style="font-weight:bold;">{</span>&lt;span&gt;&amp;#187;<span style="color:#006e28;">is</span> not comments&lt;/span&gt;&lt;/a&gt;<span style="font-weight:bold;">}}</span> <span style="color:#0057ae;">$String</span><span style="font-weight:bold;">]</span>
<span style="font-weight:bold;">set</span> String <span style="color:#924c9d;">\#</span>not_a_comment

<span style="color:#898887;"># blocks</span>
<span style="font-weight:bold;">proc</span> test <span style="font-weight:bold;">{</span>arg1 <span style="font-weight:bold;">{</span>arg2 <span style="font-weight:bold;">{}}</span> <span style="font-weight:bold;">{</span>arg3 <span style="font-weight:bold;">{</span>fr fq r<span style="font-weight:bold;">}}}</span> <span style="font-weight:bold;">{</span>
29 30
	<span style="font-weight:bold;">if</span> <span style="font-weight:bold;">{</span><span style="color:#b08000;">1</span><span style="font-weight:bold;">}</span> <span style="font-weight:bold;">{</span>;	<span style="color:#898887;">#comments</span>
		<span style="font-weight:bold;">set</span> String <span style="color:#924c9d;">\{</span>;	<span style="color:#898887;"># not a block start</span>
31 32 33 34
	<span style="font-weight:bold;">}</span>
<span style="font-weight:bold;">}</span>

<span style="font-weight:bold;">proc</span> test <span style="color:#006e28;">args</span> <span style="font-weight:bold;">{</span>
35
	<span style="font-weight:bold;">set</span> String <span style="color:#924c9d;">\}</span>;	<span style="color:#898887;"># not a block end</span>
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
<span style="font-weight:bold;">}</span>

<span style="color:#0057ae;background-color:#e0e9f8;"># BEGIN - collapsable comments</span>
<span style="color:#898887;"># blablabla</span>
<span style="color:#0057ae;background-color:#e0e9f8;"># END</span>

<span style="color:#898887;"># strings</span>
<span style="font-weight:bold;">set</span> String <span style="color:#bf0303;">&quot;feqr feqr </span><span style="color:#0057ae;">$</span><span style="color:#bf0303;">gqer gqe&quot;</span>
<span style="font-weight:bold;">set</span> String <span style="color:#bf0303;">&quot;feqr</span>
<span style="color:#bf0303;">feqr </span><span style="color:#924c9d;">\&quot;</span><span style="color:#bf0303;"> </span><span style="color:#0057ae;">$</span><span style="color:#bf0303;">gqer \</span>
<span style="color:#bf0303;">gqe</span>
<span style="color:#bf0303;">&quot;</span>
<span style="font-weight:bold;">set</span> String <span style="font-weight:bold;">{</span>feqr
feqr <span style="color:#924c9d;">\{</span> <span style="color:#0057ae;">$gqer</span> \
gqe
<span style="font-weight:bold;">}</span>

<span style="color:#898887;"># variables</span>
<span style="font-weight:bold;">set</span> b+<span style="color:#b08000;">1</span> <span style="font-weight:bold;">[incr</span> b<span style="font-weight:bold;">]</span>
<span style="font-weight:bold;">set</span> <span style="font-weight:bold;">{incr</span>-b<span style="font-weight:bold;">}</span> <span style="color:#0057ae;">${b+1}</span>
<span style="font-weight:bold;">puts</span> <span style="color:#0057ae;">${incr-b}</span>
</pre></body></html>