summaryrefslogtreecommitdiffstats
path: root/kate/data/haxe.xml
blob: e51b9f4577c28724fee69703f897e234a9fa87a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
  ========================================================================

  Haxe Language highlighting.

  ========================================================================
  
  Author: Chad Joan
  
  ========================================================================
-->

<language name="Haxe" section="Sources" extensions="*.hx;*.Hx;*.hX;*.HX;" mimetype="text/x-hxsrc" version="1" kateversion="2.4" casesensitive="true" author="Chad Joan" license="MIT">
  <highlighting>
    <list name="keywords">
    
      <item> break </item>
      
      <item> case </item>
      <item> cast </item>
      <item> catch </item>
      <item> class </item>
      <item> continue </item>
      
      <item> default </item>

      <item> else </item>
      <item> enum </item>
      <item> extends </item>
      
      <item> false </item>
      <item> for </item>
      <item> function </item>
      
      <item> if </item>
      <item> implements </item>
      <item> in </item>
      <item> inline </item>
      <item> interface </item>
      
      <item> new </item>
      <item> null </item>
      
      <item> override </item>
      
      <item> private </item>
      <item> public </item>
      
      <item> return </item>
      
      <item> static </item>
      <item> super </item>
      <item> switch </item>
      
      <item> this </item>
      <item> throw </item>
      <item> trace </item>
      <item> true </item>
      <item> try </item>
      <item> typedef </item>
      
      <item> untyped </item>
      
      <item> var </item>
      
      <item> while </item>

    </list>

    <list name="modules">
      <item> package </item>
      <item> import </item>
    </list>

    <list name="types">
      <item> Array </item>
      <item> Void </item>
      <item> Bool </item>
      <item> Int </item>
      <item> UInt </item>
      <item> Float </item>
      <item> Dynamic </item>
      <item> String </item>
      <item> List </item>
      <item> Error </item>
      <item> Unknown </item>
      <item> Type </item>
    </list>

    <contexts>
      <context attribute="Normal Text" lineEndContext="#stay" name="normal">
        <RegExpr attribute="Preprocessor" context="#pop" String="#if(\s+\w+)?" />
        <RegExpr attribute="Preprocessor" context="#pop" String="#(else|elseif|end|error)" />

        <keyword attribute="Keyword"        context="#stay"      String="keywords"/>
        <keyword attribute="Module"         context="ModuleName" String="modules"/>
        <keyword attribute="Type"           context="#stay"      String="types"/>
      
        <DetectIdentifier attribute="Normal Text"/>

        <HlCStringChar attribute="EscapeString" context="#pop"/>

        <DetectChar attribute="RawString" context="RawString"   char="'"/>
        <DetectChar attribute="String"    context="String"      char="&quot;"/>

        <Detect2Chars attribute="Comment" context="CommentLine"   char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="CommentBlock" char="/" char1="*" beginRegion="CommentBlock"/>

        <DetectChar attribute="Normal Text" context="#stay" char="{" beginRegion="BraceA" />
        <DetectChar attribute="Normal Text" context="#stay" char="}" endRegion="BraceA" />

        <!-- Match ... and .. before numbers are matched. -->
        <StringDetect attribute="Normal Text" context="#pop" String="..."/>
        <Detect2Chars attribute="Normal Text"   char="." char1="."/>

        <!-- Float -->
        <!-- Floats must be matched before Binary|Octal|Hex|Integer -->
        <!-- All floats except integers -->
        <RegExpr attribute="Float" context="#pop" String="[\d][\d]*(\.(?!\.)[\d]*([eE][-+]?[\d]+)?)"/>
        <RegExpr attribute="Float" context="#pop" String="\.[\d][\d]*([eE][-+]?[\d]+)?"/>

        <!-- Hex|Integer -->
        <RegExpr attribute="Hex"     context="#pop" String="0[xX][\da-fA-F]+"/>
        <RegExpr attribute="Integer" context="#pop" String="\d+"/>
      </context>

      <context attribute="Module Name" lineEndContext="#stay" name="ModuleName">
        <Detect2Chars attribute="Comment"     context="CommentLine"   char="/" char1="/"/>
        <Detect2Chars attribute="Comment"     context="CommentBlock" char="/" char1="*" beginRegion="CommentBlock"/>
        <RegExpr context="#pop" String="[^\s\w.:,]"/>
      </context>

      <!-- Strings -->
      <!-- '...' -->
      <context attribute="RawString" lineEndContext="#stay" name="RawString">
        <DetectChar attribute="RawString" context="#pop" char="'"/>
      </context>
      <!-- "..." -->
      <context attribute="String" lineEndContext="#stay" name="String">
        <Detect2Chars attribute="String" context="#stay" char="\" char1="&quot;"/>
        <DetectChar attribute="String" context="#pop" char="&quot;"/>
        <HlCStringChar attribute="EscapeSequence"/>
        <RegExpr attribute="EscapeSequence" context="#stay" String="\\(u[\da-fA-F]{4}|U[\da-fA-F]{8}|&amp;[a-zA-Z]\w+;)" />
      </context>

      <!-- Comments -->
      <context attribute="Comment" lineEndContext="#pop" name="CommentLine"/>
      <context attribute="Comment" lineEndContext="#stay" name="CommentBlock">
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="CommentBlock"/>
      </context>
    </contexts>
    <itemDatas>
      <itemData name="Normal Text"    defStyleNum="dsNormal"/>
      <itemData name="Keyword"        defStyleNum="dsKeyword"/>
      <itemData name="Type"           defStyleNum="dsDataType"/>
      <itemData name="Integer"        defStyleNum="dsDecVal"/>
      <itemData name="Hex"            defStyleNum="dsBaseN"/>
      <itemData name="Float"          defStyleNum="dsFloat"/>

      <itemData name="Module"         defStyleNum="dsKeyword"  color="#0000ff" selColor="#ffffff"/>
      <itemData name="Module Name"    defStyleNum="dsNormal"  color="#0000ff" selColor="#ffffff"/>

      <itemData name="EscapeSequence" defStyleNum="dsString" color="#00aa88" selColor="#ff0000"/>
      <itemData name="String"         defStyleNum="dsString"/>
      <itemData name="RawString"      defStyleNum="dsString"/>

      <itemData name="Comment"        defStyleNum="dsComment"/>
      
      <itemData name="Preprocessor"   defStyleNum="dsOthers"/>
    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name="singleLine" start="//"/>
      <comment name="multiLine" start="/*" end="*/" />
    </comments>
    <keywords casesensitive="true"/>
  </general>
</language>