Debian Codegraph @

data/syntax/mako.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE language
3 [
4 <!ENTITY name "[A-Za-z_:][\w.:_-]*">
5 <!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
6 ]>
7 <language name="Mako" version="8" kateversion="5.53" section="Markup" extensions="*.mako;*.mak" author="Massimiliano Torromeo ([email protected])" license="LGPL">
8
9 <highlighting>
10 <list name="flow">
11 <item>endfor</item>
12 <item>endif</item>
13 </list>
14 <contexts>
15 <context name="Start" attribute="Normal Text" lineEndContext="#stay">
16 <IncludeRules context="FindMako" />
17 <IncludeRules context="FindHTML" />
18 </context>
19
20 <context name="FindMako" attribute="Normal Text" lineEndContext="#stay">
21 <RegExpr attribute="MakoKeyword" context="NoMakoHTML" String="&lt;%text(?:\s+[^&gt;]*)?&gt;" beginRegion="nomako" />
22 <Detect2Chars attribute="MakoKeyword" context="Mako" char="&lt;" char1="%" />
23 <RegExpr attribute="MakoKeyword" context="Mako" String="&lt;/?%" />
24 <RegExpr attribute="MakoKeyword" context="MakoOneLiner" String="^\s*% " column="0" />
25 <Detect2Chars attribute="MakoKeyword" context="MakoPrint" char="$" char1="{" />
26 </context>
27
28 <context name="Mako" attribute="Mako" lineEndContext="#stay">
29 <RegExpr attribute="MakoKeyword" context="#pop" String="[%/]?&gt;" />
30 <IncludeRules context="##Python" includeAttrib="true"/>
31 </context>
32
33 <context name="MakoOneLiner" attribute="MakoKeyword" lineEndContext="#pop">
34 <keyword attribute="Flow Control Keyword" String="flow" context="#stay"/>
35 <IncludeRules context="##Python" includeAttrib="true"/>
36 </context>
37
38 <context name="MakoPrint" attribute="Mako" lineEndContext="#stay">
39 <DetectChar attribute="MakoKeyword" context="#pop" char="}" />
40 <IncludeRules context="##Python" includeAttrib="true"/>
41 </context>
42
43 <context name="NoMakoHTML" attribute="Normal Text" lineEndContext="#stay">
44 <StringDetect attribute="MakoKeyword" context="#pop" String="&lt;/%text&gt;" endRegion="nomako" />
45 <IncludeRules context="##HTML" includeAttrib="true"/>
46 </context>
47
48 <context name="NoMakoJS" attribute="Normal Text" lineEndContext="#stay">
49 <StringDetect attribute="MakoKeyword" context="#pop" String="&lt;/%text&gt;" endRegion="nomako" />
50 <IncludeRules context="Normal##JavaScript" includeAttrib="true"/>
51 </context>
52
53 <context name="FindHTML" attribute="Normal Text" lineEndContext="#stay">
54 <DetectSpaces/>
55 <DetectIdentifier/>
56 <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
57 <StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
58 <RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" />
59 <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
60 <RegExpr attribute="Element" context="CSS" String="&lt;style\b" insensitive="true" beginRegion="style" />
61 <RegExpr attribute="Element" context="JS" String="&lt;script\b" insensitive="true" beginRegion="script" />
62 <RegExpr attribute="Element" context="El Open" String="&lt;pre\b" insensitive="true" beginRegion="pre" />
63 <RegExpr attribute="Element" context="El Open" String="&lt;div\b" insensitive="true" beginRegion="div" />
64 <RegExpr attribute="Element" context="El Open" String="&lt;table\b" insensitive="true" beginRegion="table" />
65 <RegExpr attribute="Element" context="El Open" String="&lt;ul\b" insensitive="true" beginRegion="ul" />
66 <RegExpr attribute="Element" context="El Open" String="&lt;ol\b" insensitive="true" beginRegion="ol" />
67 <RegExpr attribute="Element" context="El Open" String="&lt;dl\b" insensitive="true" beginRegion="dl" />
68 <RegExpr attribute="Element" context="El Open" String="&lt;&name;" />
69 <RegExpr attribute="Element" context="El Close" String="&lt;/pre\b" insensitive="true" endRegion="pre" />
70 <RegExpr attribute="Element" context="El Close" String="&lt;/div\b" insensitive="true" endRegion="div" />
71 <RegExpr attribute="Element" context="El Close" String="&lt;/table\b" insensitive="true" endRegion="table" />
72 <RegExpr attribute="Element" context="El Close" String="&lt;/ul\b" insensitive="true" endRegion="ul" />
73 <RegExpr attribute="Element" context="El Close" String="&lt;/ol\b" insensitive="true" endRegion="ol" />
74 <RegExpr attribute="Element" context="El Close" String="&lt;/dl\b" insensitive="true" endRegion="dl" />
75 <RegExpr attribute="Element" context="El Close" String="&lt;/&name;" />
76 <!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" />
77 <IncludeRules context="FindEntityRefs" />
78 </context>
79
80 <context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay">
81 <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
82 <AnyChar attribute="Error" context="#stay" String="&amp;&lt;" />
83 </context>
84
85 <context name="FindPEntityRefs" attribute="Normal Text" lineEndContext="#stay">
86 <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
87 <RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" />
88 <AnyChar attribute="Error" context="#stay" String="&amp;%" />
89 </context>
90
91 <context name="FindAttributes" attribute="Normal Text" lineEndContext="#stay">
92 <!--<RegExpr attribute="Attribute" context="#stay" String="&name;" column="0"/>
93 <RegExpr attribute="Attribute" context="#stay" String="\s+&name;" />-->
94 <RegExpr attribute="Attribute" context="#stay" String="&name;" />
95 <DetectChar attribute="Attribute" context="Value" char="=" />
96 </context>
97
98 <context name="FindDTDRules" attribute="Normal Text" lineEndContext="#stay">
99 <RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
100 </context>
101
102 <context name="Comment" attribute="Comment" lineEndContext="#stay">
103 <DetectSpaces/>
104 <IncludeRules context="##Comments" />
105 <DetectIdentifier/>
106 <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
107 <RegExpr attribute="Error" context="#stay" String="-(-(?!-&gt;))+" />
108 </context>
109
110 <context name="CDATA" attribute="Normal Text" lineEndContext="#stay">
111 <DetectSpaces/>
112 <DetectIdentifier/>
113 <StringDetect attribute="CDATA" context="#pop" String="]]&gt;" endRegion="cdata" />
114 <StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
115 </context>
116
117 <context name="PI" attribute="Normal Text" lineEndContext="#stay">
118 <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" />
119 </context>
120
121 <context name="Doctype" attribute="Normal Text" lineEndContext="#stay">
122 <DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" />
123 <DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
124 </context>
125
126 <context name="Doctype Internal Subset" attribute="Normal Text" lineEndContext="#stay">
127 <DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
128 <IncludeRules context="FindDTDRules" />
129 <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
130 <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
131 <IncludeRules context="FindPEntityRefs" />
132 </context>
133
134 <context name="Doctype Markupdecl" attribute="Normal Text" lineEndContext="#stay">
135 <DetectChar attribute="Doctype" context="#pop" char="&gt;" />
136 <DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
137 <DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
138 </context>
139
140 <context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay">
141 <DetectChar attribute="Value" context="#pop" char="&quot;" />
142 <IncludeRules context="FindPEntityRefs" />
143 </context>
144
145 <context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay">
146 <DetectChar attribute="Value" context="#pop" char="&apos;" />
147 <IncludeRules context="FindPEntityRefs" />
148 </context>
149
150 <context name="El Open" attribute="Normal Text" lineEndContext="#stay">
151 <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" />
152 <DetectChar attribute="Element" context="#pop" char="&gt;" />
153 <IncludeRules context="FindAttributes" />
154 <IncludeRules context="FindMako" />
155 </context>
156
157 <context name="El Close" attribute="Normal Text" lineEndContext="#stay">
158 <DetectChar attribute="Element" context="#pop" char="&gt;" />
159 <RegExpr attribute="Error" context="#stay" String="\S" />
160 </context>
161
162 <context name="El Close 2" attribute="Normal Text" lineEndContext="#stay">
163 <DetectChar attribute="Element" context="#pop#pop#pop" char="&gt;" />
164 <RegExpr attribute="Error" context="#stay" String="\S" />
165 </context>
166
167 <context name="El Close 3" attribute="Normal Text" lineEndContext="#stay">
168 <DetectChar attribute="Element" context="#pop#pop#pop#pop" char="&gt;" />
169 <RegExpr attribute="Error" context="#stay" String="\S" />
170 </context>
171
172 <context name="CSS" attribute="Normal Text" lineEndContext="#stay">
173 <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="style" />
174 <DetectChar attribute="Element" context="CSS content" char="&gt;" />
175 <RegExpr attribute="Error" context="#stay" String="\S" />
176 </context>
177
178 <context name="CSS content" attribute="Normal Text" lineEndContext="#stay">
179 <RegExpr attribute="Element" context="El Close 2" String="&lt;/style\b" insensitive="true" endRegion="style" />
180 <IncludeRules context="##CSS" includeAttrib="true"/>
181 </context>
182
183 <context name="JS" attribute="Normal Text" lineEndContext="#stay">
184 <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="script" />
185 <DetectChar attribute="Element" context="JS content" char="&gt;" />
186 <IncludeRules context="FindAttributes" />
187 <RegExpr attribute="Error" context="#stay" String="\S" />
188 </context>
189
190 <context name="JS content" attribute="Normal Text" lineEndContext="#stay">
191 <RegExpr attribute="Element" context="El Close 2" String="&lt;/script\b" insensitive="true" endRegion="script" />
192 <RegExpr attribute="Comment" context="JS comment close" String="//(?=.*&lt;/script\b)" insensitive="true" />
193 <RegExpr attribute="MakoKeyword" context="NoMakoJS" String="&lt;%text(?:\s+[^&gt;]*)?&gt;" beginRegion="nomako" />
194 <IncludeRules context="FindMako" />
195 <IncludeRules context="Normal##JavaScript" includeAttrib="true"/>
196 </context>
197
198 <context name="JS comment close" attribute="Comment" lineEndContext="#pop">
199 <RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="true" endRegion="script" />
200 <DetectSpaces />
201 <IncludeRules context="##Comments" />
202 </context>
203
204 <context name="Value" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ">
205 <DetectChar attribute="Value" context="Value DQ" char="&quot;" />
206 <DetectChar attribute="Value" context="Value SQ" char="&apos;" />
207 <DetectSpaces />
208 </context>
209
210 <context name="Value NQ" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
211 <IncludeRules context="FindEntityRefs" />
212 <RegExpr attribute="Value" context="#stay" String="/(?!&gt;)|[^/&gt;&lt;&quot;&apos;\s]" />
213 </context>
214
215 <context name="Value DQ" attribute="Value" lineEndContext="#stay">
216 <DetectChar attribute="Value" context="#pop#pop" char="&quot;" />
217 <IncludeRules context="FindEntityRefs" />
218 <IncludeRules context="FindMako" />
219 </context>
220
221 <context name="Value SQ" attribute="Value" lineEndContext="#stay">
222 <DetectChar attribute="Value" context="#pop#pop" char="&apos;" />
223 <IncludeRules context="FindEntityRefs" />
224 <IncludeRules context="FindMako" />
225 </context>
226
227 </contexts>
228 <itemDatas>
229 <itemData name="Normal Text" defStyleNum="dsNormal" />
230 <itemData name="Comment" defStyleNum="dsComment" />
231 <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" />
232 <itemData name="Processing Instruction" defStyleNum="dsKeyword" />
233 <itemData name="Doctype" defStyleNum="dsDataType" bold="1" />
234 <itemData name="Element" defStyleNum="dsKeyword" />
235 <itemData name="Flow Control Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
236 <itemData name="Attribute" defStyleNum="dsOthers" />
237 <itemData name="Value" defStyleNum="dsString" />
238 <itemData name="EntityRef" defStyleNum="dsDecVal" />
239 <itemData name="PEntityRef" defStyleNum="dsDecVal" />
240 <itemData name="Error" defStyleNum="dsError" />
241 <itemData name="Mako" defStyleNum="dsDataType" />
242 <itemData name="MakoKeyword" defStyleNum="dsDataType" bold="1" />
243 </itemDatas>
244
245 </highlighting>
246 <general>
247 <comments>
248 <comment name="singleLine" start="#" position="afterwhitespace"/>
249 <comment name="multiLine" start="&lt;!--" end="--&gt;" region="comment"/>
250 </comments>
251 </general>
252 </language>
253 <!-- kate: replace-tabs off; -->