summaryrefslogtreecommitdiffstats
path: root/kate/data/fsharp.xml
blob: 8cf8ab12e0b50538442d6a4160af63747067114a (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
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kate syntax highlighting for F# based on the OCAML syntax by Glyn Webster (glyn@wave.co.nz). -->
<!DOCTYPE language SYSTEM "language.dtd"
[
<!-- Regular expresion constants: -->
<!ENTITY LETTER "A-Za-z\300-\326\330-\366\370-\377">                <!-- Latin-1 letters. -->
<!ENTITY IDENT  "[&LETTER;_][&LETTER;0-9_']*">                      <!-- OCaml identifiers. -->
<!ENTITY MIDENT "[A-Z][&LETTER;0-9_']*">                            <!-- OCaml uppercase identifiers. -->
<!ENTITY ESC    "(\\[ntbr'&quot;\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})"> <!-- OCaml character code escapes. -->
<!ENTITY DEC    "[0-9][0-9_]*">                                     <!-- Decimal digits with underscores. -->
]>
<language name="FSharp" version="1.0" kateversion="2.4" section="Sources" extensions="*.fs;*.fsi;*.fsx" mimetype="" priority="10" author="Bas Bossink (bas.bossink@gmail.com)" license="LGPL">

  <highlighting>
    <list name="keywords">
      <item> abstract </item>
      <item> and </item>
      <item> as </item>
      <item> assert </item>
      <item> base </item>
<!--       <item> begin </item> -->
      <item> class </item>
      <item> delegate </item>
<!--       <item> do </item> -->
<!--       <item> done </item> -->
      <item> dowcast </item>
      <item> downto </item>
      <item> elif </item>
      <item> else </item>
<!--       <item> end </item> -->
      <item> exception </item>
      <item> extern </item>
      <item> false </item>
      <item> for </item>
      <item> fun </item>
      <item> function </item>
      <item> functor </item>
      <item> global </item>
      <item> if </item>
      <item> in </item>
<!--       <item> include </item> -->
      <item> inherit </item>
      <item> inline </item>
      <item> interfaece </item>
      <item> internal </item>
      <item> lazy </item>
      <item> let </item>
      <item> match </item>
      <item> member </item>
<!--       <item> module </item> -->
      <item> mutable </item>
      <item> namespace </item>
      <item> new </item>
      <item> not </item>
      <item> null </item>
<!--       <item> object </item> -->
      <item> of </item>
<!--       <item> open </item> -->
      <item> or </item>
      <item> override </item>
      <item> private </item>
      <item> public </item>
      <item> rec </item>
      <item> ref </item>
      <item> return </item>
<!--       <item> sig </item> -->
      <item> static </item>
<!--       <item> struct </item> -->
      <item> then </item>
      <item> to </item>
      <item> true </item>
      <item> try </item>
      <item> type </item>
      <item> upcast </item>
      <item> use </item>
      <item> val </item>
      <item> void </item>
      <item> when </item>
      <item> while </item>
      <item> with </item>
      <item> yield </item>
    </list>
    <list name="core types">
      <item> bool </item>
      <item> byte </item>
      <item> sbyte </item>
      <item> int16 </item>
      <item> uint16 </item>
      <item> int </item>
      <item> uint32 </item>
      <item> int64 </item>
      <item> uint64 </item>
      <item> nativeint </item>
      <item> unativeint </item>
      <item> char </item>
      <item> string </item>
      <item> decimal </item>
      <item> unit </item>
      <item> void </item>
      <item> float32 </item>
      <item> single </item>
      <item> float </item>
      <item> double </item>
      <item> bigint </item>
      <item> option </item>
      <item> seq </item>
    </list>
    <list name="symbols">
      <item> ? </item>
    </list>
    <list name="end">
      <item> end </item>
    </list>
    <list name="sig">
      <item> sig </item>
    </list>
    <list name="struct">
      <item> struct </item>
    </list>
    <list name="object">
      <item> object </item>
    </list>
    <list name="begin">
      <item> begin </item>
    </list>
    <list name="do">
      <item> do </item>
    </list>
    <list name="done">
      <item> done </item>
    </list>
    <list name="module_environment">
      <item> module </item>
      <item> open </item>
    </list>
    <contexts>

      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">

        <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
        <Detect2Chars context="Singleline Comment" char="/" char1="/" />

        <DetectChar attribute="Symbol" context="#stay" char="(" beginRegion="paren"/>
        <DetectChar attribute="Symbol" context="#stay" char=")" endRegion="paren"/>

        <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="record"/>
        <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="record"/>
        <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="&lt;" beginRegion="attribute"/>
        <Detect2Chars attribute="Symbol" context="#stay" char="&gt;" char1="]" endRegion="attribute"/>

        <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="|" beginRegion="array"/>
        <Detect2Chars attribute="Symbol" context="#stay" char="|" char1="]" endRegion="array"/>
        <DetectChar attribute="Symbol" context="#stay" char="[" beginRegion="list"/>
        <DetectChar attribute="Symbol" context="#stay" char="]" endRegion="list"/>

        <keyword attribute="Keyword" context="#stay" String="do" beginRegion="loop"/>
        <keyword attribute="Keyword" context="#stay" String="done" endRegion="loop"/>
        <keyword attribute="Directive" context="ModuleEnv" String="module_environment"/>
        <keyword attribute="Region Marker" context="Block" String="begin" beginRegion="block"/>
        <keyword attribute="Region Marker" context="Object" String="object" beginRegion="object"/>
        <keyword attribute="Region Marker" context="Sig" String="sig" beginRegion="sig"/>
        <keyword attribute="Region Marker" context="Struct" String="struct" beginRegion="struct"/>

        <RegExpr attribute="Constructor" context="#stay" String="`\s*&IDENT;"/>
        <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/>
        <RegExpr attribute="Constructor" context="#stay" String="&MIDENT;"/>

        <!-- Interpreter directives. -->
        <!-- (These are lines where the first symbol is a '#' followed by an identifier. -->
        <!-- Such lines could also be part of a method call split over two lines but     -->
        <!-- it's unlikey anyone would code like that.)                                  -->
        <RegExpr attribute="Directive" context="#stay" String="#&IDENT;.*$" firstNonSpace="true"/>

        <!-- String, character and Camlp4 "quotation" constants.              -->
        <!-- Note: If you must modify the pattern for characters be precise:  -->
        <!-- single quotes have several meanings in Ocaml.                    -->
        <DetectChar attribute="String" context="String Constant" char="&quot;" />
        <RegExpr attribute="Character" context="#stay" String="'(&ESC;|[^'])'" />
        <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="&lt;" char1="&lt;" />
        <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="&lt;:&IDENT;&lt;" />

        <!-- Identifiers and keywords. -->
        <keyword attribute="Keyword" context="#stay" String="keywords" />
        <keyword attribute="Core Data Type" context="#stay" String="core types" />
        <RegExpr attribute="Identifier" context="#stay" String="&IDENT;" />

        <!-- Numeric constants. -->
        <!-- Note that they may contain underscores. -->
        <RegExpr attribute="Hexadecimal" context="#stay" String="-?0[xX][0-9A-Fa-f_]+" />
        <RegExpr attribute="Octal" context="#stay" String="-?0[oO][0-7_]+" />
        <RegExpr attribute="Binary" context="#stay" String="-?0[bB][01_]+" />
        <RegExpr attribute="Float" context="#stay" String="-?&DEC;((\.(&DEC;)?([eE][-+]?&DEC;)?)|([eE][-+]?&DEC;))" />
        <RegExpr attribute="Decimal" context="#stay" String="-?&DEC;" />
      </context>

      <context attribute="Comment" lineEndContext="#pop" name="Singleline Comment"/>
      <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment">
        <!-- Support for nested comments -->
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="comment" />
        <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
      </context>

      <context attribute="String" lineEndContext="#stay" name="String Constant">
        <DetectChar attribute="String" context="#pop" char="&quot;" />
        <RegExpr attribute="Escaped characters" context="#stay" String="&ESC;" />
        <!-- An underscore at the end of a line in a string indicates  -->
        <!-- that the string will continue on the next line.           -->
        <RegExpr attribute="Escaped characters" context="#stay" String="\\$" />
      </context>

      <context attribute="Normal text" lineEndContext="#stay" name="Block">
        <keyword attribute="Region Marker" context="#pop" String="end" endRegion="block"/>
        <IncludeRules context="Normal"/>
      </context>

      <context attribute="Normal text" lineEndContext="#stay" name="Sig">
        <keyword attribute="Region Marker" context="#pop" String="end" endRegion="sig"/>
        <IncludeRules context="Normal"/>
      </context>

      <context attribute="Normal text" lineEndContext="#stay" name="Struct">
        <keyword attribute="Region Marker" context="#pop" String="end" endRegion="struct"/>
        <IncludeRules context="Normal"/>
      </context>

      <context attribute="Normal text" lineEndContext="#stay" name="Object">
        <keyword attribute="Region Marker" context="#pop" String="end" endRegion="object"/>
        <IncludeRules context="Normal"/>
      </context>

      <context attribute="Normal text" lineEndContext="#stay" name="ModuleEnv" fallthrough="true" fallthroughContext="#pop">
        <DetectSpaces attribute="Normal text" context="#stay"/>
        <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/>
        <RegExpr attribute="Module" context="#pop" String="&MIDENT;"/>
      </context>

      <context attribute="Normal text" lineEndContext="#stay" name="ModuleEnv2">
        <RegExpr attribute="Module" context="#stay" String="&MIDENT;"/>
        <DetectSpaces attribute="Normal text" context="#stay"/>
        <StringDetect attribute="Keyword" context="#pop" String="."/>
      </context>

      <!-- Camlp4 Quotations. These are source code literals used by the Campl4 preprocessor.           -->
      <!-- The only escapes allowed in a Camlp4 quotation are for the quotation start and stop symbols. -->
      <context attribute="Camlp4 Quotation" lineEndContext="#stay" name="Camlp4 Quotation Constant">
        <Detect2Chars attribute="Camlp4 Quotation" context="#pop" char="&gt;" char1="&gt;" />
        <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="&lt;" char1="&lt;" />
        <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="&lt;:&IDENT;&lt;" />
        <RegExpr attribute="Escaped characters" context="#stay" String="\\(\\|&gt;&gt;|&lt;&lt;)" />
        <RegExpr attribute="Escaped characters" context="#stay" String="\\&lt;:&IDENT;&lt;" />
      </context>
    </contexts>

    <itemDatas>
      <itemData name="Normal Text" defStyleNum="dsNormal"/>
      <itemData name="Identifier" defStyleNum="dsNormal"/>
      <itemData name="Symbol" defStyleNum="dsNormal"/>
      <itemData name="Keyword"  defStyleNum="dsKeyword"/>
      <itemData name="Revised Syntax Keyword"  defStyleNum="dsNormal"/>
      <itemData name="Core Data Type"  defStyleNum="dsDataType"/>
      <itemData name="Decimal"  defStyleNum="dsDecVal"/>
      <itemData name="Hexadecimal"  defStyleNum="dsBaseN"/>
      <itemData name="Octal"  defStyleNum="dsBaseN"/>
      <itemData name="Binary"  defStyleNum="dsBaseN"/>
      <itemData name="Float"  defStyleNum="dsFloat"/>
      <itemData name="Character"  defStyleNum="dsChar"/>
      <itemData name="String"  defStyleNum="dsString"/>
      <itemData name="Escaped characters"  defStyleNum="dsChar"/>
      <itemData name="Comment"  defStyleNum="dsComment"/>
      <itemData name="Camlp4 Quotation"  defStyleNum="dsString"/>
      <itemData name="Directive"  defStyleNum="dsOthers"/>
      <itemData name="Constructor" defStyleNum="dsNormal"/>
      <itemData name="Module" defStyleNum="dsNormal"/>
      <itemData name="Region Marker" defStyleNum="dsKeyword"/>
    </itemDatas>
  </highlighting>

  <general>
    <keywords casesensitive="1" />
    <comments>
      <comment name="singleLine" start="//" />
      <comment name="singleLine" start="///" />
      <comment name="multiLine" start="(*" end="*)" />
    </comments>
  </general>
</language>
<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->