| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language> |
| 3 |
<language name="Modula-2 (R10 only)" mimetype="text/x-modula2" version="4" |
| 4 |
kateversion="5.0" section="Sources" priority="2" extensions="*.mod;*.def" |
| 5 |
casesensitive="1" author="B. Kowarsch (trijezdci@github)" license="MIT"> |
| 6 |
<!-- |
| 7 |
***************************************************************************** |
| 8 |
Modula-2 R10 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 |
A reference for the Modula-2 R10 BSK subset is available online at: |
| 15 |
|
| 16 |
https://github.com/m2sf/m2bsk/wiki/Language-Description |
| 17 |
|
| 18 |
In Modula-2 terminology, keywords are called reserved words. |
| 19 |
|
| 20 |
https://github.com/m2sf/m2bsk/wiki/Language-Description#reserved-words. |
| 21 |
|
| 22 |
Additional reserved words are available in the fulls spec for which the |
| 23 |
specification is outdated and being revised. The EBNF is available at: |
| 24 |
|
| 25 |
https://github.com/m2sf/M2-R10-Syntax-Diagrams/blob/master/m2r10-grammar.gll |
| 26 |
|
| 27 |
There are two kinds of built-in identifiers: |
| 28 |
|
| 29 |
(1) Predefined identifiers, also known as pervasives are listed at: |
| 30 |
|
| 31 |
https://github.com/m2sf/m2bsk/wiki/Language-Description#predefined-identifiers |
| 32 |
|
| 33 |
(2) Identifiers provided by built-in Module UNSAFE are listed at: |
| 34 |
|
| 35 |
https://github.com/m2sf/m2bsk/wiki/Language-Description#low-level-facilities |
| 36 |
|
| 37 |
In Modula-2 terminology, there are two kinds of procedures: those that return |
| 38 |
a result in their own name, and those that do not. When it is necessary to |
| 39 |
differentiate, the former are called function procedures and the latter |
| 40 |
proper procedures. For this reason, both function and procedure identifiers |
| 41 |
are listed together under a single group "procedures" in this profile. |
| 42 |
***************************************************************************** |
| 43 |
--> |
| 44 |
<highlighting> |
| 45 |
<list name="workaround"> |
| 46 |
<!-- BUG: Kate ignores first entry in context 'Normal' --> |
| 47 |
<!-- WORKAROUND: Use the name of this dummy list as first entry --> |
| 48 |
<item>???</item> <!-- use '???' in source to test/verify this bug --> |
| 49 |
</list> |
| 50 |
|
| 51 |
<!-- Reserved Words --> |
| 52 |
<list name="keywords"> |
| 53 |
<item>ALIAS</item> |
| 54 |
<item>AND</item> |
| 55 |
<item>ARGLIST</item> |
| 56 |
<item>ARRAY</item> |
| 57 |
<item>BEGIN</item> |
| 58 |
<item>BLUEPRINT</item> |
| 59 |
<item>BY</item> |
| 60 |
<item>CASE</item> |
| 61 |
<item>CONST</item> |
| 62 |
<item>COPY</item> |
| 63 |
<item>DEFINITION</item> |
| 64 |
<item>DIV</item> |
| 65 |
<item>DO</item> |
| 66 |
<item>ELSE</item> |
| 67 |
<item>ELSIF</item> |
| 68 |
<item>END</item> |
| 69 |
<item>EXIT</item> |
| 70 |
<item>FOR</item> |
| 71 |
<item>FROM</item> |
| 72 |
<item>GENLIB</item> |
| 73 |
<item>IF</item> |
| 74 |
<item>IMPLEMENTATION</item> |
| 75 |
<item>IMPORT</item> |
| 76 |
<item>IN</item> |
| 77 |
<item>LOOP</item> |
| 78 |
<item>MOD</item> |
| 79 |
<item>MODULE</item> |
| 80 |
<item>NEW</item> |
| 81 |
<item>NOT</item> |
| 82 |
<item>OF</item> |
| 83 |
<item>OPAQUE</item> |
| 84 |
<item>OR</item> |
| 85 |
<item>POINTER</item> |
| 86 |
<item>PROCEDURE</item> |
| 87 |
<item>READ</item> |
| 88 |
<item>RECORD</item> |
| 89 |
<item>REFERENTIAL</item> |
| 90 |
<item>RELEASE</item> |
| 91 |
<item>REPEAT</item> |
| 92 |
<item>RETAIN</item> |
| 93 |
<item>RETURN</item> |
| 94 |
<item>SET</item> |
| 95 |
<item>THEN</item> |
| 96 |
<item>TO</item> |
| 97 |
<item>TYPE</item> |
| 98 |
<item>UNTIL</item> |
| 99 |
<item>VAR</item> |
| 100 |
<item>WHILE</item> |
| 101 |
<item>WRITE</item> |
| 102 |
<item>YIELD</item> |
| 103 |
</list> |
| 104 |
|
| 105 |
<!-- Built-in Constant Identifiers --> |
| 106 |
<list name="constants"> |
| 107 |
<item>FALSE</item> |
| 108 |
<item>NIL</item> |
| 109 |
<item>TRUE</item> |
| 110 |
</list> |
| 111 |
|
| 112 |
<!-- Built-in Type Identifiers --> |
| 113 |
<list name="types"> |
| 114 |
<!-- Pervasives --> |
| 115 |
<item>BOOLEAN</item> |
| 116 |
<item>CARDINAL</item> |
| 117 |
<item>CHAR</item> |
| 118 |
<item>INTEGER</item> |
| 119 |
<item>LONGCARD</item> |
| 120 |
<item>LONGINT</item> |
| 121 |
<item>LONGREAL</item> |
| 122 |
<item>OCTET</item> |
| 123 |
<item>REAL</item> |
| 124 |
<item>UNICHAR</item> |
| 125 |
</list> |
| 126 |
|
| 127 |
<!-- Built-in Procedure Identifiers --> |
| 128 |
<list name="procedures"> |
| 129 |
<!-- Pervasives --> |
| 130 |
<item>ABS</item> |
| 131 |
<item>APPEND</item> |
| 132 |
<item>CAPACITY</item> |
| 133 |
<item>CHR</item> |
| 134 |
<item>COUNT</item> |
| 135 |
<item>ENTIER</item> |
| 136 |
<item>INSERT</item> |
| 137 |
<item>LENGTH</item> |
| 138 |
<item>LOG2</item> |
| 139 |
<item>MAX</item> |
| 140 |
<item>MIN</item> |
| 141 |
<item>ODD</item> |
| 142 |
<item>ORD</item> |
| 143 |
<item>POW2</item> |
| 144 |
<item>PRED</item> |
| 145 |
<item>PTR</item> |
| 146 |
<item>REMOVE</item> |
| 147 |
<item>SGN</item> |
| 148 |
<item>SUCC</item> |
| 149 |
</list> |
| 150 |
|
| 151 |
<!-- Built-in Macros --> |
| 152 |
<list name="macros"> |
| 153 |
<item>TLIMIT</item> |
| 154 |
<item>TMAX</item> |
| 155 |
<item>TMIN</item> |
| 156 |
<item>TSIZE</item> |
| 157 |
</list> |
| 158 |
|
| 159 |
<!-- Module UNSAFE --> |
| 160 |
<list name="unsafe"> |
| 161 |
<!-- Reserved Words --> |
| 162 |
<item>CAST</item> |
| 163 |
|
| 164 |
<!-- Module Identifier --> |
| 165 |
<item>UNSAFE</item> |
| 166 |
|
| 167 |
<!-- Constants --> |
| 168 |
<item>BitsPerAddress</item> |
| 169 |
<item>BitsPerByte</item> |
| 170 |
<item>BytesPerWord</item> |
| 171 |
<item>BytesPerLongWord</item> |
| 172 |
|
| 173 |
<!-- Types --> |
| 174 |
<item>ADDRESS</item> |
| 175 |
<item>BYTE</item> |
| 176 |
<item>LONGWORD</item> |
| 177 |
<item>OCTETSEQ</item> |
| 178 |
<item>WORD</item> |
| 179 |
|
| 180 |
<!-- Procedures --> |
| 181 |
<item>ADD</item> |
| 182 |
<item>ADR</item> |
| 183 |
<item>BIT</item> |
| 184 |
<item>BWAND</item> |
| 185 |
<item>BWNOT</item> |
| 186 |
<item>BWOR</item> |
| 187 |
<item>HALT</item> |
| 188 |
<item>SETBIT</item> |
| 189 |
<item>SHL</item> |
| 190 |
<item>SHR</item> |
| 191 |
<item>SUB</item> |
| 192 |
|
| 193 |
<!-- Macros --> |
| 194 |
<item>NOP</item> |
| 195 |
</list> |
| 196 |
|
| 197 |
<contexts> |
| 198 |
<context attribute="Plain Source" lineEndContext="#stay" name="plain"> |
| 199 |
<!-- BUG: first entry is ignored, leave Dummy at first position --> |
| 200 |
<keyword attribute="Dummy" context="#stay" String="workaround"/> |
| 201 |
|
| 202 |
<!-- Reserved Words --> |
| 203 |
<keyword attribute="Keyword" context="#stay" String="keywords"/> |
| 204 |
|
| 205 |
<!-- Built-in Constant Identifiers --> |
| 206 |
<keyword attribute="Const" context="#stay" String="constants"/> |
| 207 |
|
| 208 |
<!-- Built-in Type Identifiers --> |
| 209 |
<keyword attribute="Type" context="#stay" String="types"/> |
| 210 |
|
| 211 |
<!-- Built-in Procedure Identifiers --> |
| 212 |
<keyword attribute="Builtin" context="#stay" String="procedures"/> |
| 213 |
|
| 214 |
<!-- Built-in Macro Identifiers and Translations --> |
| 215 |
<keyword attribute="Builtin" context="#stay" String="macros"/> |
| 216 |
|
| 217 |
<!-- Facilities from Built-in Module UNSAFE --> |
| 218 |
<keyword attribute="Unsafe" context="#stay" String="unsafe"/> |
| 219 |
|
| 220 |
<!-- Base-2 Integer Literals --> |
| 221 |
<!-- Base-16 Integer and Character Code Literals --> |
| 222 |
<RegExpr attribute="Number" context="#stay" |
| 223 |
String="0b([01]+('[01]+)?)+|0[ux]([0-9A-F]+('[0-9A-F]+)?)+"/> |
| 224 |
|
| 225 |
<!-- Real Number Literals --> |
| 226 |
<Float attribute="Number" context="#stay"/> |
| 227 |
|
| 228 |
<!-- Decimal Integer Literals --> |
| 229 |
<RegExpr attribute="Number" context="#stay" |
| 230 |
String="([1-9][0-9]*('[0-9]+)*)|0"/> |
| 231 |
|
| 232 |
<!-- Start of Double-Quoted String Literal --> |
| 233 |
<DetectChar attribute="String" context="DoubleQuotedString" char="""/> |
| 234 |
|
| 235 |
<!-- Start of Single-Quoted String Literal --> |
| 236 |
<DetectChar attribute="String" context="SingleQuotedString" char="'"/> |
| 237 |
|
| 238 |
<!-- Start of Modula-2 Dialect Tag --> |
| 239 |
<StringDetect attribute="DialectTag" context="InDialectTag" String="(*!"/> |
| 240 |
|
| 241 |
<!-- Start of Pragma --> |
| 242 |
<Detect2Chars attribute="Pragma" context="InPragma" char="<" char1="*"/> |
| 243 |
|
| 244 |
<!-- Start of Line Comment --> |
| 245 |
<DetectChar attribute ="Comment" context="LineComment" char="!"/> |
| 246 |
|
| 247 |
<!-- Start of Block Comment --> |
| 248 |
<Detect2Chars attribute="Comment" context="BlockComment" |
| 249 |
char="(" char1="*" beginRegion="FoldableComment"/> |
| 250 |
</context> |
| 251 |
|
| 252 |
<!-- End of Double-Quoted String Literal --> |
| 253 |
<context attribute="String" lineEndContext="#pop" name="DoubleQuotedString"> |
| 254 |
<DetectChar attribute="String" context="#pop" char="""/> |
| 255 |
</context> |
| 256 |
|
| 257 |
<!-- End of Single-Quoted String Literal --> |
| 258 |
<context attribute="String" lineEndContext="#pop" name="SingleQuotedString"> |
| 259 |
<DetectChar attribute="String" context="#pop" char="'" /> |
| 260 |
</context> |
| 261 |
|
| 262 |
<!-- End of Dialect Tag --> |
| 263 |
<context attribute="DialectTag" lineEndContext="#pop" name="InDialectTag"> |
| 264 |
<Detect2Chars attribute="DialectTag" context="#pop" char="*" char1=")"/> |
| 265 |
</context> |
| 266 |
|
| 267 |
<!-- End of Pragma --> |
| 268 |
<context attribute="Pragma" lineEndContext="#stay" name="InPragma"> |
| 269 |
<Detect2Chars attribute="Pragma" context="#pop" char="*" char1=">"/> |
| 270 |
</context> |
| 271 |
|
| 272 |
<!-- End of Line Comment --> |
| 273 |
<context attribute="Comment" lineEndContext="#pop" name="LineComment"> |
| 274 |
<DetectSpaces /> |
| 275 |
<IncludeRules context="##Comments"/> |
| 276 |
</context> |
| 277 |
|
| 278 |
<context attribute="Comment" lineEndContext="#stay" name="BlockComment"> |
| 279 |
<!-- Start of nessted Block Comment --> |
| 280 |
<Detect2Chars attribute="Comment" |
| 281 |
context="BlockComment" char="(" char1="*" beginRegion="FoldableComment"/> |
| 282 |
|
| 283 |
<!-- End of Block Comment --> |
| 284 |
<Detect2Chars attribute="Comment" |
| 285 |
context="#pop" char="*" char1=")" endRegion="FoldableComment"/> |
| 286 |
|
| 287 |
<DetectSpaces /> |
| 288 |
<IncludeRules context="##Comments"/> |
| 289 |
</context> |
| 290 |
</contexts> |
| 291 |
|
| 292 |
<itemDatas> |
| 293 |
<!-- Style for Plain Source Text --> |
| 294 |
<itemData name="Plain Source" |
| 295 |
defStyleNum="dsNormal" bold="0" italic="0" /> |
| 296 |
|
| 297 |
<!-- Style for Reserved Words --> |
| 298 |
<itemData name="Keyword" |
| 299 |
defStyleNum="dsKeyword" bold="1" italic="0" /> |
| 300 |
|
| 301 |
<!-- Style for Built-in Constant Identifiers --> |
| 302 |
<itemData name="Const" |
| 303 |
defStyleNum="dsBuiltIn" bold="1" italic="0" /> |
| 304 |
|
| 305 |
<!-- Style for Built-in Type Identifiers --> |
| 306 |
<itemData name="Type" |
| 307 |
defStyleNum="dsDataType" bold="1" italic="0" /> |
| 308 |
|
| 309 |
<!-- Style for Built-in Procedure Identifiers --> |
| 310 |
<itemData name="Builtin" |
| 311 |
defStyleNum="dsBuiltIn" bold="1" italic="0" /> |
| 312 |
|
| 313 |
<!-- Style for Facilities from Module UNSAFE --> |
| 314 |
<itemData name="Unsafe" |
| 315 |
defStyleNum="dsWarning" bold="1" italic="0" /> |
| 316 |
|
| 317 |
<!-- Style for Number Literals --> |
| 318 |
<itemData name="Number" |
| 319 |
defStyleNum="dsDecVal" bold="0" italic="0" /> |
| 320 |
|
| 321 |
<!-- Style for Quoted Literals --> |
| 322 |
<itemData name="String" |
| 323 |
defStyleNum="dsString" bold="0" italic="0" /> |
| 324 |
|
| 325 |
<!-- Style for Dialect Tags --> |
| 326 |
<itemData name="DialectTag" |
| 327 |
defStyleNum="dsComment" bold="1" italic="0" /> |
| 328 |
|
| 329 |
<!-- Style for Pragmas --> |
| 330 |
<itemData name="Pragma" |
| 331 |
defStyleNum="dsPreprocessor" bold="1" italic="0" /> |
| 332 |
|
| 333 |
<!-- Style for Comments --> |
| 334 |
<itemData name="Comment" |
| 335 |
defStyleNum="dsComment" bold="0" italic="1" /> |
| 336 |
|
| 337 |
<!-- Dummy style for testing --> |
| 338 |
<itemData name="Dummy" defStyleNum="dsError" /> |
| 339 |
</itemDatas> |
| 340 |
</highlighting> |
| 341 |
|
| 342 |
<general> |
| 343 |
<keywords casesensitive="1" /> |
| 344 |
<comments> |
| 345 |
<comment name="singleLine" start="!" /> |
| 346 |
<comment name="multiLine" start="(*" end="*)" region="FoldableComment" /> |
| 347 |
</comments> |
| 348 |
</general> |
| 349 |
</language> |
| 350 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |