Warning, /frameworks/syntax-highlighting/data/syntax/modula-2-r10-only.xml is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language>
0003 <language name="Modula-2 (R10 only)" mimetype="text/x-modula2" version="4"
0004 kateversion="5.0" section="Sources" priority="2" extensions="*.mod;*.def"
0005 casesensitive="1" author="B. Kowarsch (trijezdci@github)" license="MIT">
0006 <!--
0007 *****************************************************************************
0008 Modula-2 R10 syntax highlighting profile for Kate
0009
0010 Copyright (C) 2018 Modula-2 Software Foundation
0011
0012 Licensed under the MIT license <https://opensource.org/licenses/MIT>
0013
0014 A reference for the Modula-2 R10 BSK subset is available online at:
0015
0016 https://github.com/m2sf/m2bsk/wiki/Language-Description
0017
0018 In Modula-2 terminology, keywords are called reserved words.
0019
0020 https://github.com/m2sf/m2bsk/wiki/Language-Description#reserved-words.
0021
0022 Additional reserved words are available in the fulls spec for which the
0023 specification is outdated and being revised. The EBNF is available at:
0024
0025 https://github.com/m2sf/M2-R10-Syntax-Diagrams/blob/master/m2r10-grammar.gll
0026
0027 There are two kinds of built-in identifiers:
0028
0029 (1) Predefined identifiers, also known as pervasives are listed at:
0030
0031 https://github.com/m2sf/m2bsk/wiki/Language-Description#predefined-identifiers
0032
0033 (2) Identifiers provided by built-in Module UNSAFE are listed at:
0034
0035 https://github.com/m2sf/m2bsk/wiki/Language-Description#low-level-facilities
0036
0037 In Modula-2 terminology, there are two kinds of procedures: those that return
0038 a result in their own name, and those that do not. When it is necessary to
0039 differentiate, the former are called function procedures and the latter
0040 proper procedures. For this reason, both function and procedure identifiers
0041 are listed together under a single group "procedures" in this profile.
0042 *****************************************************************************
0043 -->
0044 <highlighting>
0045 <list name="workaround">
0046 <!-- BUG: Kate ignores first entry in context 'Normal' -->
0047 <!-- WORKAROUND: Use the name of this dummy list as first entry -->
0048 <item>???</item> <!-- use '???' in source to test/verify this bug -->
0049 </list>
0050
0051 <!-- Reserved Words -->
0052 <list name="keywords">
0053 <item>ALIAS</item>
0054 <item>AND</item>
0055 <item>ARGLIST</item>
0056 <item>ARRAY</item>
0057 <item>BEGIN</item>
0058 <item>BLUEPRINT</item>
0059 <item>BY</item>
0060 <item>CASE</item>
0061 <item>CONST</item>
0062 <item>COPY</item>
0063 <item>DEFINITION</item>
0064 <item>DIV</item>
0065 <item>DO</item>
0066 <item>ELSE</item>
0067 <item>ELSIF</item>
0068 <item>END</item>
0069 <item>EXIT</item>
0070 <item>FOR</item>
0071 <item>FROM</item>
0072 <item>GENLIB</item>
0073 <item>IF</item>
0074 <item>IMPLEMENTATION</item>
0075 <item>IMPORT</item>
0076 <item>IN</item>
0077 <item>LOOP</item>
0078 <item>MOD</item>
0079 <item>MODULE</item>
0080 <item>NEW</item>
0081 <item>NOT</item>
0082 <item>OF</item>
0083 <item>OPAQUE</item>
0084 <item>OR</item>
0085 <item>POINTER</item>
0086 <item>PROCEDURE</item>
0087 <item>READ</item>
0088 <item>RECORD</item>
0089 <item>REFERENTIAL</item>
0090 <item>RELEASE</item>
0091 <item>REPEAT</item>
0092 <item>RETAIN</item>
0093 <item>RETURN</item>
0094 <item>SET</item>
0095 <item>THEN</item>
0096 <item>TO</item>
0097 <item>TYPE</item>
0098 <item>UNTIL</item>
0099 <item>VAR</item>
0100 <item>WHILE</item>
0101 <item>WRITE</item>
0102 <item>YIELD</item>
0103 </list>
0104
0105 <!-- Built-in Constant Identifiers -->
0106 <list name="constants">
0107 <item>FALSE</item>
0108 <item>NIL</item>
0109 <item>TRUE</item>
0110 </list>
0111
0112 <!-- Built-in Type Identifiers -->
0113 <list name="types">
0114 <!-- Pervasives -->
0115 <item>BOOLEAN</item>
0116 <item>CARDINAL</item>
0117 <item>CHAR</item>
0118 <item>INTEGER</item>
0119 <item>LONGCARD</item>
0120 <item>LONGINT</item>
0121 <item>LONGREAL</item>
0122 <item>OCTET</item>
0123 <item>REAL</item>
0124 <item>UNICHAR</item>
0125 </list>
0126
0127 <!-- Built-in Procedure Identifiers -->
0128 <list name="procedures">
0129 <!-- Pervasives -->
0130 <item>ABS</item>
0131 <item>APPEND</item>
0132 <item>CAPACITY</item>
0133 <item>CHR</item>
0134 <item>COUNT</item>
0135 <item>ENTIER</item>
0136 <item>INSERT</item>
0137 <item>LENGTH</item>
0138 <item>LOG2</item>
0139 <item>MAX</item>
0140 <item>MIN</item>
0141 <item>ODD</item>
0142 <item>ORD</item>
0143 <item>POW2</item>
0144 <item>PRED</item>
0145 <item>PTR</item>
0146 <item>REMOVE</item>
0147 <item>SGN</item>
0148 <item>SUCC</item>
0149 </list>
0150
0151 <!-- Built-in Macros -->
0152 <list name="macros">
0153 <item>TLIMIT</item>
0154 <item>TMAX</item>
0155 <item>TMIN</item>
0156 <item>TSIZE</item>
0157 </list>
0158
0159 <!-- Module UNSAFE -->
0160 <list name="unsafe">
0161 <!-- Reserved Words -->
0162 <item>CAST</item>
0163
0164 <!-- Module Identifier -->
0165 <item>UNSAFE</item>
0166
0167 <!-- Constants -->
0168 <item>BitsPerAddress</item>
0169 <item>BitsPerByte</item>
0170 <item>BytesPerWord</item>
0171 <item>BytesPerLongWord</item>
0172
0173 <!-- Types -->
0174 <item>ADDRESS</item>
0175 <item>BYTE</item>
0176 <item>LONGWORD</item>
0177 <item>OCTETSEQ</item>
0178 <item>WORD</item>
0179
0180 <!-- Procedures -->
0181 <item>ADD</item>
0182 <item>ADR</item>
0183 <item>BIT</item>
0184 <item>BWAND</item>
0185 <item>BWNOT</item>
0186 <item>BWOR</item>
0187 <item>HALT</item>
0188 <item>SETBIT</item>
0189 <item>SHL</item>
0190 <item>SHR</item>
0191 <item>SUB</item>
0192
0193 <!-- Macros -->
0194 <item>NOP</item>
0195 </list>
0196
0197 <contexts>
0198 <context attribute="Plain Source" lineEndContext="#stay" name="plain">
0199 <!-- BUG: first entry is ignored, leave Dummy at first position -->
0200 <keyword attribute="Dummy" context="#stay" String="workaround"/>
0201
0202 <!-- Reserved Words -->
0203 <keyword attribute="Keyword" context="#stay" String="keywords"/>
0204
0205 <!-- Built-in Constant Identifiers -->
0206 <keyword attribute="Const" context="#stay" String="constants"/>
0207
0208 <!-- Built-in Type Identifiers -->
0209 <keyword attribute="Type" context="#stay" String="types"/>
0210
0211 <!-- Built-in Procedure Identifiers -->
0212 <keyword attribute="Builtin" context="#stay" String="procedures"/>
0213
0214 <!-- Built-in Macro Identifiers and Translations -->
0215 <keyword attribute="Builtin" context="#stay" String="macros"/>
0216
0217 <!-- Facilities from Built-in Module UNSAFE -->
0218 <keyword attribute="Unsafe" context="#stay" String="unsafe"/>
0219
0220 <!-- Base-2 Integer Literals -->
0221 <!-- Base-16 Integer and Character Code Literals -->
0222 <RegExpr attribute="Number" context="#stay"
0223 String="0b([01]+('[01]+)?)+|0[ux]([0-9A-F]+('[0-9A-F]+)?)+"/>
0224
0225 <!-- Real Number Literals -->
0226 <Float attribute="Number" context="#stay"/>
0227
0228 <!-- Decimal Integer Literals -->
0229 <RegExpr attribute="Number" context="#stay"
0230 String="([1-9][0-9]*('[0-9]+)*)|0"/>
0231
0232 <!-- Start of Double-Quoted String Literal -->
0233 <DetectChar attribute="String" context="DoubleQuotedString" char="""/>
0234
0235 <!-- Start of Single-Quoted String Literal -->
0236 <DetectChar attribute="String" context="SingleQuotedString" char="'"/>
0237
0238 <!-- Start of Modula-2 Dialect Tag -->
0239 <StringDetect attribute="DialectTag" context="InDialectTag" String="(*!"/>
0240
0241 <!-- Start of Pragma -->
0242 <Detect2Chars attribute="Pragma" context="InPragma" char="<" char1="*"/>
0243
0244 <!-- Start of Line Comment -->
0245 <DetectChar attribute ="Comment" context="LineComment" char="!"/>
0246
0247 <!-- Start of Block Comment -->
0248 <Detect2Chars attribute="Comment" context="BlockComment"
0249 char="(" char1="*" beginRegion="FoldableComment"/>
0250 </context>
0251
0252 <!-- End of Double-Quoted String Literal -->
0253 <context attribute="String" lineEndContext="#pop" name="DoubleQuotedString">
0254 <DetectChar attribute="String" context="#pop" char="""/>
0255 </context>
0256
0257 <!-- End of Single-Quoted String Literal -->
0258 <context attribute="String" lineEndContext="#pop" name="SingleQuotedString">
0259 <DetectChar attribute="String" context="#pop" char="'" />
0260 </context>
0261
0262 <!-- End of Dialect Tag -->
0263 <context attribute="DialectTag" lineEndContext="#pop" name="InDialectTag">
0264 <Detect2Chars attribute="DialectTag" context="#pop" char="*" char1=")"/>
0265 </context>
0266
0267 <!-- End of Pragma -->
0268 <context attribute="Pragma" lineEndContext="#stay" name="InPragma">
0269 <Detect2Chars attribute="Pragma" context="#pop" char="*" char1=">"/>
0270 </context>
0271
0272 <!-- End of Line Comment -->
0273 <context attribute="Comment" lineEndContext="#pop" name="LineComment">
0274 <DetectSpaces />
0275 <IncludeRules context="##Comments"/>
0276 </context>
0277
0278 <context attribute="Comment" lineEndContext="#stay" name="BlockComment">
0279 <!-- Start of nessted Block Comment -->
0280 <Detect2Chars attribute="Comment"
0281 context="BlockComment" char="(" char1="*" beginRegion="FoldableComment"/>
0282
0283 <!-- End of Block Comment -->
0284 <Detect2Chars attribute="Comment"
0285 context="#pop" char="*" char1=")" endRegion="FoldableComment"/>
0286
0287 <DetectSpaces />
0288 <IncludeRules context="##Comments"/>
0289 </context>
0290 </contexts>
0291
0292 <itemDatas>
0293 <!-- Style for Plain Source Text -->
0294 <itemData name="Plain Source"
0295 defStyleNum="dsNormal" bold="0" italic="0" />
0296
0297 <!-- Style for Reserved Words -->
0298 <itemData name="Keyword"
0299 defStyleNum="dsKeyword" bold="1" italic="0" />
0300
0301 <!-- Style for Built-in Constant Identifiers -->
0302 <itemData name="Const"
0303 defStyleNum="dsBuiltIn" bold="1" italic="0" />
0304
0305 <!-- Style for Built-in Type Identifiers -->
0306 <itemData name="Type"
0307 defStyleNum="dsDataType" bold="1" italic="0" />
0308
0309 <!-- Style for Built-in Procedure Identifiers -->
0310 <itemData name="Builtin"
0311 defStyleNum="dsBuiltIn" bold="1" italic="0" />
0312
0313 <!-- Style for Facilities from Module UNSAFE -->
0314 <itemData name="Unsafe"
0315 defStyleNum="dsWarning" bold="1" italic="0" />
0316
0317 <!-- Style for Number Literals -->
0318 <itemData name="Number"
0319 defStyleNum="dsDecVal" bold="0" italic="0" />
0320
0321 <!-- Style for Quoted Literals -->
0322 <itemData name="String"
0323 defStyleNum="dsString" bold="0" italic="0" />
0324
0325 <!-- Style for Dialect Tags -->
0326 <itemData name="DialectTag"
0327 defStyleNum="dsComment" bold="1" italic="0" />
0328
0329 <!-- Style for Pragmas -->
0330 <itemData name="Pragma"
0331 defStyleNum="dsPreprocessor" bold="1" italic="0" />
0332
0333 <!-- Style for Comments -->
0334 <itemData name="Comment"
0335 defStyleNum="dsComment" bold="0" italic="1" />
0336
0337 <!-- Dummy style for testing -->
0338 <itemData name="Dummy" defStyleNum="dsError" />
0339 </itemDatas>
0340 </highlighting>
0341
0342 <general>
0343 <keywords casesensitive="1" />
0344 <comments>
0345 <comment name="singleLine" start="!" />
0346 <comment name="multiLine" start="(*" end="*)" region="FoldableComment" />
0347 </comments>
0348 </general>
0349 </language>
0350 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->