blob: f86b2fac8834160f3b8314ea8e1f9cc858e78949 (
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
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kate syntax highlighting for Objective Caml version 3.07 in the standard and revised syntaxes. -->
<!DOCTYPE language SYSTEM "language.dtd"
[
<!-- Regular expresion constants: -->
<!ENTITY LETTER "A-Za-z\0300-\0326\0330-\0366\0370-\0377"> <!-- Latin-1 letters. -->
<!ENTITY IDENT "[&LETTER;_][&LETTER;0-9_']*"> <!-- OCaml identifiers. -->
<!ENTITY MIDENT "[A-Z][&LETTER;0-9_']*"> <!-- OCaml uppercase identifiers. -->
<!ENTITY ESC "(\\[ntbr'"\\]|\\[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="Objective Caml" version="1.05" kateversion="2.4" section="Sources" extensions="*.ml;*.mli" mimetype="" priority="10" author="Glyn Webster (glyn@wave.co.nz)" license="LGPL">
<highlighting>
<!-- Revised Syntax keywords are highlighted as identifiers by default. -->
<!-- Change their highlighting colour to match the standard keywords -->
<!-- if you intend to use the Camlp4 Revised Syntax. -->
<list name="revised syntax keywords">
<item> declare </item>
<item> value </item>
<item> where </item>
</list>
<list name="keywords">
<item> and </item>
<item> as </item>
<item> assert </item>
<item> asr </item>
<!-- <item> begin </item> -->
<item> class </item>
<item> closed </item>
<item> constraint </item>
<!-- <item> do </item> -->
<!-- <item> done </item> -->
<item> downto </item>
<item> else </item>
<!-- <item> end </item> -->
<item> exception </item>
<item> external </item>
<item> false </item>
<item> for </item>
<item> fun </item>
<item> function </item>
<item> functor </item>
<item> if </item>
<item> in </item>
<!-- <item> include </item> -->
<item> inherit </item>
<item> initializer </item>
<item> land </item>
<item> lazy </item>
<item> let </item>
<item> lor </item>
<item> lsl </item>
<item> lsr </item>
<item> lxor </item>
<item> match </item>
<item> method </item>
<item> mod </item>
<!-- <item> module </item> -->
<item> mutable </item>
<item> new </item>
<!-- <item> object </item> -->
<item> of </item>
<!-- <item> open </item> -->
<item> or </item>
<item> parser </item>
<item> private </item>
<item> rec </item>
<!-- <item> sig </item> -->
<!-- <item> struct </item> -->
<item> then </item>
<item> to </item>
<item> true </item>
<item> try </item>
<item> type </item>
<item> val </item>
<item> virtual </item>
<item> when </item>
<item> while </item>
<item> with </item>
</list>
<list name="core types">
<item> exn </item>
<item> lazy_t </item>
<item> format </item>
<item> unit </item>
<item> int </item>
<item> real </item>
<item> char </item>
<item> string </item>
<item> ref </item>
<item> array </item>
<item> bool </item>
<item> list </item>
<item> option </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>
<item> include </item>
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
<Detect2Chars attribute="Comment" context="Multiline Comment" char="(" char1="*" beginRegion="comment" />
<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="|" 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=""" />
<RegExpr attribute="Character" context="#stay" String="'(&ESC;|[^'])'" />
<Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="<" char1="<" />
<RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="<:&IDENT;<" />
<!-- Identifiers and keywords. -->
<keyword attribute="Keyword" context="#stay" String="keywords" />
<keyword attribute="Revised Syntax Keyword" context="#stay" String="revised syntax 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="#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=""" />
<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=">" char1=">" />
<Detect2Chars attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" char="<" char1="<" />
<RegExpr attribute="Camlp4 Quotation" context="Camlp4 Quotation Constant" String="<:&IDENT;<" />
<RegExpr attribute="Escaped characters" context="#stay" String="\\(\\|>>|<<)" />
<RegExpr attribute="Escaped characters" context="#stay" String="\\<:&IDENT;<" />
</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="dsDataType"/>
<itemData name="Module" defStyleNum="dsNormal"/>
<itemData name="Region Marker" defStyleNum="dsKeyword"/>
</itemDatas>
</highlighting>
<general>
<keywords casesensitive="1" />
<comments>
<comment name="multiLine" start="(*" end="*)" />
</comments>
</general>
</language>
<!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
|