Warning, /frameworks/syntax-highlighting/data/syntax/modula-2-pim-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 (PIM only)" mimetype="text/x-modula2" version="4" 0004 kateversion="5.0" section="Sources" priority="4" extensions="*.mod;*.def" 0005 casesensitive="1" author="B. Kowarsch (trijezdci@github)" license="MIT"> 0006 <!-- 0007 ***************************************************************************** 0008 PIM Modula-2 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 The authoritative reference for classic Modula-2 is Niklaus Wirth's monograph 0015 "Programming in Modula-2" published by Springer, Heidelberg, commonly known 0016 as PIM. The most recent edition is the 4th edition, commonly known as PIM4. 0017 0018 In Modula-2 terminology, keywords are called reserved words. A list of 0019 reserved words can be found in PIM4, page 135, at the end of section 3. 0020 0021 There are three kinds of built-in identifiers: (1) standard identifiers, also 0022 called pervasive identifiers or simply pervasives, (2) built-in macros and 0023 (3) identifiers provided by a built-in module called SYSTEM. There is no 0024 terminology for the latter group. 0025 0026 A list of pervasives can be found in PIM4 page 136, at the end of section 4. 0027 Built-in macros NEW and DISPOSE are given in PIM4 at the bottom of page 77. 0028 Procedures ALLOCATE and DEALLOCATE to which macros NEW and DISPOSE resolve 0029 are not given in PIM4 but have been implemented in all of Wirth's Modula-2 0030 compilers, then followed by all other compiler implementations. Although 0031 the implementations of ALLOCATE and DEALLOCATE are library supplied, their 0032 identifiers are hardcoded into the language. For the purpose of syntax 0033 highlighting, they should therefore be treated as built-in identifiers. 0034 Identifiers exported by built-in module SYSTEM are given in PIM4, page 121. 0035 0036 In Modula-2 terminology, there are two kinds of procedures: those that return 0037 a result in their own name, and those that do not. When it is necessary to 0038 differentiate, the former are called function procedures and the latter 0039 proper procedures. For this reason, both function and procedure identifiers 0040 are listed together under a single group "procedures" in this profile. 0041 0042 Some classic Modula-2 compilers implemented additional built-in types, most 0043 notably BYTE, LONGCARD, SHORTCARD and SHORTINT. However, these types are 0044 not part of the classical Modula-2 language definition and consequently 0045 they are not recognised as built-in identifiers in this profile. 0046 ***************************************************************************** 0047 --> 0048 <highlighting> 0049 <list name="workaround"> 0050 <!-- BUG: Kate ignores first entry in context 'Normal' --> 0051 <!-- WORKAROUND: Use the name of this dummy list as first entry --> 0052 <item>???</item> <!-- use '???' in source to test/verify this bug --> 0053 </list> 0054 0055 <!-- Reserved Words --> 0056 <list name="keywords"> 0057 <item>AND</item> 0058 <item>ARRAY</item> 0059 <item>BEGIN</item> 0060 <item>BY</item> 0061 <item>CASE</item> 0062 <item>CONST</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>EXPORT</item> 0071 <item>FOR</item> 0072 <item>FROM</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>NOT</item> 0081 <item>OF</item> 0082 <item>OR</item> 0083 <item>POINTER</item> 0084 <item>PROCEDURE</item> 0085 <item>QUALIFIED</item> 0086 <item>RECORD</item> 0087 <item>REPEAT</item> 0088 <item>RETURN</item> 0089 <item>SET</item> 0090 <item>THEN</item> 0091 <item>TO</item> 0092 <item>TYPE</item> 0093 <item>UNTIL</item> 0094 <item>VAR</item> 0095 <item>WHILE</item> 0096 <item>WITH</item> 0097 </list> 0098 0099 <!-- Built-in Constant Identifiers --> 0100 <list name="constants"> 0101 <item>FALSE</item> 0102 <item>NIL</item> 0103 <item>TRUE</item> 0104 </list> 0105 0106 <!-- Built-in Type Identifiers --> 0107 <list name="types"> 0108 <!-- Pervasives --> 0109 <item>BOOLEAN</item> 0110 <item>BITSET</item> 0111 <item>CARDINAL</item> 0112 <item>CHAR</item> 0113 <item>INTEGER</item> 0114 <item>LONGINT</item> 0115 <item>LONGREAL</item> 0116 <item>PROC</item> 0117 <item>REAL</item> 0118 </list> 0119 0120 <!-- Built-in Procedure Identifiers --> 0121 <list name="procedures"> 0122 <!-- Pervasives --> 0123 <item>ABS</item> 0124 <item>CAP</item> 0125 <item>CHR</item> 0126 <item>DEC</item> 0127 <item>EXCL</item> 0128 <item>FLOAT</item> 0129 <item>HALT</item> 0130 <item>HIGH</item> 0131 <item>INC</item> 0132 <item>INCL</item> 0133 <item>MAX</item> 0134 <item>MIN</item> 0135 <item>ODD</item> 0136 <item>ORD</item> 0137 <item>SIZE</item> 0138 <item>TRUNC</item> 0139 <item>VAL</item> 0140 </list> 0141 0142 <!-- Built-in Macros --> 0143 <list name="macros"> 0144 <!-- NEW resolves to ALLOCATE --> 0145 <item>NEW</item> 0146 <item>ALLOCATE</item> 0147 0148 <!-- DISPOSE resolves to DEALLOCATE --> 0149 <item>DISPOSE</item> 0150 <item>DEALLOCATE</item> 0151 </list> 0152 0153 <!-- Module SYSTEM --> 0154 <list name="unsafe"> 0155 <!-- Module Identifier --> 0156 <item>SYSTEM</item> 0157 0158 <!-- Types --> 0159 <item>ADDRESS</item> 0160 <item>PROCESS</item> 0161 <item>WORD</item> 0162 0163 <!-- Procedures --> 0164 <item>ADR</item> 0165 <item>NEWPROCESS</item> 0166 <item>TRANSFER</item> 0167 <item>TSIZE</item> 0168 </list> 0169 0170 <contexts> 0171 <context attribute="Plain Source" lineEndContext="#stay" name="plain"> 0172 <!-- BUG: first entry is ignored, leave Dummy at first position --> 0173 <keyword attribute="Dummy" context="#stay" String="workaround"/> 0174 0175 <!-- Reserved Words --> 0176 <keyword attribute="Keyword" context="#stay" String="keywords"/> 0177 0178 <!-- Built-in Constant Identifiers --> 0179 <keyword attribute="Const" context="#stay" String="constants"/> 0180 0181 <!-- Built-in Type Identifiers --> 0182 <keyword attribute="Type" context="#stay" String="types"/> 0183 0184 <!-- Built-in Procedure Identifiers --> 0185 <keyword attribute="Builtin" context="#stay" String="procedures"/> 0186 0187 <!-- Built-in Macro Identifiers and Translations --> 0188 <keyword attribute="Builtin" context="#stay" String="macros"/> 0189 0190 <!-- Facilities from Built-in Module SYSTEM --> 0191 <keyword attribute="Unsafe" context="#stay" String="unsafe"/> 0192 0193 <!-- Base-16 Integer Literals --> 0194 <!-- Base-8 Integers and Character Code Literals --> 0195 <RegExpr attribute="Number" context="#stay" String="0[0-9A-F]*H|[0-7]+[BC]"/> 0196 0197 <!-- Real Number Literals --> 0198 <Float attribute="Number" context="#stay"/> 0199 0200 <!-- Decimal Integer Literals --> 0201 <Int attribute="Number" context="#stay"/> 0202 0203 <!-- Start of Double-Quoted String Literal --> 0204 <DetectChar attribute="String" context="DoubleQuotedString" char=""" /> 0205 0206 <!-- Start of Single-Quoted String Literal --> 0207 <DetectChar attribute="String" context="SingleQuotedString" char="'" /> 0208 0209 <!-- Start of Modula-2 Dialect Tag --> 0210 <StringDetect attribute="DialectTag" context="InDialectTag" String="(*!"/> 0211 0212 <!-- Start of Pragma --> 0213 <StringDetect attribute="Pragma" context="InPragma" String="(*$"/> 0214 0215 <!-- Start of Comment --> 0216 <Detect2Chars attribute="Comment" 0217 context="InComment" char="(" char1="*" beginRegion="FoldableComment"/> 0218 </context> 0219 0220 <!-- End of Double-Quoted String Literal --> 0221 <context attribute="String" lineEndContext="#pop" name="DoubleQuotedString"> 0222 <DetectChar attribute="String" context="#pop" char="""/> 0223 </context> 0224 0225 <!-- End of Single-Quoted String Literal --> 0226 <context attribute="String" lineEndContext="#pop" name="SingleQuotedString"> 0227 <DetectChar attribute="String" context="#pop" char="'" /> 0228 </context> 0229 0230 <!-- End of Dialect Tag --> 0231 <context attribute="DialectTag" lineEndContext="#pop" name="InDialectTag"> 0232 <Detect2Chars attribute="DialectTag" context="#pop" char="*" char1=")"/> 0233 </context> 0234 0235 <!-- End of Pragma --> 0236 <context attribute="Pragma" lineEndContext="#stay" name="InPragma"> 0237 <Detect2Chars attribute="Pragma" context="#pop" char="*" char1=")"/> 0238 </context> 0239 0240 <context attribute="Comment" lineEndContext="#stay" name="InComment"> 0241 <!-- Start of nested Comment --> 0242 <Detect2Chars attribute="Comment" 0243 context="InComment" char="(" char1="*" beginRegion="FoldableComment"/> 0244 <!-- End of Comment --> 0245 <Detect2Chars attribute="Comment" 0246 context="#pop" char="*" char1=")" endRegion="FoldableComment"/> 0247 0248 <DetectSpaces /> 0249 <IncludeRules context="##Comments" /> 0250 </context> 0251 </contexts> 0252 0253 <itemDatas> 0254 <!-- Style for Plain Source Text --> 0255 <itemData name="Plain Source" 0256 defStyleNum="dsNormal" bold="0" italic="0" /> 0257 0258 <!-- Style for Reserved Words --> 0259 <itemData name="Keyword" 0260 defStyleNum="dsKeyword" bold="1" italic="0" /> 0261 0262 <!-- Style for Built-in Constant Identifiers --> 0263 <itemData name="Const" 0264 defStyleNum="dsBuiltIn" bold="1" italic="0" /> 0265 0266 <!-- Style for Built-in Type Identifiers --> 0267 <itemData name="Type" 0268 defStyleNum="dsDataType" bold="1" italic="0" /> 0269 0270 <!-- Style for Facilities from Module SYSTEM --> 0271 <itemData name="Unsafe" 0272 defStyleNum="dsWarning" bold="1" italic="0"/> 0273 0274 <!-- Style for Built-in Procedure Identifiers --> 0275 <itemData name="Builtin" 0276 defStyleNum="dsBuiltIn" bold="1" italic="0" /> 0277 0278 <!-- Style for Number Literals --> 0279 <itemData name="Number" 0280 defStyleNum="dsDecVal" bold="0" italic="0" /> 0281 0282 <!-- Style for Quoted Literals --> 0283 <itemData name="String" 0284 defStyleNum="dsString" bold="0" italic="0" /> 0285 0286 <!-- Style for Dialect Tags --> 0287 <itemData name="DialectTag" 0288 defStyleNum="dsComment" bold="1" italic="0" /> 0289 0290 <!-- Style for Pragmas --> 0291 <itemData name="Pragma" 0292 defStyleNum="dsPreprocessor" bold="1" italic="0" /> 0293 0294 <!-- Style for Comments --> 0295 <itemData name="Comment" 0296 defStyleNum="dsComment" bold="0" italic="1" /> 0297 0298 <!-- Dummy style for testing --> 0299 <itemData name="Dummy" defStyleNum="dsError" /> 0300 </itemDatas> 0301 </highlighting> 0302 0303 <general> 0304 <keywords casesensitive="1" /> 0305 <comments> 0306 <comment name="multiLine" start="(*" end="*)" region="FoldableComment" /> 0307 </comments> 0308 </general> 0309 </language> 0310 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->