annotate runtime/syntax/kix.vim @ 8050:b1c4aaa35206

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