1" Vim syntax file 2" Language: Haste preprocessor files 3" Maintainer: M. Tranchero - [email protected] 4" Credits: some parts have been taken from vhdl, verilog, and C syntax 5" files 6" Version: 0.5 7 8" HASTE 9if exists("b:current_syntax") 10 finish 11endif 12" For version 5.x: Clear all syntax items 13" For version 6.x: Quit when a syntax file was already loaded 14if version < 600 15 syntax clear 16elseif exists("b:current_syntax") 17 finish 18endif 19" Read the C syntax to start with 20if version < 600 21 so <sfile>:p:h/haste.vim 22else 23 runtime! syntax/haste.vim 24 unlet b:current_syntax 25endif 26 27" case is significant 28syn case match 29 30" C pre-processor directives 31syn match hastepreprocVar display "\$[[:alnum:]_]*" 32syn region hastepreprocVar start="\${" end="}" contains=hastepreprocVar 33" 34"syn region hastepreproc start="#\[\s*tg[:alnum:]*" end="]#" contains=hastepreprocVar,hastepreproc,hastepreprocError,@Spell 35syn region hastepreproc start="#\[\s*\(\|tgfor\|tgif\)" end="$" contains=hastepreprocVar,hastepreproc,@Spell 36syn region hastepreproc start="}\s\(else\)\s{" end="$" contains=hastepreprocVar,hastepreproc,@Spell 37syn region hastepreproc start="^\s*#\s*\(ifndef\|ifdef\|else\|endif\)\>" end="$" contains=@hastepreprocGroup,@Spell 38syn region hastepreproc start="\s*##\s*\(define\|undef\)\>" end="$" contains=@hastepreprocGroup,@Spell 39syn match hastepreproc "}\{0,1}\s*]#" 40 41" Define the default highlighting. 42" Only when an item doesn't have highlighting yet 43hi def link hastepreproc Preproc 44hi def link hastepreprocVar Special 45hi def link hastepreprocError Error 46 47let b:current_syntax = "hastepreproc" 48 49" vim: ts=8 50