2 " Language: Haste preprocessor files
3 " Maintainer: M. Tranchero - maurizio.tranchero@gmail.com
4 " Credits: some parts have been taken from vhdl, verilog, and C syntax
9 if exists("b:current_syntax")
12 " For version 5.x: Clear all syntax items
13 " For version 6.x: Quit when a syntax file was already loaded
16 elseif exists("b:current_syntax")
19 " Read the C syntax to start with
21 so <sfile>:p:h/haste.vim
23 runtime! syntax/haste.vim
24 unlet b:current_syntax
30 " C pre-processor directives
31 syn match hastepreprocVar display "\$[[:alnum:]_]*"
32 syn region hastepreprocVar start="\${" end="}" contains=hastepreprocVar
34 "syn region hastepreproc start="#\[\s*tg[:alnum:]*" end="]#" contains=hastepreprocVar,hastepreproc,hastepreprocError,@Spell
35 syn region hastepreproc start="#\[\s*\(\|tgfor\|tgif\)" end="$" contains=hastepreprocVar,hastepreproc,@Spell
36 syn region hastepreproc start="}\s\(else\)\s{" end="$" contains=hastepreprocVar,hastepreproc,@Spell
37 syn region hastepreproc start="^\s*#\s*\(ifndef\|ifdef\|else\|endif\)\>" end="$" contains=@hastepreprocGroup,@Spell
38 syn region hastepreproc start="\s*##\s*\(define\|undef\)\>" end="$" contains=@hastepreprocGroup,@Spell
39 syn match hastepreproc "}\{0,1}\s*]#"
41 " Define the default highlighting.
42 " Only when an item doesn't have highlighting yet
43 hi def link hastepreproc Preproc
44 hi def link hastepreprocVar Special
45 hi def link hastepreprocError Error
47 let b:current_syntax = "hastepreproc"