2 " Language: PPWizard (preprocessor by Dennis Bareis)
3 " Maintainer: Stefan Schwarzer <s.schwarzer@ndh.net>
4 " URL: http://www.ndh.net/home/sschwarzer/download/ppwiz.vim
5 " Last Change: 2003 May 11
8 " Remove old syntax stuff
9 " For version 5.x: Clear all syntax items
10 " For version 6.x: Quit when a syntax file was already loaded
13 elseif exists("b:current_syntax")
19 if !exists("ppwiz_highlight_defs")
20 let ppwiz_highlight_defs = 1
23 if !exists("ppwiz_with_html")
24 let ppwiz_with_html = 1
28 syn match ppwizComment "^;.*$"
29 syn match ppwizComment ";;.*$"
31 if ppwiz_with_html > 0
32 syn region ppwizHTML start="<" end=">" contains=ppwizArg,ppwizMacro
33 syn match ppwizHTML "\&\w\+;"
35 " define, evaluate etc.
36 if ppwiz_highlight_defs == 1
37 syn match ppwizDef "^\s*\#\S\+\s\+\S\+" contains=ALL
38 syn match ppwizDef "^\s*\#\(if\|else\|endif\)" contains=ALL
39 syn match ppwizDef "^\s*\#\({\|break\|continue\|}\)" contains=ALL
40 " elseif ppwiz_highlight_defs == 2
41 " syn region ppwizDef start="^\s*\#" end="[^\\]$" end="^$" keepend contains=ALL
43 syn region ppwizDef start="^\s*\#" end="[^\\]$" end="^$" keepend contains=ppwizCont
45 syn match ppwizError "\s.\\$"
46 syn match ppwizCont "\s\([+\-%]\|\)\\$"
48 syn region ppwizMacro start="<\$" end=">" contains=@ppwizArgVal,ppwizCont
50 syn region ppwizArg start="{" end="}" contains=ppwizEqual,ppwizString
51 syn match ppwizEqual "=" contained
52 syn match ppwizOperator "<>\|=\|<\|>" contained
53 " standard variables (builtin)
54 syn region ppwizStdVar start="<?[^?]" end=">" contains=@ppwizArgVal
56 syn region ppwizRexxVar start="<??" end=">" contains=@ppwizArgVal
58 syn region ppwizString start=+"+ end=+"+ contained contains=ppwizMacro,ppwizArg,ppwizHTML,ppwizCont,ppwizStdVar,ppwizRexxVar
59 syn region ppwizString start=+'+ end=+'+ contained contains=ppwizMacro,ppwizArg,ppwizHTML,ppwizCont,ppwizStdVar,ppwizRexxVar
60 syn match ppwizInteger "\d\+" contained
63 syn cluster ppwizArgVal add=ppwizString,ppwizInteger
65 " Define the default highlighting.
66 " For version 5.7 and earlier: only when not done already
67 " For version 5.8 and later: only when an item doesn't have highlighting yet
68 if version >= 508 || !exists("did_ppwiz_syn_inits")
70 let did_ppwiz_syn_inits = 1
71 command -nargs=+ HiLink hi link <args>
73 command -nargs=+ HiLink hi def link <args>
76 HiLink ppwizSpecial Special
77 HiLink ppwizEqual ppwizSpecial
78 HiLink ppwizOperator ppwizSpecial
79 HiLink ppwizComment Comment
80 HiLink ppwizDef PreProc
81 HiLink ppwizMacro Statement
82 HiLink ppwizArg Identifier
83 HiLink ppwizStdVar Identifier
84 HiLink ppwizRexxVar Identifier
85 HiLink ppwizString Constant
86 HiLink ppwizInteger Constant
87 HiLink ppwizCont ppwizSpecial
88 HiLink ppwizError Error
94 let b:current_syntax = "ppwiz"