Debian Codegraph @

data/syntax/modula-2-iso-only.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE language>
3 <language name="Modula-2 (ISO only)" mimetype="text/x-modula2" version="4"
4 kateversion="5.0" section="Sources" priority="3" extensions="*.mod;*.def"
5 casesensitive="1" author="B. Kowarsch (trijezdci@github)" license="MIT">
6 <!--
7 *****************************************************************************
8 ISO Modula-2 syntax highlighting profile for Kate
9
10 Copyright (C) 2018 Modula-2 Software Foundation
11
12 Licensed under the MIT license <https://opensource.org/licenses/MIT>
13
14 This profile covers ISO Modula-2 (ISO 10514-1) by ISO/IEC/TC1/SC22/WG13.
15
16 Since standard specifications from ISO are not available publicly free
17 of charge and the fees to obtain copies is quite high, references to a
18 summary by Excelsior LLC are given in this profile.
19
20 A list of ISO Modula-2 keywords can be found at:
21
22 https://www.excelsior-usa.com/doc/xds/isom202.html#5
23
24 In ISO Modula-2 terminology there are two kinds of built-in identifiers:
25 (1) predefined identifiers, also called pervasive identifiers or simply
26 pervasives, and (2) identifiers that are provided by a built-in module,
27 called SYSTEM. There is no terminology for the latter group.
28
29 A list of pervasives can be found at:
30
31 https://www.excelsior-usa.com/doc/xds/isom203.html#194
32
33 Identifiers provided by built-in module SYSTEM are given at:
34
35 https://www.excelsior-usa.com/doc/xds/isom204.html#306
36
37 Procedures ALLOCATE and DEALLOCATE to which macros NEW and DISPOSE resolve
38 are given under the subsections for procedures NEW and DISPOSE. Although
39 the implementations of ALLOCATE and DEALLOCATE are library supplied, their
40 identifiers are hardcoded into the language. For the purpose of syntax
41 highlighting, they should therefore be treated as built-in identifiers.
42 Identifiers exported by built-in module SYSTEM are given in PIM4, page 121.
43
44 In ISO Modula-2 terminology, there are two kinds of procedures: those that
45 return a result in their own name, and those that do not. When necessary to
46 differentiate between them, the former are called function procedures and
47 the latter proper procedures. For this reason, both function and procedure
48 identifiers are listed together under "procedures" in this profile.
49
50 Some ISO Modula-2 compilers implemented additional built-in types, most
51 notably LONGCARD, LONGINT, SHORTCARD and SHORTINT. However, these types are
52 not part of the ISO Modula-2 language definition and consequently they are
53 not recognised as built-in identifiers in this profile.
54 *****************************************************************************
55 -->
56 <highlighting>
57 <list name="workaround">
58 <!-- BUG: Kate ignores first entry in context 'Normal' -->
59 <!-- WORKAROUND: Use the name of this dummy list as first entry -->
60 <item>???</item> <!-- use '???' in source to test/verify this bug -->
61 </list>
62
63 <!-- KeyWords -->
64 <list name="keywords">
65 <item>AND</item>
66 <item>ARRAY</item>
67 <item>BEGIN</item>
68 <item>BY</item>
69 <item>CASE</item>
70 <item>CONST</item>
71 <item>DEFINITION</item>
72 <item>DIV</item>
73 <item>DO</item>
74 <item>ELSE</item>
75 <item>ELSIF</item>
76 <item>END</item>
77 <item>EXIT</item>
78 <item>EXCEPT</item>
79 <item>EXPORT</item>
80 <item>FINALLY</item>
81 <item>FOR</item>
82 <item>FORWARD</item>
83 <item>FROM</item>
84 <item>IF</item>
85 <item>IMPLEMENTATION</item>
86 <item>IMPORT</item>
87 <item>IN</item>
88 <item>LOOP</item>
89 <item>MOD</item>
90 <item>MODULE</item>
91 <item>NOT</item>
92 <item>OF</item>
93 <item>OR</item>
94 <item>PACKEDSET</item>
95 <item>POINTER</item>
96 <item>PROCEDURE</item>
97 <item>QUALIFIED</item>
98 <item>RECORD</item>
99 <item>REM</item>
100 <item>REPEAT</item>
101 <item>RETRY</item>
102 <item>RETURN</item>
103 <item>SET</item>
104 <item>THEN</item>
105 <item>TO</item>
106 <item>TYPE</item>
107 <item>UNTIL</item>
108 <item>VAR</item>
109 <item>WHILE</item>
110 <item>WITH</item>
111 </list>
112
113 <!-- Built-in Constant Identifiers -->
114 <list name="constants">
115 <item>FALSE</item>
116 <item>INTERRUPTIBLE</item>
117 <item>NIL</item>
118 <item>TRUE</item>
119 <item>UNINTERRUPTIBLE</item>
120 </list>
121
122 <!-- Built-in Type Identifiers -->
123 <list name="types">
124 <!-- Pervasives -->
125 <item>BOOLEAN</item>
126 <item>BITSET</item>
127 <item>CARDINAL</item>
128 <item>COMPLEX</item>
129 <item>CHAR</item>
130 <item>INTEGER</item>
131 <item>LONGCOMPLEX</item>
132 <item>LONGREAL</item>
133 <item>PROC</item>
134 <item>PROTECTION</item>
135 <item>REAL</item>
136 </list>
137
138 <!-- Built-in Procedure Identifiers -->
139 <list name="procedures">
140 <!-- Pervasives -->
141 <item>ABS</item>
142 <item>CAP</item>
143 <item>CHR</item>
144 <item>CMPLX</item>
145 <item>DEC</item>
146 <item>EXCL</item>
147 <item>FLOAT</item>
148 <item>HALT</item>
149 <item>HIGH</item>
150 <item>IM</item>
151 <item>INC</item>
152 <item>INCL</item>
153 <item>INT</item>
154 <item>LENGTH</item>
155 <item>LFLOAT</item>
156 <item>MAX</item>
157 <item>MIN</item>
158 <item>ODD</item>
159 <item>ORD</item>
160 <item>RE</item>
161 <item>SIZE</item>
162 <item>TRUNC</item>
163 <item>VAL</item>
164 </list>
165
166 <!-- Built-in Macros -->
167 <list name="macros">
168 <!-- NEW resolves to ALLOCATE -->
169 <item>NEW</item>
170 <item>ALLOCATE</item>
171
172 <!-- DISPOSE resolves to DEALLOCATE -->
173 <item>DISPOSE</item>
174 <item>DEALLOCATE</item>
175 </list>
176
177 <!-- Module SYSTEM -->
178 <list name="unsafe">
179 <!-- Module Identifier -->
180 <item>SYSTEM</item>
181
182 <!-- Constants -->
183 <item>BITSPERLOC</item>
184 <item>BITSPERWORD</item>
185
186 <!-- Types -->
187 <item>ADDRESS</item>
188 <item>LOC</item>
189 <item>WORD</item>
190
191 <!-- Procedures -->
192 <item>ADDADR</item>
193 <item>ADR</item>
194 <item>CAST</item>
195 <item>DIFADR</item>
196 <item>MAKEADR</item>
197 <item>ROTATE</item>
198 <item>SHIFT</item>
199 <item>SUBADR</item>
200 <item>TSIZE</item>
201 </list>
202
203 <contexts>
204 <context attribute="Plain Source" lineEndContext="#stay" name="plain">
205 <!-- BUG: first entry is ignored, leave Dummy at first position -->
206 <keyword attribute="Dummy" context="#stay" String="workaround"/>
207
208 <!-- Keyords -->
209 <keyword attribute="Keyword" context="#stay" String="keywords"/>
210
211 <!-- Built-in Constant Identifiers -->
212 <keyword attribute="Const" context="#stay" String="constants"/>
213
214 <!-- Built-in Type Identifiers -->
215 <keyword attribute="Type" context="#stay" String="types"/>
216
217 <!-- Built-in Procedure Identifiers -->
218 <keyword attribute="Builtin" context="#stay" String="procedures"/>
219
220 <!-- Built-in Macro Identifiers and Translations -->
221 <keyword attribute="Builtin" context="#stay" String="macros"/>
222
223 <!-- Facilities from Built-in Module SYSTEM -->
224 <keyword attribute="Unsafe" context="#stay" String="unsafe"/>
225
226 <!-- Base-16 Integer Literals -->
227 <!-- Base-8 Integers and Character Code Literals -->
228 <RegExpr attribute="Number" context="#stay" String="0[0-9A-F]*H|[0-7]+[BC]"/>
229
230 <!-- Real Number Literals -->
231 <Float attribute="Number" context="#stay"/>
232
233 <!-- Decimal Integer Literals -->
234 <Int attribute="Number" context="#stay"/>
235
236 <!-- Start of Double-Quoted String Literal -->
237 <DetectChar attribute="String" context="DoubleQuotedString" char="&quot;" />
238
239 <!-- Start of Single-Quoted String Literal -->
240 <DetectChar attribute="String" context="SingleQuotedString" char="'" />
241
242 <!-- Start of Modula-2 Dialect Tags -->
243 <StringDetect attribute="DialectTag" context="InDialectTag" String="(*!"/>
244
245 <!-- Start of Pragma -->
246 <Detect2Chars attribute="Pragma" context="InPragma" char="&lt;" char1="*"/>
247
248 <!-- Start of Comment -->
249 <Detect2Chars attribute="Comment"
250 context="InComment" char="(" char1="*" beginRegion="FoldableComment"/>
251 </context>
252
253 <!-- End of Double-Quoted String Literal -->
254 <context attribute="String" lineEndContext="#pop" name="DoubleQuotedString">
255 <DetectChar attribute="String" context="#pop" char="&quot;"/>
256 </context>
257
258 <!-- End of Single-Quoted String Literal -->
259 <context attribute="String" lineEndContext="#pop" name="SingleQuotedString">
260 <DetectChar attribute="String" context="#pop" char="'" />
261 </context>
262
263 <!-- End of Dialet Tag -->
264 <context attribute="DialectTag" lineEndContext="#pop" name="InDialectTag">
265 <Detect2Chars attribute="DialectTag" context="#pop" char="*" char1=")"/>
266 </context>
267
268 <!-- End of Pragma -->
269 <context attribute="Pragma" lineEndContext="#stay" name="InPragma">
270 <Detect2Chars attribute="Pragma" context="#pop" char="*" char1="&gt;"/>
271 </context>
272
273 <context attribute="Comment" lineEndContext="#stay" name="InComment">
274 <!-- Start of nested Comment -->
275 <Detect2Chars attribute="Comment"
276 context="InComment" char="(" char1="*" beginRegion="FoldableComment"/>
277
278 <!-- End of Comment -->
279 <Detect2Chars attribute="Comment"
280 context="#pop" char="*" char1=")" endRegion="FoldableComment"/>
281
282 <DetectSpaces />
283 <IncludeRules context="##Comments" />
284 </context>
285 </contexts>
286
287 <itemDatas>
288 <!-- Style for Plain Source Text -->
289 <itemData name="Plain Source"
290 defStyleNum="dsNormal" bold="0" italic="0" />
291
292 <!-- Style for Reserved Words -->
293 <itemData name="Keyword"
294 defStyleNum="dsKeyword" bold="1" italic="0" />
295
296 <!-- Style for Built-in Constant Identifiers -->
297 <itemData name="Const"
298 defStyleNum="dsBuiltIn" bold="1" italic="0" />
299
300 <!-- Style for Built-in Type Identifiers -->
301 <itemData name="Type"
302 defStyleNum="dsDataType" bold="1" italic="0" />
303
304 <!-- Style for Built-in Procedure Identifiers -->
305 <itemData name="Builtin"
306 defStyleNum="dsBuiltIn" bold="1" italic="0" />
307
308 <!-- Style for Facilities from Module SYSTEM -->
309 <itemData name="Unsafe"
310 defStyleNum="dsWarning" bold="1" italic="0"/>
311
312 <!-- Style for Number Literals -->
313 <itemData name="Number"
314 defStyleNum="dsDecVal" bold="0" italic="0" />
315
316 <!-- Style for Quoted Literals -->
317 <itemData name="String"
318 defStyleNum="dsString" bold="0" italic="0" />
319
320 <!-- Style for Dialect Tags -->
321 <itemData name="DialectTag"
322 defStyleNum="dsComment" bold="1" italic="0" />
323
324 <!-- Style for Pragmas -->
325 <itemData name="Pragma"
326 defStyleNum="dsPreprocessor" bold="1" italic="0" />
327
328 <!-- Style for Comments -->
329 <itemData name="Comment"
330 defStyleNum="dsComment" bold="0" italic="1" />
331
332 <!-- Dummy style for testing -->
333 <itemData name="Dummy" defStyleNum="dsError" />
334 </itemDatas>
335 </highlighting>
336
337 <general>
338 <keywords casesensitive="1" />
339 <comments>
340 <comment name="multiLine" start="(*" end="*)" region="FoldableComment" />
341 </comments>
342 </general>
343 </language>
344 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->