"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/mod2.lang" (12 May 2020, 3036 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "mod2.lang": 3.53_vs_3.54.

    1 
    2 Description="Modula2"
    3 
    4 -- Syntax file created by Benjamin Kowarsch
    5 
    6 
    7 Categories = {"source"}
    8 
    9 
   10 Keywords={
   11   { Id=1,
   12     List={"GENERIC", "AND",  "ARRAY",  "BEGIN",  "BY",  "CASE",  "CONST",
   13         "DEFINITION",  "DIV",  "DO",  "ELSE", "ELSIF",  "END",  "EXCEPT",  "EXIT",
   14         "EXPORT",  "FINALLY",  "FOR",  "FORWARD",  "FROM",  "IF",  "IMPLEMENTATION",
   15         "IMPORT",  "IN",  "LOOP",  "MOD",  "MODULE",  "NOT",  "OF",  "OR",  "PACKEDSET",
   16         "POINTER",  "PROCEDURE", "QUALIFIED",  "RECORD",  "REM",  "REPEAT",  "RETRY",
   17         "RETURN",  "SET",  "THEN",  "TO", "TYPE",  "UNTIL",  "VAR", "WHILE",  "WITH"},
   18   },
   19   { Id=2,
   20     List={"ABS",  "BITSET",  "BOOLEAN",   "CAP",  "CARDINAL",  "CHAR",  "CHR",
   21         "DEC",  "DISPOSE", "EXCL",  "FALSE",  "FLOAT",  "HALT",  "HIGH",  "INC",
   22         "INCL",  "INTEGER",  "LONGCARD", "LONGINT",  "LONGREAL", "MAX",  "MIN",  "NEW",
   23         "NIL",  "ODD", "ORD",  "PROC",  "REAL",  "SIZE",  "TRUE",  "TRUNC",  "TSIZE",
   24         "VAL"},
   25   },
   26 
   27   { Id=3,
   28     Regex=[[(\w+?)\s*\(]],
   29   },
   30 
   31   -- Modula dialect selector
   32   { Id=4,
   33     Regex=[[ \(\*\!m2(r10|iso)\*\) ]], Group=0
   34   },
   35 }
   36 
   37 Strings={
   38   Delimiter=[["|']],
   39 }
   40 
   41 Comments={
   42 
   43   { Block=true,
   44     Nested=false,
   45     Delimiter= { [[\(\*]],[[\*\)]],}
   46   }
   47 }
   48 
   49 IgnoreCase=false
   50 
   51 Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\:|\&|<|>|\!|\=|\/|\*|\%|\+|\-]]
   52 
   53 
   54 function OnStateChange(oldState, newState, token, kwID)
   55 
   56   if newState==HL_KEYWORD and kwID==4 then
   57 
   58     -- ISO additional reserved words
   59     if token=="(*!m2iso*)" then
   60 
   61       AddKeyword("CMPLX", 2)
   62       AddKeyword("COMPLEX", 2)
   63       AddKeyword("IM", 2)
   64       AddKeyword("INT", 2)
   65       AddKeyword("INTERRUPTIBLE", 2)
   66       AddKeyword("LENGTH", 2)
   67       AddKeyword("LFLOAT", 2)
   68       AddKeyword("LONGCOMPLEX", 2)
   69       AddKeyword("PROTECTION", 2)
   70       AddKeyword("RE", 2)
   71       AddKeyword("UNINTERRUBTIBLE", 2)
   72     end
   73 
   74     -- R10 additional reserved words
   75     if token=="(*!m2r10*)" then
   76 
   77       AddKeyword("ENUM", 1)
   78       AddKeyword("IMMUTABLE", 1)
   79       AddKeyword("IS", 1)
   80       AddKeyword("OPAQUE", 1)
   81       AddKeyword("VARIADIC", 1)
   82       AddKeyword("BYCOPY", 1)
   83       AddKeyword("BYREF", 1)
   84       AddKeyword("CLASS", 1)
   85       AddKeyword("CONTINUE", 1)
   86       AddKeyword("CRITICAL", 1)
   87       AddKeyword("INOUT", 1)
   88       AddKeyword("METHOD", 1)
   89       AddKeyword("ON", 1)
   90       AddKeyword("OPTIONAL", 1)
   91       AddKeyword("OUT", 1)
   92       AddKeyword("PRIVATE", 1)
   93       AddKeyword("PROTECTED", 1)
   94       AddKeyword("PROTOCOL", 1)
   95       AddKeyword("PUBLIC", 1)
   96       AddKeyword("SUPER", 1)
   97       AddKeyword("TRY", 1)
   98 
   99       AddKeyword("INRANGE", 2)
  100       AddKeyword("LENGTH", 2)
  101       AddKeyword("OCTET", 2)
  102       AddKeyword("PRED", 2)
  103       AddKeyword("READ", 2)
  104       AddKeyword("SUCC", 2)
  105       AddKeyword("TMAX", 2)
  106       AddKeyword("TMIN", 2)
  107       AddKeyword("WRITE", 2)
  108       AddKeyword("UNICHAR", 2)
  109 
  110       AddKeyword("WRITEF", 2)
  111       AddKeyword("UNICHAR", 2)
  112       AddKeyword("OBJECT", 2)
  113       AddKeyword("YES", 2)
  114       AddKeyword("NO", 2)
  115 
  116   end
  117 
  118   end
  119 
  120   return newState
  121 end