7
|
1 " Vim syntax file
|
|
2 " Language: Modula-3
|
|
3 " Maintainer: Timo Pedersen <dat97tpe@ludat.lth.se>
|
|
4 " Last Change: 2001 May 10
|
|
5
|
|
6 " Basic things only...
|
|
7 " Based on the modula 2 syntax file
|
|
8
|
|
9 " For version 5.x: Clear all syntax items
|
|
10 " For version 6.x: Quit when a syntax file was already loaded
|
|
11 if version < 600
|
|
12 syntax clear
|
|
13 elseif exists("b:current_syntax")
|
|
14 finish
|
|
15 endif
|
|
16
|
|
17 " Modula-3 is case-sensitive
|
|
18 " syn case ignore
|
|
19
|
|
20 " Modula-3 keywords
|
|
21 syn keyword modula3Keyword ABS ADDRES ADR ADRSIZE AND ANY
|
|
22 syn keyword modula3Keyword ARRAY AS BITS BITSIZE BOOLEAN BRANDED BY BYTESIZE
|
|
23 syn keyword modula3Keyword CARDINAL CASE CEILING CHAR CONST DEC DEFINITION
|
|
24 syn keyword modula3Keyword DISPOSE DIV
|
|
25 syn keyword modula3Keyword EVAL EXIT EXCEPT EXCEPTION
|
|
26 syn keyword modula3Keyword EXIT EXPORTS EXTENDED FALSE FINALLY FIRST FLOAT
|
|
27 syn keyword modula3Keyword FLOOR FROM GENERIC IMPORT
|
|
28 syn keyword modula3Keyword IN INC INTEGER ISTYPE LAST LOCK
|
|
29 syn keyword modula3Keyword LONGREAL LOOPHOLE MAX METHOD MIN MOD MUTEX
|
|
30 syn keyword modula3Keyword NARROW NEW NIL NOT NULL NUMBER OF OR ORD RAISE
|
|
31 syn keyword modula3Keyword RAISES READONLY REAL RECORD REF REFANY
|
|
32 syn keyword modula3Keyword RETURN ROOT
|
|
33 syn keyword modula3Keyword ROUND SET SUBARRAY TEXT TRUE TRUNC TRY TYPE
|
|
34 syn keyword modula3Keyword TYPECASE TYPECODE UNSAFE UNTRACED VAL VALUE VAR WITH
|
|
35
|
|
36 " Special keywords, block delimiters etc
|
|
37 syn keyword modula3Block PROCEDURE FUNCTION MODULE INTERFACE REPEAT THEN
|
|
38 syn keyword modula3Block BEGIN END OBJECT METHODS OVERRIDES RECORD REVEAL
|
|
39 syn keyword modula3Block WHILE UNTIL DO TO IF FOR ELSIF ELSE LOOP
|
|
40
|
|
41 " Comments
|
|
42 syn region modula3Comment start="(\*" end="\*)"
|
|
43
|
|
44 " Strings
|
|
45 syn region modula3String start=+"+ end=+"+
|
|
46 syn region modula3String start=+'+ end=+'+
|
|
47
|
|
48 " Define the default highlighting.
|
|
49 " For version 5.7 and earlier: only when not done already
|
|
50 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
51 if version >= 508 || !exists("did_modula3_syntax_inits")
|
|
52 if version < 508
|
|
53 let did_modula3_syntax_inits = 1
|
|
54 command -nargs=+ HiLink hi link <args>
|
|
55 else
|
|
56 command -nargs=+ HiLink hi def link <args>
|
|
57 endif
|
|
58
|
|
59 " The default methods for highlighting. Can be overridden later
|
|
60 HiLink modula3Keyword Statement
|
|
61 HiLink modula3Block PreProc
|
|
62 HiLink modula3Comment Comment
|
|
63 HiLink modula3String String
|
|
64
|
|
65 delcommand HiLink
|
|
66 endif
|
|
67
|
|
68 let b:current_syntax = "modula3"
|
|
69
|
|
70 "I prefer to use this...
|
|
71 "set ai
|
|
72 "vim: ts=8
|