annotate runtime/syntax/occam.vim @ 100:1f3902f3eb5c v7.0038

updated for version 7.0038
author vimboss
date Fri, 14 Jan 2005 21:53:12 +0000
parents 3fc0f57ecb91
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: occam
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Copyright: Fred Barnes <frmb2@kent.ac.uk>, Mario Schweigler <ms44@kent.ac.uk>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Maintainer: Mario Schweigler <ms44@kent.ac.uk>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Last Change: 24 May 2003
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 "{{{ Settings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " Set shift width for indent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 setlocal shiftwidth=2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " Set the tab key size to two spaces
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 setlocal softtabstop=2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Let tab keys always be expanded to spaces
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 setlocal expandtab
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Dots are valid in occam identifiers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 setlocal iskeyword+=.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 "}}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword occamType BYTE BOOL INT INT16 INT32 INT64 REAL32 REAL64 ANY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn keyword occamType CHAN DATA OF TYPE TIMER INITIAL VAL PORT MOBILE PLACED
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword occamType PROCESSOR PACKED RECORD PROTOCOL SHARED ROUND TRUNC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword occamStructure SEQ PAR IF ALT PRI FORKING PLACE AT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword occamKeyword PROC IS TRUE FALSE SIZE RECURSIVE REC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword occamKeyword RETYPES RESHAPES STEP FROM FOR RESCHEDULE STOP SKIP FORK
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword occamKeyword FUNCTION VALOF RESULT ELSE CLONE CLAIM
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword occamBoolean TRUE FALSE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword occamRepeat WHILE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword occamConditional CASE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn keyword occamConstant MOSTNEG MOSTPOS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match occamBrackets /\[\|\]/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match occamParantheses /(\|)/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword occamOperator AFTER TIMES MINUS PLUS INITIAL REM AND OR XOR NOT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword occamOperator BITAND BITOR BITNOT BYTESIN OFFSETOF
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match occamOperator /::\|:=\|?\|!/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match occamOperator /<\|>\|+\|-\|\*\|\/\|\\\|=\|\~/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match occamOperator /@\|\$\$\|%\|&&\|<&\|&>\|<\]\|\[>\|\^/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match occamSpecialChar /\M**\|*'\|*"\|*#\(\[0-9A-F\]\+\)/ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match occamChar /\M\L\='\[^*\]'/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match occamChar /L'[^']*'/ contains=occamSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match occamTodo /\<todo\>:\=/ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn match occamNote /\<note\>:\=/ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn case match
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn keyword occamNote NOT contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match occamComment /--.*/ contains=occamCommentTitle,occamTodo,occamNote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match occamCommentTitle /--\s*\u\a*\(\s\+\u\a*\)*:/hs=s+2 contained contains=occamTodo,occamNote
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match occamCommentTitle /--\s*KROC-LIBRARY\(\.so\|\.a\)\=\s*$/hs=s+2 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match occamCommentTitle /--\s*\(KROC-OPTIONS:\|RUN-PARAMETERS:\)/hs=s+2 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match occamIdentifier /\<[A-Z.][A-Z.0-9]*\>/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match occamFunction /\<[A-Za-z.][A-Za-z0-9.]*\>/ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn match occamPPIdentifier /##.\{-}\>/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn region occamString start=/"/ skip=/\M*"/ end=/"/ contains=occamSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn region occamCharString start=/'/ end=/'/ contains=occamSpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn match occamNumber /\<\d\+\(\.\d\+\(E\(+\|-\)\d\+\)\=\)\=/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn match occamNumber /-\d\+\(\.\d\+\(E\(+\|-\)\d\+\)\=\)\=/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn match occamNumber /#\(\d\|[A-F]\)\+/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn match occamNumber /-#\(\d\|[A-F]\)\+/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword occamCDString SHARED EXTERNAL DEFINED NOALIAS NOUSAGE NOT contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn keyword occamCDString FILE LINE PROCESS.PRIORITY OCCAM2.5 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword occamCDString USER.DEFINED.OPERATORS INITIAL.DECL MOBILES contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn keyword occamCDString BLOCKING.SYSCALLS VERSION NEED.QUAD.ALIGNMENT contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn keyword occamCDString TARGET.CANONICAL TARGET.CPU TARGET.OS TARGET.VENDOR contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn keyword occamCDString TRUE FALSE AND OR contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn match occamCDString /<\|>\|=\|(\|)/ contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn region occamCDirective start=/#\(USE\|INCLUDE\|PRAGMA\|DEFINE\|UNDEFINE\|UNDEF\|IF\|ELIF\|ELSE\|ENDIF\|WARNING\|ERROR\|RELAX\)\>/ end=/$/ contains=occamString,occamComment,occamCDString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 if version >= 508 || !exists("did_occam_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 let did_occam_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink occamType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink occamKeyword Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 HiLink occamComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 HiLink occamCommentTitle PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 HiLink occamTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 HiLink occamNote Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 HiLink occamString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 HiLink occamCharString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 HiLink occamNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 HiLink occamCDirective PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 HiLink occamCDString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 HiLink occamPPIdentifier PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 HiLink occamBoolean Boolean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 HiLink occamSpecialChar SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 HiLink occamChar Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 HiLink occamStructure Structure
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 HiLink occamIdentifier Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 HiLink occamConstant Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 HiLink occamOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 HiLink occamFunction Ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 HiLink occamRepeat Repeat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 HiLink occamConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 HiLink occamBrackets Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 HiLink occamParantheses Delimiter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 let b:current_syntax = "occam"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126