Debian Codegraph @

data/syntax/fsharp.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Kate syntax highlighting for F# based on the OCAML syntax by Glyn Webster ([email protected]). -->
3 <!DOCTYPE language
4 [
5 <!-- Regular expresion constants: -->
6 <!ENTITY LETTER "A-Za-z\300-\326\330-\366\370-\377"> <!-- Latin-1 letters. -->
7 <!ENTITY IDENT "[&LETTER;_][&LETTER;0-9_']*"> <!-- OCaml identifiers. -->
8 <!ENTITY MIDENT "[A-Z][&LETTER;0-9_']*"> <!-- OCaml uppercase identifiers. -->
9 <!ENTITY ESC "(\\[ntbr'&quot;\\]|\\[0-9]{3}|\\x[0-9A-Fa-f]{2})"> <!-- OCaml character code escapes. -->
10 <!ENTITY DEC "[0-9][0-9_]*"> <!-- Decimal digits with underscores. -->
11 ]>
12 <language name="FSharp" version="10" kateversion="5.0" section="Sources" extensions="*.fs;*.fsi;*.fsx" mimetype="" priority="10" author="Bas Bossink ([email protected])" license="LGPL">
13
14 <highlighting>
15 <list name="keywords">
16 <item>abstract</item>
17 <item>and</item>
18 <item>as</item>
19 <item>assert</item>
20 <item>base</item>
21 <!-- <item>begin</item> -->
22 <item>class</item>
23 <item>delegate</item>
24 <!-- <item>do</item> -->
25 <!-- <item>done</item> -->
26 <item>dowcast</item>
27 <item>downto</item>
28 <item>elif</item>
29 <item>else</item>
30 <!-- <item>end</item> -->
31 <item>exception</item>
32 <item>extern</item>
33 <item>false</item>
34 <item>for</item>
35 <item>fun</item>
36 <item>function</item>
37 <item>functor</item>
38 <item>global</item>
39 <item>if</item>
40 <item>in</item>
41 <!-- <item>include</item> -->
42 <item>inherit</item>
43 <item>inline</item>
44 <item>interfaece</item>
45 <item>internal</item>
46 <item>lazy</item>
47 <item>let</item>
48 <item>match</item>
49 <item>member</item>
50 <!-- <item>module</item> -->
51 <item>mutable</item>
52 <item>namespace</item>
53 <item>new</item>
54 <item>not</item>
55 <item>null</item>
56 <!-- <item>object</item> -->
57 <item>of</item>
58 <!-- <item>open</item> -->
59 <item>or</item>
60 <item>override</item>
61 <item>private</item>
62 <item>public</item>
63 <item>rec</item>
64 <item>ref</item>
65 <item>return</item>
66 <!-- <item>sig</item> -->
67 <item>static</item>
68 <!-- <item>struct</item> -->
69 <item>then</item>
70 <item>to</item>
71 <item>true</item>
72 <item>try</item>
73 <item>type</item>
74 <item>upcast</item>
75 <item>use</item>
76 <item>val</item>
77 <item>void</item>
78 <item>when</item>
79 <item>while</item>
80 <item>with</item>
81 <item>yield</item>
82 </list>
83 <list name="core types">
84 <item>bool</item>
85 <item>byte</item>
86 <item>sbyte</item>
87 <item>int16</item>
88 <item>uint16</item>
89 <item>int</item>
90 <item>uint32</item>
91 <item>int64</item>
92 <item>uint64</item>
93 <item>nativeint</item>
94 <item>unativeint</item>
95 <item>char</item>
96 <item>string</item>
97 <item>decimal</item>
98 <item>unit</item>
99 <item>void</item>
100 <item>float32</item>
101 <item>single</item>
102 <item>float</item>
103 <item>double</item>
104 <item>bigint</item>
105 <item>option</item>
106 <item>seq</item>
107 </list>
108 <list name="end">
109 <item>end</item>
110 </list>
111 <list name="sig">
112 <item>sig</item>
113 </list>
114 <list name="struct">
115 <item>struct</item>
116 </list>
117 <list name="object">
118 <item>object</item>
119 </list>
120 <list name="begin">
121 <item>begin</item>
122 </list>
123 <list name="do">
124 <item>do</item>
125 </list>
126 <list name="done">
127 <item>done</item>
128 </list>
129 <list name="module_environment">
130 <item>module</item>
131 <item>open</item>
132 </list>
133 <contexts>
134
135 <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
136
137 <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
138 <Detect2Chars context="Singleline Comment" char="/" char1="/" />
139
140 <DetectChar attribute="Symbol" context="#stay" char="(" beginRegion="paren"/>
141 <DetectChar attribute="Symbol" context="#stay" char=")" endRegion="paren"/>
142
143 <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="record"/>
144 <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="record"/>
145 <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="&lt;" beginRegion="attribute"/>
146 <Detect2Chars attribute="Symbol" context="#stay" char="&gt;" char1="]" endRegion="attribute"/>
147
148 <Detect2Chars attribute="Symbol" context="#stay" char="[" char1="|" beginRegion="array"/>
149 <Detect2Chars attribute="Symbol" context="#stay" char="|" char1="]" endRegion="array"/>
150 <DetectChar attribute="Symbol" context="#stay" char="[" beginRegion="list"/>
151 <DetectChar attribute="Symbol" context="#stay" char="]" endRegion="list"/>
152
153 <keyword attribute="Keyword" context="#stay" String="do" beginRegion="loop"/>
154 <keyword attribute="Keyword" context="#stay" String="done" endRegion="loop"/>
155 <keyword attribute="Directive" context="ModuleEnv" String="module_environment"/>
156 <keyword attribute="Region Marker" context="Block" String="begin" beginRegion="block"/>
157 <keyword attribute="Region Marker" context="Object" String="object" beginRegion="object"/>
158 <keyword attribute="Region Marker" context="Sig" String="sig" beginRegion="sig"/>
159 <keyword attribute="Region Marker" context="Struct" String="struct" beginRegion="struct"/>
160
161 <RegExpr attribute="Constructor" context="#stay" String="`\s*&IDENT;"/>
162 <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/>
163 <RegExpr attribute="Constructor" context="#stay" String="&MIDENT;"/>
164
165 <!-- Interpreter directives. -->
166 <!-- (These are lines where the first symbol is a '#' followed by an identifier. -->
167 <!-- Such lines could also be part of a method call split over two lines but -->
168 <!-- it's unlikey anyone would code like that.) -->
169 <RegExpr attribute="Directive" context="#stay" String="#&IDENT;.*$" firstNonSpace="true"/>
170
171 <!-- String, character and Camlp4 "quotation" constants. -->
172 <!-- Note: If you must modify the pattern for characters be precise: -->
173 <!-- single quotes have several meanings in Ocaml. -->
174 <DetectChar attribute="String" context="String Constant" char="&quot;" />
175 <RegExpr attribute="Character" context="#stay" String="'(&ESC;|[^'])'" />
176 <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="&lt;" char1="&lt;" />
177 <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="&lt;:&IDENT;&lt;" />
178
179 <!-- Identifiers and keywords. -->
180 <keyword attribute="Keyword" context="#stay" String="keywords" />
181 <keyword attribute="Core Data Type" context="#stay" String="core types" />
182 <RegExpr attribute="Identifier" context="#stay" String="&IDENT;" />
183
184 <!-- Numeric constants. -->
185 <!-- Note that they may contain underscores. -->
186 <RegExpr attribute="Hexadecimal" context="#stay" String="-?0[xX][0-9A-Fa-f_]+" />
187 <RegExpr attribute="Octal" context="#stay" String="-?0[oO][0-7_]+" />
188 <RegExpr attribute="Binary" context="#stay" String="-?0[bB][01_]+" />
189 <RegExpr attribute="Float" context="#stay" String="-?&DEC;((\.(&DEC;)?([eE][-+]?&DEC;)?)|([eE][-+]?&DEC;))" />
190 <RegExpr attribute="Decimal" context="#stay" String="-?&DEC;" />
191 </context>
192
193 <context attribute="Comment" lineEndContext="#pop" name="Singleline Comment">
194 <DetectSpaces />
195 <IncludeRules context="##Comments" />
196 </context>
197 <context attribute="Comment" lineEndContext="#stay" name="Multiline Comment">
198 <!-- Support for nested comments -->
199 <Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="comment" />
200 <Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
201 <DetectSpaces />
202 <IncludeRules context="##Comments" />
203 </context>
204
205 <context attribute="String" lineEndContext="#stay" name="String Constant">
206 <DetectChar attribute="String" context="#pop" char="&quot;" />
207 <!-- An underscore at the end of a line in a string indicates -->
208 <!-- that the string will continue on the next line. -->
209 <RegExpr attribute="Escaped characters" context="#stay" String="&ESC;|\\$" />
210 </context>
211
212 <context attribute="Normal Text" lineEndContext="#stay" name="Block">
213 <keyword attribute="Region Marker" context="#pop" String="end" endRegion="block"/>
214 <IncludeRules context="Normal"/>
215 </context>
216
217 <context attribute="Normal Text" lineEndContext="#stay" name="Sig">
218 <keyword attribute="Region Marker" context="#pop" String="end" endRegion="sig"/>
219 <IncludeRules context="Normal"/>
220 </context>
221
222 <context attribute="Normal Text" lineEndContext="#stay" name="Struct">
223 <keyword attribute="Region Marker" context="#pop" String="end" endRegion="struct"/>
224 <IncludeRules context="Normal"/>
225 </context>
226
227 <context attribute="Normal Text" lineEndContext="#stay" name="Object">
228 <keyword attribute="Region Marker" context="#pop" String="end" endRegion="object"/>
229 <IncludeRules context="Normal"/>
230 </context>
231
232 <context attribute="Normal Text" lineEndContext="#stay" name="ModuleEnv" fallthrough="true" fallthroughContext="#pop">
233 <DetectSpaces attribute="Normal Text" context="#stay"/>
234 <RegExpr attribute="Module" lookAhead="true" context="ModuleEnv2" String="&MIDENT;\s*\."/>
235 <RegExpr attribute="Module" context="#pop" String="&MIDENT;"/>
236 </context>
237
238 <context attribute="Normal Text" lineEndContext="#stay" name="ModuleEnv2">
239 <RegExpr attribute="Module" context="#stay" String="&MIDENT;"/>
240 <DetectSpaces attribute="Normal Text" context="#stay"/>
241 <DetectChar attribute="Keyword" context="#pop" char="."/>
242 </context>
243
244 <!-- Camlp4 Quotations. These are source code literals used by the Campl4 preprocessor. -->
245 <!-- The only escapes allowed in a Camlp4 quotation are for the quotation start and stop symbols. -->
246 <context attribute="Camlp4 Quotation" lineEndContext="#stay" name="Camlp4 Quotation Constant">
247 <Detect2Chars attribute="Camlp4 Quotation" context="#pop" char="&gt;" char1="&gt;" />
248 <Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="&lt;" char1="&lt;" />
249 <RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="&lt;:&IDENT;&lt;" />
250 <RegExpr attribute="Escaped characters" context="#stay" String="\\(\\|&gt;&gt;|&lt;&lt;|&lt;:&IDENT;&lt;)" />
251 </context>
252 </contexts>
253
254 <itemDatas>
255 <itemData name="Normal Text" defStyleNum="dsNormal"/>
256 <itemData name="Identifier" defStyleNum="dsNormal"/>
257 <itemData name="Symbol" defStyleNum="dsOperator"/>
258 <itemData name="Keyword" defStyleNum="dsKeyword"/>
259 <itemData name="Core Data Type" defStyleNum="dsDataType"/>
260 <itemData name="Decimal" defStyleNum="dsDecVal"/>
261 <itemData name="Hexadecimal" defStyleNum="dsBaseN"/>
262 <itemData name="Octal" defStyleNum="dsBaseN"/>
263 <itemData name="Binary" defStyleNum="dsBaseN"/>
264 <itemData name="Float" defStyleNum="dsFloat"/>
265 <itemData name="Character" defStyleNum="dsChar"/>
266 <itemData name="String" defStyleNum="dsString"/>
267 <itemData name="Escaped characters" defStyleNum="dsSpecialChar"/>
268 <itemData name="Comment" defStyleNum="dsComment"/>
269 <itemData name="Camlp4 Quotation" defStyleNum="dsString"/>
270 <itemData name="Directive" defStyleNum="dsOthers"/>
271 <itemData name="Constructor" defStyleNum="dsNormal"/>
272 <itemData name="Module" defStyleNum="dsNormal"/>
273 <itemData name="Region Marker" defStyleNum="dsKeyword"/>
274 </itemDatas>
275 </highlighting>
276
277 <general>
278 <keywords casesensitive="1" />
279 <comments>
280 <comment name="singleLine" start="//" />
281 <comment name="multiLine" start="(*" end="*)" region="comment" />
282 </comments>
283 </general>
284 </language>
285 <!-- kate: space-indent on; indent-width 2; replace-tabs on; -->