Changeset View
Changeset View
Standalone View
Standalone View
data/generators/cmake.xml.tpl
- This file was added.
1 | <?xml version="1.0" encoding="UTF-8"?> | ||||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd" | ||||
3 | [ | ||||
4 | <!ENTITY id_re "[_A-Za-z][\-_0-9A-Za-z]*"> | ||||
5 | ]> | ||||
6 | <!-- | ||||
7 | This file is part of KDE's kate project. | ||||
8 | | ||||
9 | Copyright 2004 Alexander Neundorf (neundorf@kde.org) | ||||
10 | Copyright 2005 Dominik Haumann (dhdev@gmx.de) | ||||
11 | Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net) | ||||
12 | Copyright 2013-2015,2017-2018 Alex Turbov (i.zaufi@gmail.com) | ||||
13 | | ||||
14 | ********************************************************************** | ||||
15 | * This library is free software; you can redistribute it and/or * | ||||
16 | * modify it under the terms of the GNU Lesser General Public * | ||||
17 | * License as published by the Free Software Foundation; either * | ||||
18 | * version 2 of the License, or (at your option) any later version. * | ||||
19 | * * | ||||
20 | * This library is distributed in the hope that it will be useful, * | ||||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | ||||
23 | * Lesser General Public License for more details. * | ||||
24 | * * | ||||
25 | * You should have received a copy of the GNU Lesser General Public * | ||||
26 | * License along with this library; if not, write to the * | ||||
27 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * | ||||
28 | * Boston, MA 02110-1301, USA. * | ||||
29 | ********************************************************************** | ||||
30 | --> | ||||
31 | | ||||
32 | <language | ||||
33 | name="CMake" | ||||
34 | version="5" | ||||
35 | kateversion="2.4" | ||||
36 | section="Other" | ||||
37 | extensions="CMakeLists.txt;*.cmake;*.cmake.in" | ||||
38 | style="CMake" | ||||
39 | mimetype="text/x-cmake" | ||||
40 | author="Alex Turbov (i.zaufi@gmail.com)" | ||||
41 | license="LGPLv2+" | ||||
42 | > | ||||
43 | <highlighting> | ||||
44 | | ||||
45 | <list name="commands"> | ||||
46 | {%- for command in commands %} | ||||
47 | <item>{{command.name}}</item> | ||||
48 | {%- endfor %} | ||||
49 | </list> | ||||
50 | {% for command in commands -%} | ||||
51 | {%- if command.named_args and command.named_args.kw %} | ||||
52 | <list name="{{command.name}}_nargs"> | ||||
53 | {%- for arg in command.named_args.kw %} | ||||
54 | <item>{{arg}}</item> | ||||
55 | {%- endfor %} | ||||
56 | </list> | ||||
57 | {%- endif %} | ||||
58 | {%- if command.special_args and command.special_args.kw %} | ||||
59 | <list name="{{command.name}}_sargs"> | ||||
60 | {%- for arg in command.special_args.kw %} | ||||
61 | <item>{{arg}}</item> | ||||
62 | {%- endfor %} | ||||
63 | </list> | ||||
64 | {%- endif %} | ||||
65 | {%- endfor %} | ||||
66 | | ||||
67 | <list name="variables"> | ||||
68 | {%- for var in variables.kw %} | ||||
69 | <item>{{var}}</item> | ||||
70 | {%- endfor %} | ||||
71 | </list> | ||||
72 | | ||||
73 | {%- for kind in properties.kinds %} | ||||
74 | <list name="{{ kind|replace('_', '-') }}"> | ||||
75 | {%- for prop in properties[kind].kw %} | ||||
76 | <item>{{prop}}</item> | ||||
77 | {%- endfor %} | ||||
78 | </list> | ||||
79 | {%- endfor %} | ||||
80 | | ||||
81 | <list name="generator-expressions"> | ||||
82 | {%- for expr in generator_expressions %} | ||||
83 | <item>{{ expr }}</item> | ||||
84 | {%- endfor %} | ||||
85 | </list> | ||||
86 | | ||||
87 | <contexts> | ||||
88 | | ||||
89 | <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text"> | ||||
90 | <DetectSpaces/> | ||||
91 | {% for command in commands -%} | ||||
92 | <WordDetect String="{{command.name}}" insensitive="true" attribute="Command" context="{{command.name}}_ctx" /> | ||||
93 | {% endfor -%} | ||||
94 | <RegExpr attribute="Region Marker" context="RST Documentation" String="^#\[(=*)\[\.rst:" column="0" /> | ||||
95 | <RegExpr attribute="Comment" context="Bracketed Comment" String="^#\[(=*)\[" column="0" /> | ||||
96 | <DetectChar attribute="Comment" context="Comment" char="#" /> | ||||
97 | <DetectIdentifier attribute="User Function/Macro" context="User Function" /> | ||||
98 | <!-- Include keywords matching for language autocompleter work --> | ||||
99 | <keyword attribute="Command" context="#stay" String="commands" /> | ||||
100 | </context> | ||||
101 | | ||||
102 | {% for command in commands -%} | ||||
103 | {# | ||||
104 | <!-- | ||||
105 | {{ command|pprint }} | ||||
106 | --> | ||||
107 | -#} | ||||
108 | <context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx"> | ||||
109 | <DetectChar attribute="Normal Text" context="{{command.name}}_ctx_op" char="(" /> | ||||
110 | </context> | ||||
111 | <context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx_op"> | ||||
112 | {%- if command.nested_parentheses %} | ||||
113 | <DetectChar attribute="Normal Text" context="{{command.name}}_ctx_op_nested" char="(" /> | ||||
114 | {%- endif %} | ||||
115 | <IncludeRules context="EndCmdPop2" /> | ||||
116 | {%- if command.named_args and command.named_args.kw %} | ||||
117 | <keyword attribute="Named Args" context="#stay" String="{{command.name}}_nargs" /> | ||||
118 | {%- endif %} | ||||
119 | {%- if command.special_args and command.special_args.kw %} | ||||
120 | <keyword attribute="Special Args" context="#stay" String="{{command.name}}_sargs" /> | ||||
121 | {%- endif %} | ||||
122 | {%- if command.property_args and command.property_args.kw %} | ||||
123 | {%- for kind in command.property_args.kw %} | ||||
124 | <keyword attribute="Property" context="#stay" String="{{kind}}" /> | ||||
125 | {%- if properties[kind|replace('-', '_')].re %} | ||||
126 | <IncludeRules context="Detect More {{kind}}" /> | ||||
127 | {%- endif %} | ||||
128 | {%- endfor %} | ||||
129 | {%- endif %} | ||||
130 | {%- if command is not nulary %} | ||||
131 | <IncludeRules context="User Function Args" /> | ||||
132 | {%- if command.name == 'cmake_policy' %} | ||||
133 | <!-- NOTE Handle CMP<NNN> as a special arg of `cmake_policy` command --> | ||||
134 | <RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9]+\b" /> | ||||
135 | {%- endif %} | ||||
136 | {%- endif %} | ||||
137 | </context> | ||||
138 | {%- if command.nested_parentheses %} | ||||
139 | <context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx_op_nested"> | ||||
140 | <IncludeRules context="EndCmdPop" /> | ||||
141 | {%- if command.named_args and command.named_args.kw %} | ||||
142 | <keyword attribute="Named Args" context="#stay" String="{{command.name}}_nargs" /> | ||||
143 | {%- endif %} | ||||
144 | {%- if command.special_args and command.special_args.kw %} | ||||
145 | <keyword attribute="Special Args" context="#stay" String="{{command.name}}_sargs" /> | ||||
146 | {%- endif %} | ||||
147 | {%- if command.property_args and command.property_args.kw %} | ||||
148 | {%- for kind in command.property_args.kw %} | ||||
149 | <keyword attribute="Property" context="#stay" String="{{kind}}" /> | ||||
150 | {%- if properties[kind|replace('-', '_')].re %} | ||||
151 | <IncludeRules context="Detect More {{kind}}" /> | ||||
152 | {%- endif %} | ||||
153 | {%- endfor %} | ||||
154 | {%- endif %} | ||||
155 | <IncludeRules context="User Function Args" /> | ||||
156 | </context> | ||||
157 | {%- endif %} | ||||
158 | {% endfor -%} | ||||
159 | | ||||
160 | {% for kind in properties.kinds if properties[kind].re -%} | ||||
161 | <context attribute="Normal Text" lineEndContext="#stay" name="Detect More {{ kind|replace('_', '-') }}"> | ||||
162 | {%- for prop in properties[kind].re %} | ||||
163 | <RegExpr attribute="Property" context="#stay" String="{{prop}}" /> | ||||
164 | {%- endfor %} | ||||
165 | </context>{{ '\n' }} | ||||
166 | {% endfor -%} | ||||
167 | | ||||
168 | <context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop"> | ||||
169 | <DetectChar attribute="Normal Text" context="#pop" char=")" /> | ||||
170 | </context> | ||||
171 | | ||||
172 | <context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop2"> | ||||
173 | <DetectChar attribute="Normal Text" context="#pop#pop" char=")" /> | ||||
174 | </context> | ||||
175 | | ||||
176 | <context attribute="User Function/Macro" lineEndContext="#stay" name="User Function"> | ||||
177 | <DetectChar attribute="Normal Text" context="User Function Opened" char="(" /> | ||||
178 | <IncludeRules context="EndCmdPop2" /> | ||||
179 | </context> | ||||
180 | | ||||
181 | <context attribute="Normal Text" lineEndContext="#stay" name="User Function Opened"> | ||||
182 | <IncludeRules context="EndCmdPop2" /> | ||||
183 | <IncludeRules context="User Function Args" /> | ||||
184 | </context> | ||||
185 | | ||||
186 | <context attribute="Normal Text" lineEndContext="#stay" name="Detect Builtin Variables"> | ||||
187 | <keyword attribute="Builtin Variable" context="#stay" String="variables" insensitive="false" /> | ||||
188 | <IncludeRules context="Detect More Builtin Variables" /> | ||||
189 | <RegExpr attribute="Internal Name" context="#stay" String="\b_&id_re;\b" /> | ||||
190 | </context> | ||||
191 | | ||||
192 | <context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables"> | ||||
193 | {%- for var in variables.re %} | ||||
194 | <RegExpr attribute="Builtin Variable" context="#stay" String="{{var}}" /> | ||||
195 | {%- endfor %} | ||||
196 | </context> | ||||
197 | | ||||
198 | <context attribute="Normal Text" lineEndContext="#stay" name="Detect Variable Substitutions"> | ||||
199 | <RegExpr attribute="Environment Variable Substitution" context="#stay" String="\$ENV\{\s*[\w-]+\s*\}" /> | ||||
200 | <Detect2Chars attribute="Variable Substitution" context="VarSubst" char="$" char1="{" /> | ||||
201 | </context> | ||||
202 | | ||||
203 | <context attribute="Variable Substitution" lineEndContext="#pop" name="VarSubst"> | ||||
204 | <IncludeRules context="Detect Builtin Variables" /> | ||||
205 | <DetectIdentifier /> | ||||
206 | <DetectChar attribute="Variable Substitution" context="#pop" char="}" /> | ||||
207 | <IncludeRules context="Detect Variable Substitutions" /> | ||||
208 | </context> | ||||
209 | | ||||
210 | <context attribute="Normal Text" lineEndContext="#stay" name="User Function Args"> | ||||
211 | <Detect2Chars attribute="Normal Text" context="#stay" char="\\" char1="(" /> | ||||
212 | <Detect2Chars attribute="Normal Text" context="#stay" char="\\" char1=")" /> | ||||
213 | <RegExpr attribute="Escapes" context="#stay" String="\\["$n\\]" /> | ||||
214 | <DetectChar attribute="Strings" context="String" char=""" /> | ||||
215 | <RegExpr attribute="Strings" context="Bracketed String" String="\[(=*)\[" /> | ||||
216 | <DetectChar attribute="Comment" context="Comment" char="#" /> | ||||
217 | <IncludeRules context="Detect Builtin Variables" /> | ||||
218 | <IncludeRules context="Detect Variable Substitutions" /> | ||||
219 | <IncludeRules context="Detect Special Values" /> | ||||
220 | <IncludeRules context="Detect Aliased Targets" /> | ||||
221 | <IncludeRules context="Detect Generator Expressions" /> | ||||
222 | </context> | ||||
223 | | ||||
224 | <context attribute="Normal Text" lineEndContext="#stay" name="Detect Special Values"> | ||||
225 | <RegExpr attribute="True Special Arg" context="#stay" String="\b(TRUE|ON)\b" /> | ||||
226 | <RegExpr attribute="False Special Arg" context="#stay" String="\b(FALSE|OFF|(&id_re;-)?NOTFOUND)\b" /> | ||||
227 | </context> | ||||
228 | | ||||
229 | <context attribute="Normal Text" lineEndContext="#stay" name="Detect Aliased Targets"> | ||||
230 | <RegExpr attribute="Aliased Targets" context="#stay" String="\b&id_re;::&id_re;(::&id_re;)*\b" /> | ||||
231 | </context> | ||||
232 | | ||||
233 | <context attribute="Comment" lineEndContext="#pop" name="Comment"> | ||||
234 | <LineContinue attribute="Comment" context="#pop" /> | ||||
235 | <IncludeRules context="##Alerts" /> | ||||
236 | <IncludeRules context="##Modelines" /> | ||||
237 | </context> | ||||
238 | | ||||
239 | <context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true"> | ||||
240 | <RegExpr attribute="Region Marker" context="#pop" String="^#?\]%1\]" dynamic="true" column="0" /> | ||||
241 | <IncludeRules context="##reStructuredText" /> | ||||
242 | </context> | ||||
243 | | ||||
244 | <context attribute="Comment" lineEndContext="#stay" name="Bracketed Comment" dynamic="true"> | ||||
245 | <RegExpr attribute="Comment" context="#pop" String="^#?\]%1\]" dynamic="true" column="0" /> | ||||
246 | <IncludeRules context="##Alerts" /> | ||||
247 | <IncludeRules context="##Modelines" /> | ||||
248 | </context> | ||||
249 | | ||||
250 | <context attribute="Strings" lineEndContext="#stay" name="String"> | ||||
251 | <RegExpr attribute="Strings" context="#pop" String=""(?=[ );]|$)" /> | ||||
252 | <RegExpr attribute="Escapes" context="#stay" String="\\["$nrt\\]" /> | ||||
253 | <IncludeRules context="Detect Variable Substitutions" /> | ||||
254 | <IncludeRules context="Detect Generator Expressions" /> | ||||
255 | </context> | ||||
256 | | ||||
257 | <context attribute="Strings" lineEndContext="#stay" name="Bracketed String" dynamic="true"> | ||||
258 | <RegExpr attribute="Strings" context="#pop" String="\]%1\]" dynamic="true" /> | ||||
259 | </context> | ||||
260 | | ||||
261 | <context attribute="Normal Text" lineEndContext="#stay" name="Detect Generator Expressions"> | ||||
262 | <Detect2Chars attribute="Generator Expression" context="Generator Expression" char="$" char1="<" /> | ||||
263 | </context> | ||||
264 | | ||||
265 | <context attribute="Generator Expression" lineEndContext="#stay" name="Generator Expression"> | ||||
266 | <IncludeRules context="Detect Generator Expressions" /> | ||||
267 | <DetectChar attribute="Comment" context="Comment" char="#" /> | ||||
268 | <DetectChar attribute="Generator Expression" context="#pop" char=">" /> | ||||
269 | <keyword attribute="Generator Expression Keyword" context="#stay" String="generator-expressions" insensitive="false" /> | ||||
270 | <IncludeRules context="Detect Aliased Targets" /> | ||||
271 | <IncludeRules context="Detect Variable Substitutions" /> | ||||
272 | </context> | ||||
273 | | ||||
274 | </contexts> | ||||
275 | | ||||
276 | <itemDatas> | ||||
277 | <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false" /> | ||||
278 | <itemData name="Command" defStyleNum="dsKeyword" spellChecking="false" /> | ||||
279 | <itemData name="User Function/Macro" defStyleNum="dsFunction" spellChecking="false" /> | ||||
280 | <itemData name="Property" defStyleNum="dsOthers" spellChecking="false" /> | ||||
281 | <itemData name="Aliased Targets" defStyleNum="dsBaseN" spellChecking="false" /> | ||||
282 | <itemData name="Named Args" defStyleNum="dsOthers" spellChecking="false" /> | ||||
283 | <itemData name="Special Args" defStyleNum="dsOthers" spellChecking="false" /> | ||||
284 | <itemData name="True Special Arg" defStyleNum="dsOthers" color="#30a030" selColor="#30a030" spellChecking="false" /> | ||||
285 | <itemData name="False Special Arg" defStyleNum="dsOthers" color="#e05050" selColor="#e05050" spellChecking="false" /> | ||||
286 | <itemData name="Strings" defStyleNum="dsString" spellChecking="true" /> | ||||
287 | <itemData name="Escapes" defStyleNum="dsChar" spellChecking="false" /> | ||||
288 | <itemData name="Builtin Variable" defStyleNum="dsDecVal" color="#c09050" selColor="#c09050" spellChecking="false" /> | ||||
289 | <itemData name="Variable Substitution" defStyleNum="dsDecVal" spellChecking="false" /> | ||||
290 | <itemData name="Internal Name" defStyleNum="dsDecVal" color="#303030" selColor="#303030" spellChecking="false" /> | ||||
291 | <itemData name="Environment Variable Substitution" defStyleNum="dsFloat" spellChecking="false" /> | ||||
292 | <itemData name="Generator Expression Keyword" defStyleNum="dsKeyword" color="#b84040" selColor="#b84040" spellChecking="false" /> | ||||
293 | <itemData name="Generator Expression" defStyleNum="dsOthers" color="#b86050" selColor="#b86050" spellChecking="false" /> | ||||
294 | <itemData name="Comment" defStyleNum="dsComment" spellChecking="true" /> | ||||
295 | <itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false" /> | ||||
296 | </itemDatas> | ||||
297 | | ||||
298 | </highlighting> | ||||
299 | | ||||
300 | <general> | ||||
301 | <comments> | ||||
302 | <comment name="singleLine" start="#" /> | ||||
303 | </comments> | ||||
304 | <keywords casesensitive="1" /> | ||||
305 | </general> | ||||
306 | </language> | ||||
307 | | ||||
308 | <!-- kate: indent-width 2; tab-width 2; --> |