7
|
1 " Vim syntax file
|
|
2 " Language: Modsim III, by compuware corporation (www.compuware.com)
|
|
3 " Maintainer: Philipp Jocham <flip@sbox.tu-graz.ac.at>
|
|
4 " Extension: *.mod
|
|
5 " Last Change: 2001 May 10
|
|
6 "
|
|
7 " 2001 March 24:
|
|
8 " - Modsim III is a registered trademark from compuware corporation
|
|
9 " - made compatible with Vim 6.0
|
|
10 "
|
|
11 " 1999 Apr 22 : Changed modsim3Literal from region to match
|
|
12 "
|
|
13 " very basic things only (based on the modula2 and c files).
|
|
14
|
|
15 if version < 600
|
|
16 " Remove any old syntax stuff hanging around
|
|
17 syn clear
|
|
18 elseif exists("b:current_syntax")
|
|
19 finish
|
|
20 endif
|
|
21
|
|
22
|
|
23 " syn case match " case sensitiv match is default
|
|
24
|
|
25 " A bunch of keywords
|
|
26 syn keyword modsim3Keyword ACTID ALL AND AS ASK
|
|
27 syn keyword modsim3Keyword BY CALL CASE CLASS CONST DIV
|
|
28 syn keyword modsim3Keyword DOWNTO DURATION ELSE ELSIF EXIT FALSE FIXED FOR
|
|
29 syn keyword modsim3Keyword FOREACH FORWARD IF IN INHERITED INOUT
|
|
30 syn keyword modsim3Keyword INTERRUPT LOOP
|
|
31 syn keyword modsim3Keyword MOD MONITOR NEWVALUE
|
|
32 syn keyword modsim3Keyword NONMODSIM NOT OBJECT OF ON OR ORIGINAL OTHERWISE OUT
|
|
33 syn keyword modsim3Keyword OVERRIDE PRIVATE PROTO REPEAT
|
|
34 syn keyword modsim3Keyword RETURN REVERSED SELF STRERR TELL
|
|
35 syn keyword modsim3Keyword TERMINATE THISMETHOD TO TRUE TYPE UNTIL VALUE VAR
|
|
36 syn keyword modsim3Keyword WAIT WAITFOR WHEN WHILE WITH
|
|
37
|
|
38 " Builtin functions and procedures
|
|
39 syn keyword modsim3Builtin ABS ACTIVATE ADDMONITOR CAP CHARTOSTR CHR CLONE
|
|
40 syn keyword modsim3Builtin DEACTIVATE DEC DISPOSE FLOAT GETMONITOR HIGH INC
|
|
41 syn keyword modsim3Builtin INPUT INSERT INTTOSTR ISANCESTOR LOW LOWER MAX MAXOF
|
|
42 syn keyword modsim3Builtin MIN MINOF NEW OBJTYPEID OBJTYPENAME OBJVARID ODD
|
|
43 syn keyword modsim3Builtin ONERROR ONEXIT ORD OUTPUT POSITION PRINT REALTOSTR
|
|
44 syn keyword modsim3Builtin REPLACE REMOVEMONITOR ROUND SCHAR SIZEOF SPRINT
|
|
45 syn keyword modsim3Builtin STRLEN STRTOCHAR STRTOINT STRTOREAL SUBSTR TRUNC
|
|
46 syn keyword modsim3Builtin UPDATEVALUE UPPER VAL
|
|
47
|
|
48 syn keyword modsim3BuiltinNoParen HALT TRACE
|
|
49
|
|
50 " Special keywords
|
|
51 syn keyword modsim3Block PROCEDURE METHOD MODULE MAIN DEFINITION IMPLEMENTATION
|
|
52 syn keyword modsim3Block BEGIN END
|
|
53
|
|
54 syn keyword modsim3Include IMPORT FROM
|
|
55
|
|
56 syn keyword modsim3Type ANYARRAY ANYOBJ ANYREC ARRAY BOOLEAN CHAR INTEGER
|
|
57 syn keyword modsim3Type LMONITORED LRMONITORED NILARRAY NILOBJ NILREC REAL
|
|
58 syn keyword modsim3Type RECORD RMONITOR RMONITORED STRING
|
|
59
|
|
60 " catch errros cause by wrong parenthesis
|
|
61 " slight problem with "( *)" or "(* )". Hints?
|
|
62 syn region modsim3Paren transparent start='(' end=')' contains=ALLBUT,modsim3ParenError
|
|
63 syn match modsim3ParenError ")"
|
|
64
|
|
65 " Comments
|
|
66 syn region modsim3Comment1 start="{" end="}" contains=modsim3Comment1,modsim3Comment2
|
|
67 syn region modsim3Comment2 start="(\*" end="\*)" contains=modsim3Comment1,modsim3Comment2
|
|
68 " highlighting is wrong for constructs like "{ (* } *)",
|
|
69 " which are allowed in Modsim III, but
|
|
70 " I think something like that shouldn't be used anyway.
|
|
71
|
|
72 " Strings
|
|
73 syn region modsim3String start=+"+ end=+"+
|
|
74
|
|
75 " Literals
|
|
76 "syn region modsim3Literal start=+'+ end=+'+
|
|
77 syn match modsim3Literal "'[^']'\|''''"
|
|
78
|
|
79 " Define the default highlighting.
|
|
80 " For version 5.7 and earlier: only when not done already
|
|
81 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
82 if version >= 508 || !exists("did_modsim3_syntax_inits")
|
|
83 if version < 508
|
|
84 let did_modsim3_syntax_inits = 1
|
|
85 command -nargs=+ HiLink hi link <args>
|
|
86 else
|
|
87 command -nargs=+ HiLink hi def link <args>
|
|
88 endif
|
|
89
|
|
90 " The default methods for highlighting. Can be overridden later
|
|
91 HiLink modsim3Keyword Statement
|
|
92 HiLink modsim3Block Statement
|
|
93 HiLink modsim3Comment1 Comment
|
|
94 HiLink modsim3Comment2 Comment
|
|
95 HiLink modsim3String String
|
|
96 HiLink modsim3Literal Character
|
|
97 HiLink modsim3Include Statement
|
|
98 HiLink modsim3Type Type
|
|
99 HiLink modsim3ParenError Error
|
|
100 HiLink modsim3Builtin Function
|
|
101 HiLink modsim3BuiltinNoParen Function
|
|
102
|
|
103 delcommand HiLink
|
|
104 endif
|
|
105
|
|
106 let b:current_syntax = "modsim3"
|
|
107
|
|
108 " vim: ts=8 sw=2
|
|
109
|