blob: f08bf3fbf3b2493f459bbdc7774c2a2d1a3e61f9 [file] [log] [blame]
Bram Moolenaarc236c162008-07-13 17:41:49 +00001" Vim syntax file
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
5" files
6" Version: 0.5
7
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02008" quit when a syntax file was already loaded
Bram Moolenaarc236c162008-07-13 17:41:49 +00009if exists("b:current_syntax")
Bram Moolenaarc236c162008-07-13 17:41:49 +000010 finish
11endif
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020012" Read the haste syntax to start with
13runtime! syntax/haste.vim
14unlet b:current_syntax
Bram Moolenaarc236c162008-07-13 17:41:49 +000015
16" case is significant
17syn case match
18
19" C pre-processor directives
20syn match hastepreprocVar display "\$[[:alnum:]_]*"
21syn region hastepreprocVar start="\${" end="}" contains=hastepreprocVar
22"
23"syn region hastepreproc start="#\[\s*tg[:alnum:]*" end="]#" contains=hastepreprocVar,hastepreproc,hastepreprocError,@Spell
24syn region hastepreproc start="#\[\s*\(\|tgfor\|tgif\)" end="$" contains=hastepreprocVar,hastepreproc,@Spell
25syn region hastepreproc start="}\s\(else\)\s{" end="$" contains=hastepreprocVar,hastepreproc,@Spell
26syn region hastepreproc start="^\s*#\s*\(ifndef\|ifdef\|else\|endif\)\>" end="$" contains=@hastepreprocGroup,@Spell
27syn region hastepreproc start="\s*##\s*\(define\|undef\)\>" end="$" contains=@hastepreprocGroup,@Spell
28syn match hastepreproc "}\{0,1}\s*]#"
29
30" Define the default highlighting.
31" Only when an item doesn't have highlighting yet
32hi def link hastepreproc Preproc
33hi def link hastepreprocVar Special
34hi def link hastepreprocError Error
35
36let b:current_syntax = "hastepreproc"
37
38" vim: ts=8