comparison runtime/syntax/kix.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: KixTart 95, Kix2001 Windows script language http://kixtart.org/
3 " Maintainer: Richard Howarth <rhowarth@sgb.co.uk>
4 " Last Change: 2003 May 11
5 " URL: http://www.howsoft.demon.co.uk/
6
7 " KixTart files identified by *.kix extension.
8
9 " Amendment History:
10 " 26 April 2001: RMH
11 " Removed development comments from distro version
12 " Renamed "Kix*" to "kix*" for consistancy
13 " Changes made in preperation for VIM version 5.8/6.00
14
15 " TODO:
16 " Handle arrays highlighting
17 " Handle object highlighting
18 " The next two may not be possible:
19 " Work out how to error too many "(", i.e. (() should be an error.
20 " Similarly, "if" without "endif" and similar constructs should error.
21
22 " Clear legacy syntax rules for version 5.x, exit if already processed for version 6+
23 if version < 600
24 syn clear
25 elseif exists("b:current_syntax")
26 finish
27 endif
28
29 syn case match
30 syn keyword kixTODO TODO FIX XXX contained
31
32 " Case insensitive language.
33 syn case ignore
34
35 " Kix statements
36 syn match kixStatement "?"
37 syn keyword kixStatement beep big break
38 syn keyword kixStatement call cd cls color cookie1 copy
39 syn keyword kixStatement del dim display
40 syn keyword kixStatement exit
41 syn keyword kixStatement flushkb
42 syn keyword kixStatement get gets global go gosub goto
43 syn keyword kixStatement md
44 syn keyword kixStatement password play
45 syn keyword kixStatement quit
46 syn keyword kixStatement rd return run
47 syn keyword kixStatement set setl setm settime shell sleep small
48 syn keyword kixStatement use
49
50 " Kix2001
51 syn keyword kixStatement debug function endfunction redim
52
53 " Simple variables
54 syn match kixNotVar "\$\$\|@@\|%%" transparent contains=NONE
55 syn match kixLocalVar "\$\w\+"
56 syn match kixMacro "@\w\+"
57 syn match kixEnvVar "%\w\+"
58
59 " Destination labels
60 syn match kixLabel ":\w\+\>"
61
62 " Identify strings, trap unterminated strings
63 syn match kixStringError +".*\|'.*+
64 syn region kixDoubleString oneline start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=kixLocalVar,kixMacro,kixEnvVar,kixNotVar
65 syn region kixSingleString oneline start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=kixLocalVar,kixMacro,kixEnvVar,kixNotVar
66
67 " Operators
68 syn match kixOperator "+\|-\|\*\|/\|=\|&\||"
69 syn keyword kixOperator and or
70 " Kix2001
71 syn match kixOperator "=="
72 syn keyword kixOperator not
73
74 " Numeric constants
75 syn match kixInteger "-\=\<\d\+\>" contains=NONE
76 syn match kixFloat "-\=\.\d\+\>\|-\=\<\d\+\.\d\+\>" contains=NONE
77
78 " Hex numeric constants
79 syn match kixHex "\&\x\+\>" contains=NONE
80
81 " Other contants
82 " Kix2001
83 syn keyword kixConstant on off
84
85 " Comments
86 syn match kixComment ";.*$" contains=kixTODO
87
88 " Trap unmatched parenthesis
89 syn match kixParenCloseError ")"
90 syn region kixParen oneline transparent start="(" end=")" contains=ALLBUT,kixParenCloseError
91
92 " Functions (Builtin + UDF)
93 syn match kixFunction "\w\+("he=e-1,me=e-1 contains=ALL
94
95 " Trap unmatched brackets
96 syn match kixBrackCloseError "\]"
97 syn region kixBrack transparent start="\[" end="\]" contains=ALLBUT,kixBrackCloseError
98
99 " Clusters for ALLBUT shorthand
100 syn cluster kixIfBut contains=kixIfError,kixSelectOK,kixDoOK,kixWhileOK,kixForEachOK,kixForNextOK
101 syn cluster kixSelectBut contains=kixSelectError,kixIfOK,kixDoOK,kixWhileOK,kixForEachOK,kixForNextOK
102 syn cluster kixDoBut contains=kixDoError,kixSelectOK,kixIfOK,kixWhileOK,kixForEachOK,kixForNextOK
103 syn cluster kixWhileBut contains=kixWhileError,kixSelectOK,kixIfOK,kixDoOK,kixForEachOK,kixForNextOK
104 syn cluster kixForEachBut contains=kixForEachError,kixSelectOK,kixIfOK,kixDoOK,kixForNextOK,kixWhileOK
105 syn cluster kixForNextBut contains=kixForNextError,kixSelectOK,kixIfOK,kixDoOK,kixForEachOK,kixWhileOK
106 " Condtional construct errors.
107 syn match kixIfError "\<if\>\|\<else\>\|\<endif\>"
108 syn match kixIfOK contained "\<if\>\|\<else\>\|\<endif\>"
109 syn region kixIf transparent matchgroup=kixIfOK start="\<if\>" end="\<endif\>" contains=ALLBUT,@kixIfBut
110 syn match kixSelectError "\<select\>\|\<case\>\|\<endselect\>"
111 syn match kixSelectOK contained "\<select\>\|\<case\>\|\<endselect\>"
112 syn region kixSelect transparent matchgroup=kixSelectOK start="\<select\>" end="\<endselect\>" contains=ALLBUT,@kixSelectBut
113
114 " Program control constructs.
115 syn match kixDoError "\<do\>\|\<until\>"
116 syn match kixDoOK contained "\<do\>\|\<until\>"
117 syn region kixDo transparent matchgroup=kixDoOK start="\<do\>" end="\<until\>" contains=ALLBUT,@kixDoBut
118 syn match kixWhileError "\<while\>\|\<loop\>"
119 syn match kixWhileOK contained "\<while\>\|\<loop\>"
120 syn region kixWhile transparent matchgroup=kixWhileOK start="\<while\>" end="\<loop\>" contains=ALLBUT,@kixWhileBut
121 syn match kixForNextError "\<for\>\|\<to\>\|\<step\>\|\<next\>"
122 syn match kixForNextOK contained "\<for\>\|\<to\>\|\<step\>\|\<next\>"
123 syn region kixForNext transparent matchgroup=kixForNextOK start="\<for\>" end="\<next\>" contains=ALLBUT,@kixForBut
124 syn match kixForEachError "\<for each\>\|\<in\>\|\<next\>"
125 syn match kixForEachOK contained "\<for each\>\|\<in\>\|\<next\>"
126 syn region kixForEach transparent matchgroup=kixForEachOK start="\<for each\>" end="\<next\>" contains=ALLBUT,@kixForEachBut
127
128 " Expressions
129 syn match kixExpression "<\|>\|<=\|>=\|<>"
130
131
132 " Default highlighting.
133 " Version < 5.8 set default highlight if file not already processed.
134 " Version >= 5.8 set default highlight only if it doesn't already have a value.
135 if version > 508 || !exists("did_kix_syn_inits")
136 if version < 508
137 let did_kix_syn_inits=1
138 command -nargs=+ HiLink hi link <args>
139 else
140 command -nargs=+ HiLink hi def link <args>
141 endif
142
143 HiLink kixDoubleString String
144 HiLink kixSingleString String
145 HiLink kixStatement Statement
146 HiLink kixRepeat Repeat
147 HiLink kixComment Comment
148 HiLink kixBuiltin Function
149 HiLink kixLocalVar Special
150 HiLink kixMacro Special
151 HiLink kixEnvVar Special
152 HiLink kixLabel Type
153 HiLink kixFunction Function
154 HiLink kixInteger Number
155 HiLink kixHex Number
156 HiLink kixFloat Number
157 HiLink kixOperator Operator
158 HiLink kixExpression Operator
159
160 HiLink kixParenCloseError Error
161 HiLink kixBrackCloseError Error
162 HiLink kixStringError Error
163
164 HiLink kixWhileError Error
165 HiLink kixWhileOK Conditional
166 HiLink kixDoError Error
167 HiLink kixDoOK Conditional
168 HiLink kixIfError Error
169 HiLink kixIfOK Conditional
170 HiLink kixSelectError Error
171 HiLink kixSelectOK Conditional
172 HiLink kixForNextError Error
173 HiLink kixForNextOK Conditional
174 HiLink kixForEachError Error
175 HiLink kixForEachOK Conditional
176
177 delcommand HiLink
178 endif
179
180 let b:current_syntax = "kix"
181
182 " vim: ts=8 sw=2