summaryrefslogtreecommitdiffstats
path: root/kate/data/d.xml
blob: e53a3174c603a475ddf494bac7d59f226d7d64ab (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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
  ========================================================================

  D.XML supports syntax highlighting for the D programming language under Kate.

  Copyright (C) 2004 - Simon J Mackenzie <project.katedxml@smackoz.fastmail.fm>
  This code is released under the LGPL as part of kdelibs/kate.

  ========================================================================

  D is a next generation language written by Walter Bright of Digital Mars fame.
  Digital Mars C, C++ and D Compilers can be obtained from http://www.digitalmars.com/

  ========================================================================

  Updates for D.XML can be obtained from http://kate.kde.org/hl/

  UPDATE HISTORY:-
  2004.08.15 - D.XML 1.36 - D 0.98 - Current release of D.
                                   - package, writef(strictly speaking writyef isn't a keyword) - keywords are now supported.
  2004.??.?? - D.XML 1.35 - D 0.?? - Not sure how this release got posted!
  2004.05.23 - D.XML 1.34 - D 0.90 - updated.
  2004.05.19 - D.XML 1.33 - D 0.89 - mixin - keyword is now supported.
  2004.05.19 - D.XML 1.32 - D 0.77 - pragma, typeof - keywords are now supported.
  2004.05.19 - D.XML 1.31 - D 0.76 - is - keyword is now supported.
  2003.09.06 - D.XML 1.30 - D 0.71 - foreach - keyword is now supported.
  2003.08.18 - D.XML 1.20 - D 0.69 - floats are now supported.
                                   - embedded underscores in integer and float literals are now supported.
  2003.08.11 - D.XML 1.10          - updated.
  2003.07.18 - D.XML 1.00          - First released.

  TODO:-
  - Kate string translation cannot handle \" as a literal within a D string.  The " will be interpreted as an end of string marker
    when it should be ignored because of the preceding back-slash.

   ========================================================================
-->

<language name="D" section="Sources" extensions="*.d;*.D" mimetype="text/x-dsrc" version="1.36" kateversion="2.2" casesensitive="true" author="Simon J Mackenzie (project.katedxml@smackoz.fastmail.fm)" license="LGPL">
  <highlighting>
    <list name="keywords">
      <item> abstract </item>
      <item> alias </item>
      <item> align </item>
      <item> asm </item>
      <item> auto </item>

      <item> body </item>
      <item> break </item>

      <item> case </item>
      <item> cast </item>
      <item> catch </item>
      <item> class </item>
      <item> const </item>
      <item> continue </item>

      <item> default </item>
      <item> delegate </item>
      <item> delete </item>
      <item> deprecated </item>
      <item> do </item>

      <item> else </item>
      <item> enum </item>
      <item> export </item>

      <item> false </item>
      <item> final </item>
      <item> finally </item>
      <item> for </item>
      <item> foreach </item>
      <item> function </item>

      <item> goto </item>

      <item> if </item>
      <item> in </item>
      <item> inout </item>
      <item> interface </item>
      <item> invariant </item>
      <item> is </item>

      <item> mixin </item>

      <item> new </item>
      <item> null </item>

      <item> out </item>
      <item> override </item>

      <item> package </item>
      <item> private </item>
      <item> protected </item>
      <item> public </item>

      <item> return </item>

      <item> static </item>
      <item> struct </item>
      <item> super </item>
      <item> switch </item>
      <item> synchronized </item>

      <item> template </item>
      <item> this </item>
      <item> throw </item>
      <item> true </item>
      <item> try </item>
      <item> typedef </item>
      <item> typeof </item>

      <item> union </item>

      <item> volatile </item>

      <item> while </item>
      <item> with </item>
    </list>
    <list name="modules">
      <item> module </item>
      <item> import </item>
    </list>
    <list name="types">
      <item> void </item>
      <item> bit </item>
      <item> byte </item>
      <item> ubyte </item>
      <item> short </item>
      <item> ushort </item>
      <item> int </item>
      <item> uint </item>
      <item> long </item>
      <item> ulong </item>
      <item> cent </item>
      <item> ucent </item>
      <item> float </item>
      <item> double </item>
      <item> real </item>
      <item> ireal </item>
      <item> ifloat </item>
      <item> idouble </item>
      <item> creal </item>
      <item> cfloat </item>
      <item> cdouble </item>
      <item> char </item>
      <item> wchar </item>
      <item> dchar </item>
    </list>
    <list name="phobos">
      <item> printf </item>
      <item> writef </item>
    </list>

    <list name="linkage">
      <item> extern </item>
    </list>
    <list name="ltypes">
      <item> C </item>
      <item> D </item>
      <item> Windows </item>
      <item> Pascal </item>
    </list>

    <list name="debug">
      <item> debug </item>
    </list>
    <list name="assert">
      <item> assert </item>
    </list>

    <list name="pragma">
      <item> pragma </item>
    </list>
    <list name="ptypes">
      <item> msg </item>
    </list>

    <list name="version">
      <item> version </item>
    </list>
    <list name="vtypes">
      <item> DigitalMars </item>
      <item> X86 </item>
      <item> AMD64 </item>
      <item> Windows </item>
      <item> Win32 </item>
      <item> Win64 </item>
      <item> linux </item>
      <item> LittleEndian </item>
      <item> BigEndian </item>
      <item> D_InlineAsm </item>
      <item> none </item>
    </list>

    <list name="unittest">
      <item> unittest </item>
    </list>

    <contexts>
      <context attribute="Normal Text" lineEndContext="#stay" name="normal">
        <keyword attribute="Keyword"        context="#stay"      String="keywords"/>
        <keyword attribute="Module"         context="ModuleName" String="modules"/>
        <keyword attribute="Type"           context="#stay"      String="types"/>
        <keyword attribute="Phobos Library" context="#stay"      String="phobos"/>
        <keyword attribute="Linkage"        context="Linkage"    String="linkage"/>
        <keyword attribute="Debug"          context="#stay"      String="debug"/>
        <keyword attribute="Assert"         context="#stay"      String="assert"/>
        <keyword attribute="Pragma"         context="Pragmas"    String="pragma"/>
        <keyword attribute="Version"        context="Version"    String="version"/>
        <keyword attribute="Unit Test"      context="#stay"      String="unittest"/>

        <Detect2Chars attribute="Wysiwyg"   context="Wysiwyg" char="r" char1="&quot;"/>
        <Detect2Chars attribute="Hex"       context="Hex"     char="x" char1="&quot;"/>

        <RegExpr attribute="Normal Text"    context="#pop" String="[_a-z][\w]*" insensitive="true"/>

        <RegExpr attribute="Pragma"         context="#pop" String="\#[ ]*line"/>

        <RegExpr attribute="Escape String"  context="#pop" String="\\[n|t|&quot;]"/>
        <RegExpr attribute="Escape String"  context="#pop" String="(\\r\\n)"/>
        <RegExpr attribute="Escape String"  context="#pop" String="\\0[0-7]+"/>
        <RegExpr attribute="Escape String"  context="#pop" String="\\u[\d]+"    insensitive="true"/>
        <RegExpr attribute="Escape String"  context="#pop" String="\\x[\da-fA-F]+"/>

        <RegExpr attribute="Binary"  context="#pop" String="0b[01]+[_01]*[ ]*\.\.[ ]*0b[01]+[_01]*(UL|LU|U|L)?"             insensitive="true"/>
        <RegExpr attribute="Octal"   context="#pop" String="0[0-7]+[_0-7]*[ ]*\.\.[ ]*0[0-7]+[_0-7]*(UL|LU|U|L)?"           insensitive="true"/>
        <RegExpr attribute="Hex"     context="#pop" String="0x[\da-f]+[_\da-f]*[ ]*\.\.[ ]*0x[\da-f]+[_\da-f]*(UL|LU|U|L)?" insensitive="true"/>
        <RegExpr attribute="Integer" context="#pop" String="[\d]+[_\d]*(UL|LU|U|L)?[ ]*\.\.[ ]*[\d]+[_\d]*(UL|LU|U|L)?"     insensitive="true"/>

        <RegExpr attribute="Float" context="#pop" String="[\d]*[_\d]*\.[_\d]*(e-|e|e\+)?[\d]+[_\d]*(F|L|I|FI|LI|)?"                 insensitive="true"/>
        <RegExpr attribute="Float" context="#pop" String="[\d]*[_\d]*\.?[_\d]*(e-|e|e\+)[\d]+[_\d]*(F|L|I|FI|LI|)?"                 insensitive="true"/>
        <RegExpr attribute="Float" context="#pop" String="0x[\da-f]+[_\da-f]*\.[_\da-f]*(p-|p|p\+)?[\da-f]+[_\da-f]*(F|L|I|FI|LI)?" insensitive="true"/>
        <RegExpr attribute="Float" context="#pop" String="0x[\da-f]+[_\da-f]*\.?[_\da-f]*(p-|p|p\+)[\da-f]+[_\da-f]*(F|L|I|FI|LI)?" insensitive="true"/>

        <RegExpr attribute="Binary"  context="#pop" String="0B[01]+[_01]*(UL|LU|U|L)?"       insensitive="true"/>
        <RegExpr attribute="Octal"   context="#pop" String="0[0-7]+[_0-7]*(UL|LU|U|L)?"      insensitive="true"/>
        <RegExpr attribute="Hex"     context="#pop" String="0x[\da-f]+[_\da-f]*(UL|LU|U|L)?" insensitive="true"/>
        <RegExpr attribute="Integer" context="#pop" String="[\d]+[_\d]*(UL|LU|U|L)?"         insensitive="true"/>

        <DetectChar attribute="Char"    context="Char"    char="'"/>
        <DetectChar attribute="String"  context="String"  char="&quot;"/>
        <DetectChar attribute="Wysiwyg" context="Wysiwyg" char="`"/>

        <Detect2Chars attribute="Comment" context="CommentLine"   char="/" char1="/"/>
        <Detect2Chars attribute="Comment" context="CommentBlockA" char="/" char1="*" beginRegion="CommentA"/>
        <Detect2Chars attribute="Comment" context="CommentBlockB" char="/" char1="+" beginRegion="CommentB"/>

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

      <context attribute="Module Name" lineEndContext="#stay" name="ModuleName">
        <DetectChar   attribute="Normal Text" context="#stay"         char=","/>
        <DetectChar   attribute="Normal Text" context="#pop"          char=";"/>
        <Detect2Chars attribute="Comment"     context="CommentLine"   char="/" char1="/"/>
        <Detect2Chars attribute="Comment"     context="CommentBlockA" char="/" char1="*" beginRegion="CommentA"/>
        <Detect2Chars attribute="Comment"     context="CommentBlockB" char="/" char1="+" beginRegion="CommentB"/>
      </context>

      <context attribute="Linkage" lineEndContext="#pop" name="Linkage">
        <keyword    attribute="Type"         context="#pop"  String="types"/>
        <DetectChar attribute="Normal Text"  context="#stay" char="("/>
        <keyword    attribute="Linkage Type" context="#stay" String="ltypes"/>
        <DetectChar attribute="Normal Text"  context="#pop"  char=")"/>
        <DetectChar attribute="Normal Text"  context="#pop"  char=";"/>
      </context>
      <context attribute="Version" lineEndContext="#pop" name="Version">
        <DetectChar attribute="Normal Text"  context="#pop"  char="="/>
        <DetectChar attribute="Normal Text"  context="#stay" char="("/>
        <keyword    attribute="Version Type" context="#stay" String="vtypes"/>
        <RegExpr    attribute="Normal Text"  context="#pop"  String="\w" insensitive="true"/>
        <DetectChar attribute="Normal Text"  context="#pop"  char=")"/>
      </context>
      <context attribute="Pragma" lineEndContext="#pop" name="Pragmas">
        <DetectChar attribute="Normal Text"  context="#stay" char="("/>
        <keyword    attribute="Version Type" context="#stay" String="ptypes"/>
        <keyword    attribute="Version Type" context="#stay" String="vtypes"/>
        <RegExpr    attribute="Keyword"  context="#pop" String="[_a-z][\w]*" insensitive="true"/>
        <DetectChar attribute="Normal Text"  context="#pop"  char=","/>
        <DetectChar attribute="Normal Text"  context="#pop"  char=")"/>
      </context>

      <context attribute="Wysiwyg" lineEndContext="#stay" name="Wysiwyg">
        <DetectChar attribute="Wysiwyg" context="#pop" char="&quot;"/>
        <DetectChar attribute="Wysiwyg" context="#pop" char="`"/>
      </context>
      <context attribute="Hex" lineEndContext="#stay" name="Hex">
        <DetectChar attribute="Hex" context="#pop" char="&quot;"/>
      </context>
      <context attribute="Char" lineEndContext="#stay" name="Char">
        <Detect2Chars attribute="Char" context="#stay" char="\" char1="'"/>
        <Detect2Chars attribute="Char" context="#stay" char="\" char1="\"/>
        <DetectChar   attribute="Char" context="#pop"  char="'"/>
      </context>
      <context attribute="String" lineEndContext="#stay" name="String">
        <DetectChar attribute="String" context="#pop" char="&quot;"/>
      </context>

      <context attribute="Comment" lineEndContext="#pop" name="CommentLine">
      </context>
      <context attribute="Comment" lineEndContext="#stay" name="CommentBlockA">
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="CommentA"/>
      </context>
      <context attribute="Comment" lineEndContext="#stay" name="CommentBlockB">
        <Detect2Chars attribute="Comment" context="#pop" char="+" char1="/" endRegion="CommentB"/>
      </context>
    </contexts>
    <itemDatas>
      <itemData name="Normal Text"    defStyleNum="dsNormal"/>
      <itemData name="Keyword"        defStyleNum="dsKeyword"  color="#000000" selColor="#ffffff" bold="1" italic="0"/>
      <itemData name="Module"         defStyleNum="dsKeyword"  color="#0000ff" selColor="#ffffff" bold="0" italic="0"/>
      <itemData name="Module Name"    defStyleNum="dsKeyword"  color="#0000ff" selColor="#ffffff" bold="1" italic="1"/>
      <itemData name="Type"           defStyleNum="dsDataType"/>
      <itemData name="Phobos Library" defStyleNum="dsKeyword"  color="#000000" selColor="#ffffff" bold="1" italic="1"/>
      <itemData name="Linkage"        defStyleNum="dsKeyword"  color="#ff0000" selColor="#ffffff" bold="0" italic="0"/>
      <itemData name="Linkage Type"   defStyleNum="dsDataType" color="#ff0000" selColor="#ffffff" bold="1" italic="1"/>
      <itemData name="Debug"          defStyleNum="dsKeyword"  color="#ff00ff" selColor="#ffffff" bold="0" italic="0"/>
      <itemData name="Assert"         defStyleNum="dsKeyword"  color="#0000ff" selColor="#ffffff" bold="0" italic="0"/>
      <itemData name="Version"        defStyleNum="dsKeyword"  color="#ff0000" selColor="#ffffff" bold="0" italic="0"/>
      <itemData name="Version Type"   defStyleNum="dsDataType" color="#ff0000" selColor="#ffffff" bold="1" italic="1"/>
      <itemData name="Unit Test"      defStyleNum="dsKeyword"  color="#ff00ff" selColor="#ffffff" bold="1" italic="0"/>
      <itemData name="Pragma"         defStyleNum="dsKeyword"  color="#00aa00" selColor="#ffffff" bold="1" italic="0"/>

      <itemData name="Integer"        defStyleNum="dsDecVal"/>
      <itemData name="Binary"         defStyleNum="dsBaseN"    color="#00dddd" selColor="#00ffff" bold="0" italic="0"/>
      <itemData name="Octal"          defStyleNum="dsBaseN"    color="#00aaaa" selColor="#00ffff" bold="0" italic="0"/>
      <itemData name="Hex"            defStyleNum="dsBaseN"    color="#006666" selColor="#00ffff" bold="0" italic="0"/>
      <itemData name="Float"          defStyleNum="dsFloat"/>

      <itemData name="Escape String"  defStyleNum="dsString"   color="#00aa00" selColor="#ff0000" bold="0" italic="0"/>
      <itemData name="String"         defStyleNum="dsString"   color="#00aa00" selColor="#ff0000" bold="0" italic="0"/>
      <itemData name="Char"           defStyleNum="dsChar"     color="#ff00ff" selColor="#ff00ff" bold="0" italic="0"/>
      <itemData name="Wysiwyg"        defStyleNum="dsChar"     color="#a100a1" selColor="#ff00ff" bold="0" italic="0"/>

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