comparison runtime/syntax/chill.vim @ 7:3fc0f57ecb91 v7.0001

updated for version 7.0001
author vimboss
date Sun, 13 Jun 2004 20:20:40 +0000
parents
children 43efa4f5a8ea
comparison
equal deleted inserted replaced
6:c2daee826b8f 7:3fc0f57ecb91
1 " Vim syntax file
2 " Language: CHILL
3 " Maintainer: YoungSang Yoon <image@lgic.co.kr>
4 " Last change: 2004 Jan 21
5 "
6
7 " first created by image@lgic.co.kr & modified by paris@lgic.co.kr
8
9 " CHILL (CCITT High Level Programming Language) is used for
10 " developing software of ATM switch at LGIC (LG Information
11 " & Communications LTd.)
12
13
14 " For version 5.x: Clear all syntax items
15 " For version 6.x: Quit when a syntax file was already loaded
16 if version < 600
17 syntax clear
18 elseif exists("b:current_syntax")
19 finish
20 endif
21
22 " A bunch of useful CHILL keywords
23 syn keyword chillStatement goto GOTO return RETURN returns RETURNS
24 syn keyword chillLabel CASE case ESAC esac
25 syn keyword chillConditional if IF else ELSE elsif ELSIF switch SWITCH THEN then FI fi
26 syn keyword chillLogical NOT not
27 syn keyword chillRepeat while WHILE for FOR do DO od OD TO to
28 syn keyword chillProcess START start STACKSIZE stacksize PRIORITY priority THIS this STOP stop
29 syn keyword chillBlock PROC proc PROCESS process
30 syn keyword chillSignal RECEIVE receive SEND send NONPERSISTENT nonpersistent PERSISTENT peristent SET set EVER ever
31
32 syn keyword chillTodo contained TODO FIXME XXX
33
34 " String and Character constants
35 " Highlight special characters (those which have a backslash) differently
36 syn match chillSpecial contained "\\x\x\+\|\\\o\{1,3\}\|\\.\|\\$"
37 syn region chillString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=chillSpecial
38 syn match chillCharacter "'[^\\]'"
39 syn match chillSpecialCharacter "'\\.'"
40 syn match chillSpecialCharacter "'\\\o\{1,3\}'"
41
42 "when wanted, highlight trailing white space
43 if exists("chill_space_errors")
44 syn match chillSpaceError "\s*$"
45 syn match chillSpaceError " \+\t"me=e-1
46 endif
47
48 "catch errors caused by wrong parenthesis
49 syn cluster chillParenGroup contains=chillParenError,chillIncluded,chillSpecial,chillTodo,chillUserCont,chillUserLabel,chillBitField
50 syn region chillParen transparent start='(' end=')' contains=ALLBUT,@chillParenGroup
51 syn match chillParenError ")"
52 syn match chillInParen contained "[{}]"
53
54 "integer number, or floating point number without a dot and with "f".
55 syn case ignore
56 syn match chillNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
57 "floating point number, with dot, optional exponent
58 syn match chillFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
59 "floating point number, starting with a dot, optional exponent
60 syn match chillFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
61 "floating point number, without dot, with exponent
62 syn match chillFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
63 "hex number
64 syn match chillNumber "\<0x\x\+\(u\=l\=\|lu\)\>"
65 "syn match chillIdentifier "\<[a-z_][a-z0-9_]*\>"
66 syn case match
67 " flag an octal number with wrong digits
68 syn match chillOctalError "\<0\o*[89]"
69
70 if exists("chill_comment_strings")
71 " A comment can contain chillString, chillCharacter and chillNumber.
72 " But a "*/" inside a chillString in a chillComment DOES end the comment! So we
73 " need to use a special type of chillString: chillCommentString, which also ends on
74 " "*/", and sees a "*" at the start of the line as comment again.
75 " Unfortunately this doesn't very well work for // type of comments :-(
76 syntax match chillCommentSkip contained "^\s*\*\($\|\s\+\)"
77 syntax region chillCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=chillSpecial,chillCommentSkip
78 syntax region chillComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=chillSpecial
79 syntax region chillComment start="/\*" end="\*/" contains=chillTodo,chillCommentString,chillCharacter,chillNumber,chillFloat,chillSpaceError
80 syntax match chillComment "//.*" contains=chillTodo,chillComment2String,chillCharacter,chillNumber,chillSpaceError
81 else
82 syn region chillComment start="/\*" end="\*/" contains=chillTodo,chillSpaceError
83 syn match chillComment "//.*" contains=chillTodo,chillSpaceError
84 endif
85 syntax match chillCommentError "\*/"
86
87 syn keyword chillOperator SIZE size
88 syn keyword chillType dcl DCL int INT char CHAR bool BOOL REF ref LOC loc INSTANCE instance
89 syn keyword chillStructure struct STRUCT enum ENUM newmode NEWMODE synmode SYNMODE
90 "syn keyword chillStorageClass
91 syn keyword chillBlock PROC proc END end
92 syn keyword chillScope GRANT grant SEIZE seize
93 syn keyword chillEDML select SELECT delete DELETE update UPDATE in IN seq SEQ WHERE where INSERT insert include INCLUDE exclude EXCLUDE
94 syn keyword chillBoolConst true TRUE false FALSE
95
96 syn region chillPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=chillComment,chillString,chillCharacter,chillNumber,chillCommentError,chillSpaceError
97 syn region chillIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
98 syn match chillIncluded contained "<[^>]*>"
99 syn match chillInclude "^\s*#\s*include\>\s*["<]" contains=chillIncluded
100 "syn match chillLineSkip "\\$"
101 syn cluster chillPreProcGroup contains=chillPreCondit,chillIncluded,chillInclude,chillDefine,chillInParen,chillUserLabel
102 syn region chillDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,@chillPreProcGroup
103 syn region chillPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,@chillPreProcGroup
104
105 " Highlight User Labels
106 syn cluster chillMultiGroup contains=chillIncluded,chillSpecial,chillTodo,chillUserCont,chillUserLabel,chillBitField
107 syn region chillMulti transparent start='?' end=':' contains=ALLBUT,@chillMultiGroup
108 " Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
109 syn match chillUserCont "^\s*\I\i*\s*:$" contains=chillUserLabel
110 syn match chillUserCont ";\s*\I\i*\s*:$" contains=chillUserLabel
111 syn match chillUserCont "^\s*\I\i*\s*:[^:]"me=e-1 contains=chillUserLabel
112 syn match chillUserCont ";\s*\I\i*\s*:[^:]"me=e-1 contains=chillUserLabel
113
114 syn match chillUserLabel "\I\i*" contained
115
116 " Avoid recognizing most bitfields as labels
117 syn match chillBitField "^\s*\I\i*\s*:\s*[1-9]"me=e-1
118 syn match chillBitField ";\s*\I\i*\s*:\s*[1-9]"me=e-1
119
120 syn match chillBracket contained "[<>]"
121 if !exists("chill_minlines")
122 let chill_minlines = 15
123 endif
124 exec "syn sync ccomment chillComment minlines=" . chill_minlines
125
126 " Define the default highlighting.
127 " For version 5.7 and earlier: only when not done already
128 " For version 5.8 and later: only when an item doesn't have highlighting yet
129 if version >= 508 || !exists("did_ch_syntax_inits")
130 if version < 508
131 let did_ch_syntax_inits = 1
132 command -nargs=+ HiLink hi link <args>
133 else
134 command -nargs=+ HiLink hi def link <args>
135 endif
136
137 HiLink chillLabel Label
138 HiLink chillUserLabel Label
139 HiLink chillConditional Conditional
140 " hi chillConditional term=bold ctermfg=red guifg=red gui=bold
141
142 HiLink chillRepeat Repeat
143 HiLink chillProcess Repeat
144 HiLink chillSignal Repeat
145 HiLink chillCharacter Character
146 HiLink chillSpecialCharacter chillSpecial
147 HiLink chillNumber Number
148 HiLink chillFloat Float
149 HiLink chillOctalError chillError
150 HiLink chillParenError chillError
151 HiLink chillInParen chillError
152 HiLink chillCommentError chillError
153 HiLink chillSpaceError chillError
154 HiLink chillOperator Operator
155 HiLink chillStructure Structure
156 HiLink chillBlock Operator
157 HiLink chillScope Operator
158 "hi chillEDML term=underline ctermfg=DarkRed guifg=Red
159 HiLink chillEDML PreProc
160 "hi chillBoolConst term=bold ctermfg=brown guifg=brown
161 HiLink chillBoolConst Constant
162 "hi chillLogical term=bold ctermfg=brown guifg=brown
163 HiLink chillLogical Constant
164 HiLink chillStorageClass StorageClass
165 HiLink chillInclude Include
166 HiLink chillPreProc PreProc
167 HiLink chillDefine Macro
168 HiLink chillIncluded chillString
169 HiLink chillError Error
170 HiLink chillStatement Statement
171 HiLink chillPreCondit PreCondit
172 HiLink chillType Type
173 HiLink chillCommentError chillError
174 HiLink chillCommentString chillString
175 HiLink chillComment2String chillString
176 HiLink chillCommentSkip chillComment
177 HiLink chillString String
178 HiLink chillComment Comment
179 " hi chillComment term=None ctermfg=lightblue guifg=lightblue
180 HiLink chillSpecial SpecialChar
181 HiLink chillTodo Todo
182 HiLink chillBlock Statement
183 "HiLink chillIdentifier Identifier
184 HiLink chillBracket Delimiter
185
186 delcommand HiLink
187 endif
188
189 let b:current_syntax = "chill"
190
191 " vim: ts=8