| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language> |
| 3 |
<!-- |
| 4 |
Copyright 2008 Diggory Hardy |
| 5 |
|
| 6 |
Author: Diggory Hardy <[email protected]> |
| 7 |
|
| 8 |
This contains highlighting for mergetag text files, a sub-part of the mde project. |
| 9 |
dsource.org/projects/mde |
| 10 |
|
| 11 |
********************************************************************** |
| 12 |
* This library is free software; you can redistribute it and/or * |
| 13 |
* modify it under the terms of the GNU Lesser General Public * |
| 14 |
* License as published by the Free Software Foundation; either * |
| 15 |
* version 2 of the License, or (at your option) any later version. * |
| 16 |
* * |
| 17 |
* This library is distributed in the hope that it will be useful, * |
| 18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
| 20 |
* Lesser General Public License for more details. * |
| 21 |
* * |
| 22 |
* You should have received a copy of the GNU Lesser General Public * |
| 23 |
* License along with this library; if not, write to the * |
| 24 |
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * |
| 25 |
* Boston, MA 02110-1301, USA. * |
| 26 |
********************************************************************** |
| 27 |
--> |
| 28 |
<language name="mergetag text" version="5" kateversion="5.0" section="Configuration" author="Diggory Hardy ([email protected])" license="LGPLv2+" extensions="*.mtt;"> |
| 29 |
<highlighting> |
| 30 |
<contexts> |
| 31 |
<context name="Normal" attribute="Error" lineEndContext="#stay"> |
| 32 |
<DetectSpaces /> |
| 33 |
<Detect2Chars attribute="Comment Brackets" context="SecComment" char="!" char1="{" beginRegion="SecComment" /> |
| 34 |
<Detect2Chars attribute="Comment Brackets" context="TagCommentType" char="!" char1="<" /> |
| 35 |
<DetectChar attribute="Brackets" context="SectionIdentifier" char="{" beginRegion="SecID" /> |
| 36 |
<DetectChar attribute="Tag Character" context="TagType" char="<" /> |
| 37 |
</context> |
| 38 |
|
| 39 |
<context name="SectionIdentifier" attribute="ID" lineEndContext="#stay"> |
| 40 |
<DetectChar attribute="Brackets" context="#pop" char="}" endRegion="SecID" /> |
| 41 |
</context> |
| 42 |
|
| 43 |
<context name="SecComment" attribute="Comment" lineEndContext="#stay"> |
| 44 |
<DetectChar attribute="Comment Brackets" context="#pop" char="}" endRegion="SecComment" /> |
| 45 |
<DetectChar attribute="Comment Brackets" context="SecComment" char="{" beginRegion="SecID" /> |
| 46 |
<DetectSpaces /> |
| 47 |
<IncludeRules context="##Comments" /> |
| 48 |
</context> |
| 49 |
|
| 50 |
<context name="TagType" attribute="Type" lineEndContext="#stay"> |
| 51 |
<DetectChar attribute="Tag Character" context="TagID" char="|" /> |
| 52 |
<IncludeRules context="TagErrors" /> |
| 53 |
</context> |
| 54 |
<context name="TagID" attribute="ID" lineEndContext="#stay"> |
| 55 |
<DetectChar attribute="Tag Character" context="TagData" char="=" /> |
| 56 |
<IncludeRules context="TagErrors" /> |
| 57 |
</context> |
| 58 |
<context name="TagData" attribute="Normal Text" lineEndContext="#stay"> |
| 59 |
<DetectChar attribute="Tag Character" context="#pop#pop#pop" char=">" /> |
| 60 |
|
| 61 |
<DetectChar attribute="Char" context="CharLiteral" char="'"/> |
| 62 |
<DetectChar attribute="String" context="String" char="""/> |
| 63 |
<!-- Number literals --> |
| 64 |
<Float attribute="Float" context="#stay" /> |
| 65 |
<RegExpr attribute="Binary" context="#pop" String="0[bB][01]+"/> |
| 66 |
<RegExpr attribute="Octal" context="#pop" String="0[oO][0-7]+"/> |
| 67 |
<HlCHex attribute="Hex" context="#stay"/> |
| 68 |
<Int attribute="Integer" context="#stay" /> |
| 69 |
|
| 70 |
<IncludeRules context="TagErrors" /> |
| 71 |
</context> |
| 72 |
<context name="TagErrors" attribute="Normal Text" lineEndContext="#stay"> |
| 73 |
<AnyChar attribute="Error" context="#stay" String="<|=>" /> |
| 74 |
</context> |
| 75 |
|
| 76 |
<context name="TagCommentType" attribute="Comment" lineEndContext="#stay"> |
| 77 |
<DetectChar attribute="Comment Brackets" context="TagCommentID" char="|" /> |
| 78 |
<IncludeRules context="TagErrors" /> |
| 79 |
</context> |
| 80 |
<context name="TagCommentID" attribute="Comment" lineEndContext="#stay"> |
| 81 |
<DetectChar attribute="Comment Brackets" context="TagCommentData" char="=" /> |
| 82 |
<IncludeRules context="TagErrors" /> |
| 83 |
</context> |
| 84 |
<context name="TagCommentData" attribute="Comment" lineEndContext="#stay"> |
| 85 |
<DetectChar attribute="Comment Brackets" context="#pop#pop#pop" char=">" /> |
| 86 |
<DetectChar attribute="Comment" context="CommentChar" char="'"/> |
| 87 |
<DetectChar attribute="Comment" context="CommentString" char="""/> |
| 88 |
<IncludeRules context="TagErrors" /> |
| 89 |
</context> |
| 90 |
<context name="CommentString" attribute="Comment" lineEndContext="#stay"> |
| 91 |
<DetectChar attribute="Comment" context="#pop" char=""" /> |
| 92 |
<RegExpr String="\\." attribute="Comment" context="#stay"/> |
| 93 |
</context> |
| 94 |
<context name="CommentChar" attribute="Comment" lineEndContext="#stay"> |
| 95 |
<DetectChar attribute="Comment" context="#pop" char="'" /> |
| 96 |
<RegExpr String="\\." attribute="Comment" context="#stay"/> |
| 97 |
</context> |
| 98 |
|
| 99 |
<!-- 'char' --> |
| 100 |
<context name="CharLiteral" attribute="Char" lineEndContext="CharLiteralClosing" fallthrough="true" fallthroughContext="#pop"> |
| 101 |
<!-- Empty '' --> |
| 102 |
<DetectChar attribute="Char" context="#pop" char="'"/> |
| 103 |
<HlCStringChar attribute="EscapeSequence" context="CharLiteralClosing"/> |
| 104 |
<RegExpr attribute="Char" context="CharLiteralClosing" String="."/> |
| 105 |
</context> |
| 106 |
<!-- Anything other than a closing ' is now be an error --> |
| 107 |
<context name="CharLiteralClosing" attribute="Error" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop"> |
| 108 |
<DetectChar attribute="Char" context="#pop#pop" char="'"/> |
| 109 |
</context> |
| 110 |
<!-- "string" --> |
| 111 |
<context name="String" attribute="String" lineEndContext="#stay"> |
| 112 |
<HlCStringChar attribute="EscapeSequence"/> |
| 113 |
<DetectChar attribute="String" context="#pop" char="""/> |
| 114 |
</context> |
| 115 |
</contexts> |
| 116 |
|
| 117 |
<itemDatas> |
| 118 |
<itemData name="Brackets" defStyleNum="dsKeyword"/> |
| 119 |
<itemData name="Tag Character" defStyleNum="dsKeyword" color="#008040"/> |
| 120 |
<itemData name="Type" defStyleNum="dsDataType"/> |
| 121 |
<itemData name="Error" defStyleNum="dsError"/> |
| 122 |
<itemData name="Comment Brackets" defStyleNum="dsComment" italic="0" color="#404040" /> |
| 123 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 124 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 125 |
<itemData name="ID" defStyleNum="dsOthers"/> |
| 126 |
|
| 127 |
<itemData name="Integer" defStyleNum="dsDecVal"/> |
| 128 |
<itemData name="Binary" defStyleNum="dsBaseN"/> |
| 129 |
<itemData name="Octal" defStyleNum="dsBaseN"/> |
| 130 |
<itemData name="Hex" defStyleNum="dsBaseN"/> |
| 131 |
<itemData name="Float" defStyleNum="dsFloat"/> |
| 132 |
|
| 133 |
<itemData name="EscapeSequence" defStyleNum="dsString" color="#00aa88" selColor="#ff0000"/> |
| 134 |
<itemData name="String" defStyleNum="dsString"/> |
| 135 |
<itemData name="Char" defStyleNum="dsChar"/> |
| 136 |
</itemDatas> |
| 137 |
</highlighting> |
| 138 |
<general> |
| 139 |
<comments> |
| 140 |
<comment name="multiLine" start="!{" end="}" region="SecComment"/> |
| 141 |
</comments> |
| 142 |
<keywords casesensitive="true" /> |
| 143 |
</general> |
| 144 |
</language> |
| 145 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |