Warning, /frameworks/syntax-highlighting/data/syntax/wml.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language>
0003 <!--
0004   Thread for discussions: http://www.wesnoth.org/forum/viewtopic.php?f=21&t=13781
0005   Alternatively try the "normal" way: #kate @ irc.libera.chat, kwrite-devel@kde.org
0006   Changelog (0.35 and later):
0007   ***************************
0008 * 0.42.1
0009   - 2019-01-01 <nibgonz@gmail.com>
0010     * Fix infinite loop between the "section" & "error" contexts.
0011     * Only highlight tags with valid name format.
0012     * Don't highlight array indices as tags.
0013     * Use new default styles & fix embedded Lua code.
0014 * 0.42
0015   - 2011-11-15 <shadowm2006@gmail.com>:
0016     * Added preprocessor directives: #error, #warning
0017     * Added highlighting for the wmlxgettext annotation metadirective (po:)
0018 * 0.41
0019   - 2011-04-15 <shadowm2006@gmail.com>:
0020     * Added preprocessor directives: #if(n)have, #if(n)ver
0021     * Revalidated against language.dtd
0022 
0023 * 0.40
0024   - 2010-06-13 <devel@the-user.org>:
0025     * Added lua-highlighting between << and >>.
0026     * Added pango-highlighting between " and "
0027     * Folding for macro-strings between paretheses
0028     * Changed colors.
0029     * This file is licensed under GPLv2+
0030 
0031 * 0.37
0032   - 2008-03-29 <shadowm2006@gmail.com>:
0033     * WML preprocessor directive (define, if) blocks can be collapsed/expanded
0034     * attribute_name = "string" WML constructs (note the space surrounding '=') are recognized too
0035       (designed considering the mainline about.cfg structure case
0036     * Changed various context names and styles
0037 
0038 - 2008-03-21 <shadowm2006@gmail.com>:
0039     * WML nodes and multiline preprocessing macro/include blocks can be collapsed/expanded
0040     * WML nodes that are opened and closed in a single line are properly highlighted now
0041   * 0.36
0042   - 2008-03-05 <shadowm2006@gmail.com>:
0043     * Added wmlscope to list of utility control commands
0044 
0045   * 0.35
0046   - 2008-02-23 <shadowm2006@gmail.com>:
0047     * Made it possible to comment/uncomment line(s) using the default
0048       CTRL-D / CTRL-SHIFT-D shortcuts
0049   - 2008-01-27 <shadowm2006@gmail.com>:
0050     * Added the *.pbl file name pattern
0051     * Made the standard alerts (i.e. TODO, HACK, FIXME,...) be highlighted too
0052     * Made the key comments for Wesnoth's mainline maintenance scripts be highlighted (at the moment
0053       they are only used for wmllint and wmlindent)
0054   - 2008-01-?? <shadowm2006@gmail.com>:
0055     * Made #textdomain another preprocessor directive, as is handled by the game at /src/serialization/preprocessor.cpp
0056       line 634 and around
0057   - 2007-11-?? <shadowm2006@gmail.com>:
0058     * Minor improvements?
0059   - 2007-11-?? <shadowm2006@gmail.com>:
0060     * Made the new #ifndef directive be recognized (implemented on Wesnoth 1.3.11 and later)
0061 -->
0062 
0063 <language name="Wesnoth Markup Language" section="Markup" extensions="*.cfg;*.pbl;*.CFG;*.PBL" version="8"
0064           kateversion="5.79" casesensitive="true" author="Zachary Palmer (zep01@bahj.com), modif. by Ignacio Riquelme Morelle (shadowm2006@gmail.com) and Jonathan Schmidt-Dominé (devel@the-user.org)" license="GPL">
0065     <highlighting>
0066         <list name="alerts_wml_utils">
0067             <item>wmllint</item>
0068             <item>wmlindent</item>
0069             <item>wmlscope</item>
0070             <item>po</item>
0071         </list>
0072         <list name="preprocessor_directive_statements">
0073                 <item>#textdomain</item>
0074                 <item>#else</item>
0075                 <item>#undef</item>
0076                 <item>#error</item>
0077                 <item>#warning</item>
0078         </list>
0079         <list name="preprocessor_block_begin_statements">
0080                 <item>#define</item>
0081                 <item>#ifdef</item>
0082                 <item>#ifndef</item>
0083                 <item>#ifhave</item>
0084                 <item>#ifnhave</item>
0085                 <item>#ifver</item>
0086                 <item>#ifnver</item>
0087         </list>
0088         <list name="preprocessor_block_end_statements">
0089                 <item>#enddef</item>
0090                 <item>#endif</item>
0091         </list>
0092         <contexts>            
0093             <!-- Main contexts -->
0094             <context attribute="Normal WML Text" name="text" lineEndContext="#stay">
0095                 <RegExpr String="(_ *)?&quot;" attribute="String" context="string" />
0096                 
0097                 <RegExpr String=" *&lt;&lt;" attribute="String" context="luastring" beginRegion="wml_lua" />
0098                 
0099                 <keyword String="preprocessor_directive_statements" attribute="Preprocessor" context="preprocessor" />
0100                 <keyword String="preprocessor_block_begin_statements" attribute="Preprocessor" context="preprocessor" beginRegion="wmlpp_block" />
0101                 <keyword String="preprocessor_block_end_statements" attribute="Preprocessor" context="preprocessor" endRegion="wmlpp_block" />
0102                 
0103                 <DetectChar char="#" attribute="Comment" context="comment" />
0104                 
0105                 <DetectChar char="{" attribute="Macro/Include" context="macro" beginRegion="macro_block" />
0106 
0107                 <!-- Tags: https://wiki.wesnoth.org/SyntaxWML#Tag_and_Attribute_Structures -->
0108                 <RegExpr String="\[/\s*\w*\s*\]" attribute="WML Node" context="#stay" endRegion="wml_node" />
0109                 <RegExpr String="\[\+?\w*\]" attribute="WML Node" context="#stay" beginRegion="wml_node" />
0110 
0111                 <RegExpr String="(\w|,| )+=" attribute="WML Attribute" context="value"
0112                                     lookAhead="true" />
0113                 
0114                 <IncludeRules context="variableSubstitutionRule" />
0115                 
0116                 <!-- This avoids highlighting array indices as tags -->
0117                 <RegExpr String="(\w+|\])\[(?!/)" attribute="Normal WML Text" context="#stay" />
0118             </context>
0119             
0120             <context attribute="String" lineEndContext="#stay" name="string">
0121                 <DetectChar char="&quot;" attribute="String" context="#pop" />
0122                 <DetectChar char="{" attribute="Macro/Include" context="macro" />
0123                 <IncludeRules context="variableSubstitutionRule" />
0124                 <IncludeRules context="##Pango" includeAttrib="false"/>
0125             </context>
0126 
0127             <context attribute="Normal WML Text" name="luastring" lineEndContext="#stay">
0128                 <Detect2Chars char="&gt;" char1="&gt;" attribute="String" context="#pop" endRegion="wml_lua" />
0129                 <IncludeRules context="Normal##Lua" includeAttrib="true"/>
0130             </context>
0131             
0132             <context attribute="Normal WML Text" name="luamacrostring" lineEndContext="#stay">
0133                 <Detect2Chars char="&gt;" char1="&gt;" attribute="Macro String" context="#pop" endRegion="wml_lua" />
0134                 <IncludeRules context="Normal##Lua" includeAttrib="true"/>
0135             </context>
0136             
0137             <context attribute="Comment" lineEndContext="#pop" name="comment">
0138                 <DetectSpaces />
0139                 <keyword attribute="Maintenance script statement" context="#stay" String="alerts_wml_utils" />
0140                 <IncludeRules context="##Comments" />
0141             </context>
0142             
0143             <context attribute="Macro/Include" lineEndContext="#stay" name="macro">
0144                 <DetectChar char="{" attribute="Macro/Include" context="macro" beginRegion="macro_block"/>
0145                 <RegExpr String="(_ *)?&quot;" attribute="Macro String" context="macroString" />
0146                 <RegExpr String=" *&lt;&lt;" attribute="Macro String" context="luamacrostring" beginRegion="wml_lua" />
0147                 <DetectChar char="(" attribute="Macro String" context="macroString2" beginRegion="macro_paren_string" />
0148                 <DetectChar char="}" attribute="Macro/Include" context="#pop" endRegion="macro_block" />
0149                 <IncludeRules context="variableSubstitutionRule" />
0150             </context>
0151             
0152             <context attribute="Macro String" lineEndContext="#stay" name="macroString">
0153                 <DetectChar char="&quot;" attribute="Macro String" context="#pop" />
0154                 <DetectChar char="{" attribute="Macro/Include" context="macro" beginRegion="macro_block" />
0155                 <IncludeRules context="variableSubstitutionRule" />
0156                 <IncludeRules context="##Pango" includeAttrib="false"/>
0157             </context>
0158             
0159             <context attribute="Macro String" lineEndContext="#stay" name="macroString2">
0160                 <DetectChar char=")" attribute="Macro String" context="#pop" endRegion="macro_paren_string" />
0161                 <DetectChar char="{" attribute="Macro/Include" context="macro" beginRegion="macro_block" />
0162                 <IncludeRules context="text" />
0163             </context>
0164             
0165             <context attribute="WML Attribute" lineEndContext="#pop" name="value">
0166                 <DetectChar char="=" attribute="Normal WML Text" context="#pop" />
0167             </context>
0168             
0169             <context attribute="Preprocessor" lineEndContext="#pop" name="preprocessor">
0170             </context>
0171             
0172             <context attribute="Error" lineEndContext="#stay" name="error">
0173             </context>
0174             
0175             <context attribute="Variable Substitution" lineEndContext="#pop"
0176                      name="variableSubstitution">
0177                 <DetectChar char="|" attribute="Variable Substitution" context="#pop" />
0178                 <DetectChar char="$" attribute="Variable Substitution" context="variableSubstitution" />
0179                 <DetectChar char="[" attribute="Variable Subscript" context="variableSubscript" />
0180                 <RegExpr String="[^A-Za-z0-9_\.]" attribute="Variable Substitution" context="#pop"
0181                          lookAhead="true" />
0182             </context>
0183             
0184             <context attribute="Variable Subscript" lineEndContext="error" name="variableSubscript">
0185                 <DetectChar char="]" attribute="Variable Subscript" context="#pop" />
0186             </context>
0187             
0188             <!-- Include contexts -->
0189             <context attribute="Variable Substitution" lineEndContext="#pop" name="variableSubstitutionRule">
0190                 <DetectChar char="$" attribute="Variable Substitution" context="variableSubstitution" />
0191             </context>
0192             
0193         </contexts>
0194         <itemDatas>
0195             <itemData name="Normal WML Text" defStyleNum="dsNormal" />
0196             <itemData name="Maintenance script statement" defStyleNum="dsAlert"/>
0197             <itemData name="String" defStyleNum="dsString" />
0198             <itemData name="Comment" defStyleNum="dsComment" />
0199             <itemData name="Macro/Include" defStyleNum="dsFunction" />
0200             <itemData name="WML Node" defStyleNum="dsKeyword" />
0201             <itemData name="WML Attribute" defStyleNum="dsAttribute" />
0202             <itemData name="Preprocessor" defStyleNum="dsPreprocessor" />
0203             <itemData name="Error" defStyleNum="dsError" />
0204             <itemData name="Macro String" defStyleNum="dsChar" />
0205             <itemData name="Variable Substitution" defStyleNum="dsDecVal" />
0206             <itemData name="Variable Subscript" defStyleNum="dsBaseN" />
0207         </itemDatas>
0208     </highlighting>
0209     <general>
0210         <comments>
0211             <comment name="singleLine" start="#" position="afterwhitespace"/>
0212         </comments>
0213         <keywords casesensitive="1"/>
0214     </general>
0215 </language>
0216 <!-- kate: replace-tabs on; tab-width 4; indent-width 4; -->