| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language> |
| 3 |
<!-- |
| 4 |
======================================================================== |
| 5 |
|
| 6 |
Haxe Language highlighting. |
| 7 |
|
| 8 |
======================================================================== |
| 9 |
|
| 10 |
Author: Chad Joan |
| 11 |
|
| 12 |
======================================================================== |
| 13 |
--> |
| 14 |
|
| 15 |
<language name="Haxe" section="Sources" extensions="*.hx;*.Hx;*.hX;*.HX;" mimetype="text/x-hxsrc" version="6" kateversion="5.0" casesensitive="true" author="Chad Joan" license="MIT"> |
| 16 |
<highlighting> |
| 17 |
<list name="keywords"> |
| 18 |
|
| 19 |
<item>break</item> |
| 20 |
|
| 21 |
<item>case</item> |
| 22 |
<item>cast</item> |
| 23 |
<item>catch</item> |
| 24 |
<item>class</item> |
| 25 |
<item>continue</item> |
| 26 |
|
| 27 |
<item>default</item> |
| 28 |
|
| 29 |
<item>else</item> |
| 30 |
<item>enum</item> |
| 31 |
<item>extends</item> |
| 32 |
|
| 33 |
<item>false</item> |
| 34 |
<item>for</item> |
| 35 |
<item>function</item> |
| 36 |
|
| 37 |
<item>if</item> |
| 38 |
<item>implements</item> |
| 39 |
<item>in</item> |
| 40 |
<item>inline</item> |
| 41 |
<item>interface</item> |
| 42 |
|
| 43 |
<item>new</item> |
| 44 |
<item>null</item> |
| 45 |
|
| 46 |
<item>override</item> |
| 47 |
|
| 48 |
<item>private</item> |
| 49 |
<item>public</item> |
| 50 |
|
| 51 |
<item>return</item> |
| 52 |
|
| 53 |
<item>static</item> |
| 54 |
<item>super</item> |
| 55 |
<item>switch</item> |
| 56 |
|
| 57 |
<item>this</item> |
| 58 |
<item>throw</item> |
| 59 |
<item>trace</item> |
| 60 |
<item>true</item> |
| 61 |
<item>try</item> |
| 62 |
<item>typedef</item> |
| 63 |
|
| 64 |
<item>untyped</item> |
| 65 |
|
| 66 |
<item>var</item> |
| 67 |
|
| 68 |
<item>while</item> |
| 69 |
|
| 70 |
</list> |
| 71 |
|
| 72 |
<list name="modules"> |
| 73 |
<item>package</item> |
| 74 |
<item>import</item> |
| 75 |
</list> |
| 76 |
|
| 77 |
<list name="types"> |
| 78 |
<item>Array</item> |
| 79 |
<item>Void</item> |
| 80 |
<item>Bool</item> |
| 81 |
<item>Int</item> |
| 82 |
<item>UInt</item> |
| 83 |
<item>Float</item> |
| 84 |
<item>Dynamic</item> |
| 85 |
<item>String</item> |
| 86 |
<item>List</item> |
| 87 |
<item>Error</item> |
| 88 |
<item>Unknown</item> |
| 89 |
<item>Type</item> |
| 90 |
</list> |
| 91 |
|
| 92 |
<contexts> |
| 93 |
<context attribute="Normal Text" lineEndContext="#stay" name="normal"> |
| 94 |
<RegExpr attribute="Preprocessor" context="#pop" String="#if(\s+\w+)?|#(else|elseif|end|error)" /> |
| 95 |
|
| 96 |
<keyword attribute="Keyword" context="#stay" String="keywords"/> |
| 97 |
<keyword attribute="Module" context="ModuleName" String="modules"/> |
| 98 |
<keyword attribute="Type" context="#stay" String="types"/> |
| 99 |
|
| 100 |
<DetectIdentifier attribute="Normal Text"/> |
| 101 |
|
| 102 |
<HlCStringChar attribute="EscapeSequence" context="#pop"/> |
| 103 |
|
| 104 |
<DetectChar attribute="RawString" context="RawString" char="'"/> |
| 105 |
<DetectChar attribute="String" context="String" char="""/> |
| 106 |
|
| 107 |
<Detect2Chars attribute="Comment" context="CommentLine" char="/" char1="/"/> |
| 108 |
<Detect2Chars attribute="Comment" context="CommentBlock" char="/" char1="*" beginRegion="CommentBlock"/> |
| 109 |
|
| 110 |
<DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="BraceA" /> |
| 111 |
<DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="BraceA" /> |
| 112 |
|
| 113 |
<!-- Match ... and .. before numbers are matched. --> |
| 114 |
<StringDetect attribute="Normal Text" context="#pop" String="..."/> |
| 115 |
<Detect2Chars attribute="Normal Text" char="." char1="."/> |
| 116 |
|
| 117 |
<!-- Float --> |
| 118 |
<!-- Floats must be matched before Binary|Octal|Hex|Integer --> |
| 119 |
<!-- All floats except integers --> |
| 120 |
<RegExpr attribute="Float" context="#pop" String="[\d][\d]*(\.(?!\.)[\d]*([eE][-+]?[\d]+)?)|\.[\d][\d]*([eE][-+]?[\d]+)?"/> |
| 121 |
|
| 122 |
<!-- Hex|Integer --> |
| 123 |
<RegExpr attribute="Hex" context="#pop" String="0[xX][\da-fA-F]+"/> |
| 124 |
<RegExpr attribute="Integer" context="#pop" String="\d+"/> |
| 125 |
</context> |
| 126 |
|
| 127 |
<context attribute="Module Name" lineEndContext="#stay" name="ModuleName"> |
| 128 |
<Detect2Chars attribute="Comment" context="CommentLine" char="/" char1="/"/> |
| 129 |
<Detect2Chars attribute="Comment" context="CommentBlock" char="/" char1="*" beginRegion="CommentBlock"/> |
| 130 |
<RegExpr context="#pop" String="[^\s\w.:,]"/> |
| 131 |
</context> |
| 132 |
|
| 133 |
<!-- Strings --> |
| 134 |
<!-- '...' --> |
| 135 |
<context attribute="RawString" lineEndContext="#stay" name="RawString"> |
| 136 |
<Detect2Chars attribute="RawString" context="#stay" char="\" char1="'"/> |
| 137 |
<DetectChar attribute="RawString" context="#pop" char="'"/> |
| 138 |
<HlCStringChar attribute="EscapeSequence"/> |
| 139 |
<RegExpr attribute="EscapeSequence" context="#stay" String="\\(u[\da-fA-F]{4}|U[\da-fA-F]{8}|&[a-zA-Z]\w+;)" /> |
| 140 |
</context> |
| 141 |
<!-- "..." --> |
| 142 |
<context attribute="String" lineEndContext="#stay" name="String"> |
| 143 |
<Detect2Chars attribute="String" context="#stay" char="\" char1="""/> |
| 144 |
<DetectChar attribute="String" context="#pop" char="""/> |
| 145 |
<HlCStringChar attribute="EscapeSequence"/> |
| 146 |
<RegExpr attribute="EscapeSequence" context="#stay" String="\\(u[\da-fA-F]{4}|U[\da-fA-F]{8}|&[a-zA-Z]\w+;)" /> |
| 147 |
</context> |
| 148 |
|
| 149 |
<!-- Comments --> |
| 150 |
<context attribute="Comment" lineEndContext="#pop" name="CommentLine"> |
| 151 |
<DetectSpaces /> |
| 152 |
<IncludeRules context="##Comments"/> |
| 153 |
</context> |
| 154 |
<context attribute="Comment" lineEndContext="#stay" name="CommentBlock"> |
| 155 |
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="CommentBlock"/> |
| 156 |
<DetectSpaces /> |
| 157 |
<IncludeRules context="##Comments"/> |
| 158 |
</context> |
| 159 |
</contexts> |
| 160 |
<itemDatas> |
| 161 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 162 |
<itemData name="Keyword" defStyleNum="dsKeyword"/> |
| 163 |
<itemData name="Type" defStyleNum="dsDataType"/> |
| 164 |
<itemData name="Integer" defStyleNum="dsDecVal"/> |
| 165 |
<itemData name="Hex" defStyleNum="dsBaseN"/> |
| 166 |
<itemData name="Float" defStyleNum="dsFloat"/> |
| 167 |
|
| 168 |
<itemData name="Module" defStyleNum="dsKeyword" color="#0000ff" selColor="#ffffff"/> |
| 169 |
<itemData name="Module Name" defStyleNum="dsNormal" color="#0000ff" selColor="#ffffff"/> |
| 170 |
|
| 171 |
<itemData name="EscapeSequence" defStyleNum="dsString" color="#00aa88" selColor="#ff0000"/> |
| 172 |
<itemData name="String" defStyleNum="dsString"/> |
| 173 |
<itemData name="RawString" defStyleNum="dsString"/> |
| 174 |
|
| 175 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 176 |
|
| 177 |
<itemData name="Preprocessor" defStyleNum="dsOthers"/> |
| 178 |
</itemDatas> |
| 179 |
</highlighting> |
| 180 |
<general> |
| 181 |
<comments> |
| 182 |
<comment name="singleLine" start="//"/> |
| 183 |
<comment name="multiLine" start="/*" end="*/" region="CommentBlock"/> |
| 184 |
</comments> |
| 185 |
<keywords casesensitive="true"/> |
| 186 |
</general> |
| 187 |
</language> |
| 188 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |