Debian Codegraph @

data/syntax/wml.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE language>
3 <!--
4 Thread for discussions: http://www.wesnoth.org/forum/viewtopic.php?f=21&t=13781
5 Alternatively try the "normal" way: #kate @ irc.libera.chat, [email protected]
6 Changelog (0.35 and later):
7 ***************************
8 * 0.42.1
9 - 2019-01-01 <[email protected]>
10 * Fix infinite loop between the "section" & "error" contexts.
11 * Only highlight tags with valid name format.
12 * Don't highlight array indices as tags.
13 * Use new default styles & fix embedded Lua code.
14 * 0.42
15 - 2011-11-15 <[email protected]>:
16 * Added preprocessor directives: #error, #warning
17 * Added highlighting for the wmlxgettext annotation metadirective (po:)
18 * 0.41
19 - 2011-04-15 <[email protected]>:
20 * Added preprocessor directives: #if(n)have, #if(n)ver
21 * Revalidated against language.dtd
22
23 * 0.40
24 - 2010-06-13 <[email protected]>:
25 * Added lua-highlighting between << and >>.
26 * Added pango-highlighting between " and "
27 * Folding for macro-strings between paretheses
28 * Changed colors.
29 * This file is licensed under GPLv2+
30
31 * 0.37
32 - 2008-03-29 <[email protected]>:
33 * WML preprocessor directive (define, if) blocks can be collapsed/expanded
34 * attribute_name = "string" WML constructs (note the space surrounding '=') are recognized too
35 (designed considering the mainline about.cfg structure case
36 * Changed various context names and styles
37
38 - 2008-03-21 <[email protected]>:
39 * WML nodes and multiline preprocessing macro/include blocks can be collapsed/expanded
40 * WML nodes that are opened and closed in a single line are properly highlighted now
41 * 0.36
42 - 2008-03-05 <[email protected]>:
43 * Added wmlscope to list of utility control commands
44
45 * 0.35
46 - 2008-02-23 <[email protected]>:
47 * Made it possible to comment/uncomment line(s) using the default
48 CTRL-D / CTRL-SHIFT-D shortcuts
49 - 2008-01-27 <[email protected]>:
50 * Added the *.pbl file name pattern
51 * Made the standard alerts (i.e. TODO, HACK, FIXME,...) be highlighted too
52 * Made the key comments for Wesnoth's mainline maintenance scripts be highlighted (at the moment
53 they are only used for wmllint and wmlindent)
54 - 2008-01-?? <[email protected]>:
55 * Made #textdomain another preprocessor directive, as is handled by the game at /src/serialization/preprocessor.cpp
56 line 634 and around
57 - 2007-11-?? <[email protected]>:
58 * Minor improvements?
59 - 2007-11-?? <[email protected]>:
60 * Made the new #ifndef directive be recognized (implemented on Wesnoth 1.3.11 and later)
61 -->
62
63 <language name="Wesnoth Markup Language" section="Markup" extensions="*.cfg;*.pbl;*.CFG;*.PBL" version="8"
64 kateversion="5.79" casesensitive="true" author="Zachary Palmer ([email protected]), modif. by Ignacio Riquelme Morelle ([email protected]) and Jonathan Schmidt-Dominé ([email protected])" license="GPL">
65 <highlighting>
66 <list name="alerts_wml_utils">
67 <item>wmllint</item>
68 <item>wmlindent</item>
69 <item>wmlscope</item>
70 <item>po</item>
71 </list>
72 <list name="preprocessor_directive_statements">
73 <item>#textdomain</item>
74 <item>#else</item>
75 <item>#undef</item>
76 <item>#error</item>
77 <item>#warning</item>
78 </list>
79 <list name="preprocessor_block_begin_statements">
80 <item>#define</item>
81 <item>#ifdef</item>
82 <item>#ifndef</item>
83 <item>#ifhave</item>
84 <item>#ifnhave</item>
85 <item>#ifver</item>
86 <item>#ifnver</item>
87 </list>
88 <list name="preprocessor_block_end_statements">
89 <item>#enddef</item>
90 <item>#endif</item>
91 </list>
92 <contexts>
93 <!-- Main contexts -->
94 <context attribute="Normal WML Text" name="text" lineEndContext="#stay">
95 <RegExpr String="(_ *)?&quot;" attribute="String" context="string" />
96
97 <RegExpr String=" *&lt;&lt;" attribute="String" context="luastring" beginRegion="wml_lua" />
98
99 <keyword String="preprocessor_directive_statements" attribute="Preprocessor" context="preprocessor" />
100 <keyword String="preprocessor_block_begin_statements" attribute="Preprocessor" context="preprocessor" beginRegion="wmlpp_block" />
101 <keyword String="preprocessor_block_end_statements" attribute="Preprocessor" context="preprocessor" endRegion="wmlpp_block" />
102
103 <DetectChar char="#" attribute="Comment" context="comment" />
104
105 <DetectChar char="{" attribute="Macro/Include" context="macro" beginRegion="macro_block" />
106
107 <!-- Tags: https://wiki.wesnoth.org/SyntaxWML#Tag_and_Attribute_Structures -->
108 <RegExpr String="\[/\s*\w*\s*\]" attribute="WML Node" context="#stay" endRegion="wml_node" />
109 <RegExpr String="\[\+?\w*\]" attribute="WML Node" context="#stay" beginRegion="wml_node" />
110
111 <RegExpr String="(\w|,| )+=" attribute="WML Attribute" context="value"
112 lookAhead="true" />
113
114 <IncludeRules context="variableSubstitutionRule" />
115
116 <!-- This avoids highlighting array indices as tags -->
117 <RegExpr String="(\w+|\])\[(?!/)" attribute="Normal WML Text" context="#stay" />
118 </context>
119
120 <context attribute="String" lineEndContext="#stay" name="string">
121 <DetectChar char="&quot;" attribute="String" context="#pop" />
122 <DetectChar char="{" attribute="Macro/Include" context="macro" />
123 <IncludeRules context="variableSubstitutionRule" />
124 <IncludeRules context="##Pango" includeAttrib="false"/>
125 </context>
126
127 <context attribute="Normal WML Text" name="luastring" lineEndContext="#stay">
128 <Detect2Chars char="&gt;" char1="&gt;" attribute="String" context="#pop" endRegion="wml_lua" />
129 <IncludeRules context="Normal##Lua" includeAttrib="true"/>
130 </context>
131
132 <context attribute="Normal WML Text" name="luamacrostring" lineEndContext="#stay">
133 <Detect2Chars char="&gt;" char1="&gt;" attribute="Macro String" context="#pop" endRegion="wml_lua" />
134 <IncludeRules context="Normal##Lua" includeAttrib="true"/>
135 </context>
136
137 <context attribute="Comment" lineEndContext="#pop" name="comment">
138 <DetectSpaces />
139 <keyword attribute="Maintenance script statement" context="#stay" String="alerts_wml_utils" />
140 <IncludeRules context="##Comments" />
141 </context>
142
143 <context attribute="Macro/Include" lineEndContext="#stay" name="macro">
144 <DetectChar char="{" attribute="Macro/Include" context="macro" beginRegion="macro_block"/>
145 <RegExpr String="(_ *)?&quot;" attribute="Macro String" context="macroString" />
146 <RegExpr String=" *&lt;&lt;" attribute="Macro String" context="luamacrostring" beginRegion="wml_lua" />
147 <DetectChar char="(" attribute="Macro String" context="macroString2" beginRegion="macro_paren_string" />
148 <DetectChar char="}" attribute="Macro/Include" context="#pop" endRegion="macro_block" />
149 <IncludeRules context="variableSubstitutionRule" />
150 </context>
151
152 <context attribute="Macro String" lineEndContext="#stay" name="macroString">
153 <DetectChar char="&quot;" attribute="Macro String" context="#pop" />
154 <DetectChar char="{" attribute="Macro/Include" context="macro" beginRegion="macro_block" />
155 <IncludeRules context="variableSubstitutionRule" />
156 <IncludeRules context="##Pango" includeAttrib="false"/>
157 </context>
158
159 <context attribute="Macro String" lineEndContext="#stay" name="macroString2">
160 <DetectChar char=")" attribute="Macro String" context="#pop" endRegion="macro_paren_string" />
161 <DetectChar char="{" attribute="Macro/Include" context="macro" beginRegion="macro_block" />
162 <IncludeRules context="text" />
163 </context>
164
165 <context attribute="WML Attribute" lineEndContext="#pop" name="value">
166 <DetectChar char="=" attribute="Normal WML Text" context="#pop" />
167 </context>
168
169 <context attribute="Preprocessor" lineEndContext="#pop" name="preprocessor">
170 </context>
171
172 <context attribute="Error" lineEndContext="#stay" name="error">
173 </context>
174
175 <context attribute="Variable Substitution" lineEndContext="#pop"
176 name="variableSubstitution">
177 <DetectChar char="|" attribute="Variable Substitution" context="#pop" />
178 <DetectChar char="$" attribute="Variable Substitution" context="variableSubstitution" />
179 <DetectChar char="[" attribute="Variable Subscript" context="variableSubscript" />
180 <RegExpr String="[^A-Za-z0-9_\.]" attribute="Variable Substitution" context="#pop"
181 lookAhead="true" />
182 </context>
183
184 <context attribute="Variable Subscript" lineEndContext="error" name="variableSubscript">
185 <DetectChar char="]" attribute="Variable Subscript" context="#pop" />
186 </context>
187
188 <!-- Include contexts -->
189 <context attribute="Variable Substitution" lineEndContext="#pop" name="variableSubstitutionRule">
190 <DetectChar char="$" attribute="Variable Substitution" context="variableSubstitution" />
191 </context>
192
193 </contexts>
194 <itemDatas>
195 <itemData name="Normal WML Text" defStyleNum="dsNormal" />
196 <itemData name="Maintenance script statement" defStyleNum="dsAlert"/>
197 <itemData name="String" defStyleNum="dsString" />
198 <itemData name="Comment" defStyleNum="dsComment" />
199 <itemData name="Macro/Include" defStyleNum="dsFunction" />
200 <itemData name="WML Node" defStyleNum="dsKeyword" />
201 <itemData name="WML Attribute" defStyleNum="dsAttribute" />
202 <itemData name="Preprocessor" defStyleNum="dsPreprocessor" />
203 <itemData name="Error" defStyleNum="dsError" />
204 <itemData name="Macro String" defStyleNum="dsChar" />
205 <itemData name="Variable Substitution" defStyleNum="dsDecVal" />
206 <itemData name="Variable Subscript" defStyleNum="dsBaseN" />
207 </itemDatas>
208 </highlighting>
209 <general>
210 <comments>
211 <comment name="singleLine" start="#" position="afterwhitespace"/>
212 </comments>
213 <keywords casesensitive="1"/>
214 </general>
215 </language>
216 <!-- kate: replace-tabs on; tab-width 4; indent-width 4; -->