codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: KixTart 95, Kix2001 Windows script language http://kixtart.org/3" Maintainer: Richard Howarth <rhowarth@sgb.co.uk>4" Last Change: 2003 May 115" URL: http://www.howsoft.demon.co.uk/6 7" KixTart files identified by *.kix extension.8 9" Amendment History:10" 26 April 2001: RMH11" Removed development comments from distro version12" Renamed "Kix*" to "kix*" for consistancy13" Changes made in preperation for VIM version 5.8/6.0014 15" TODO:16" Handle arrays highlighting17" Handle object highlighting18" 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" quit when a syntax file was already loaded23if exists("b:current_syntax")24 finish25endif26 27syn case match28syn keyword kixTODO TODO FIX XXX contained29 30" Case insensitive language.31syn case ignore32 33" Kix statements34syn match kixStatement "?"35syn keyword kixStatement beep big break36syn keyword kixStatement call cd cls color cookie1 copy37syn keyword kixStatement del dim display38syn keyword kixStatement exit39syn keyword kixStatement flushkb40syn keyword kixStatement get gets global go gosub goto41syn keyword kixStatement md42syn keyword kixStatement password play43syn keyword kixStatement quit44syn keyword kixStatement rd return run45syn keyword kixStatement set setl setm settime shell sleep small46syn keyword kixStatement use47 48" Kix200149syn keyword kixStatement debug function endfunction redim50 51" Simple variables52syn match kixNotVar "\$\$\|@@\|%%" transparent contains=NONE53syn match kixLocalVar "\$\w\+"54syn match kixMacro "@\w\+"55syn match kixEnvVar "%\w\+"56 57" Destination labels58syn match kixLabel ":\w\+\>"59 60" Identify strings, trap unterminated strings61syn match kixStringError +".*\|'.*+62syn region kixDoubleString oneline start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=kixLocalVar,kixMacro,kixEnvVar,kixNotVar63syn region kixSingleString oneline start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=kixLocalVar,kixMacro,kixEnvVar,kixNotVar64 65" Operators66syn match kixOperator "+\|-\|\*\|/\|=\|&\||"67syn keyword kixOperator and or68" Kix200169syn match kixOperator "=="70syn keyword kixOperator not71 72" Numeric constants73syn match kixInteger "-\=\<\d\+\>" contains=NONE74syn match kixFloat "-\=\.\d\+\>\|-\=\<\d\+\.\d\+\>" contains=NONE75 76" Hex numeric constants77syn match kixHex "\&\x\+\>" contains=NONE78 79" Other contants80" Kix200181syn keyword kixConstant on off82 83" Comments84syn match kixComment ";.*$" contains=kixTODO85 86" Trap unmatched parenthesis87syn match kixParenCloseError ")"88syn region kixParen oneline transparent start="(" end=")" contains=ALLBUT,kixParenCloseError89 90" Functions (Builtin + UDF)91syn match kixFunction "\w\+("he=e-1,me=e-1 contains=ALL92 93" Trap unmatched brackets94syn match kixBrackCloseError "\]"95syn region kixBrack transparent start="\[" end="\]" contains=ALLBUT,kixBrackCloseError96 97" Clusters for ALLBUT shorthand98syn cluster kixIfBut contains=kixIfError,kixSelectOK,kixDoOK,kixWhileOK,kixForEachOK,kixForNextOK99syn cluster kixSelectBut contains=kixSelectError,kixIfOK,kixDoOK,kixWhileOK,kixForEachOK,kixForNextOK100syn cluster kixDoBut contains=kixDoError,kixSelectOK,kixIfOK,kixWhileOK,kixForEachOK,kixForNextOK101syn cluster kixWhileBut contains=kixWhileError,kixSelectOK,kixIfOK,kixDoOK,kixForEachOK,kixForNextOK102syn cluster kixForEachBut contains=kixForEachError,kixSelectOK,kixIfOK,kixDoOK,kixForNextOK,kixWhileOK103syn cluster kixForNextBut contains=kixForNextError,kixSelectOK,kixIfOK,kixDoOK,kixForEachOK,kixWhileOK104" Condtional construct errors.105syn match kixIfError "\<if\>\|\<else\>\|\<endif\>"106syn match kixIfOK contained "\<if\>\|\<else\>\|\<endif\>"107syn region kixIf transparent matchgroup=kixIfOK start="\<if\>" end="\<endif\>" contains=ALLBUT,@kixIfBut108syn match kixSelectError "\<select\>\|\<case\>\|\<endselect\>"109syn match kixSelectOK contained "\<select\>\|\<case\>\|\<endselect\>"110syn region kixSelect transparent matchgroup=kixSelectOK start="\<select\>" end="\<endselect\>" contains=ALLBUT,@kixSelectBut111 112" Program control constructs.113syn match kixDoError "\<do\>\|\<until\>"114syn match kixDoOK contained "\<do\>\|\<until\>"115syn region kixDo transparent matchgroup=kixDoOK start="\<do\>" end="\<until\>" contains=ALLBUT,@kixDoBut116syn match kixWhileError "\<while\>\|\<loop\>"117syn match kixWhileOK contained "\<while\>\|\<loop\>"118syn region kixWhile transparent matchgroup=kixWhileOK start="\<while\>" end="\<loop\>" contains=ALLBUT,@kixWhileBut119syn match kixForNextError "\<for\>\|\<to\>\|\<step\>\|\<next\>"120syn match kixForNextOK contained "\<for\>\|\<to\>\|\<step\>\|\<next\>"121syn region kixForNext transparent matchgroup=kixForNextOK start="\<for\>" end="\<next\>" contains=ALLBUT,@kixForBut122syn match kixForEachError "\<for each\>\|\<in\>\|\<next\>"123syn match kixForEachOK contained "\<for each\>\|\<in\>\|\<next\>"124syn region kixForEach transparent matchgroup=kixForEachOK start="\<for each\>" end="\<next\>" contains=ALLBUT,@kixForEachBut125 126" Expressions127syn match kixExpression "<\|>\|<=\|>=\|<>"128 129 130" Default highlighting.131" Set default highlight only if it doesn't already have a value.132 133hi def link kixDoubleString String134hi def link kixSingleString String135hi def link kixStatement Statement136hi def link kixRepeat Repeat137hi def link kixComment Comment138hi def link kixBuiltin Function139hi def link kixLocalVar Special140hi def link kixMacro Special141hi def link kixEnvVar Special142hi def link kixLabel Type143hi def link kixFunction Function144hi def link kixInteger Number145hi def link kixHex Number146hi def link kixFloat Number147hi def link kixOperator Operator148hi def link kixExpression Operator149 150hi def link kixParenCloseError Error151hi def link kixBrackCloseError Error152hi def link kixStringError Error153 154hi def link kixWhileError Error155hi def link kixWhileOK Conditional156hi def link kixDoError Error157hi def link kixDoOK Conditional158hi def link kixIfError Error159hi def link kixIfOK Conditional160hi def link kixSelectError Error161hi def link kixSelectOK Conditional162hi def link kixForNextError Error163hi def link kixForNextOK Conditional164hi def link kixForEachError Error165hi def link kixForEachOK Conditional166 167 168let b:current_syntax = "kix"169 170" vim: ts=8 sw=2171 