Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 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 |
| 6 | " Filename: ppwiz.vim |
| 7 | |
| 8 | " Remove old syntax stuff |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 9 | " quit when a syntax file was already loaded |
| 10 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 11 | finish |
| 12 | endif |
| 13 | |
| 14 | syn case ignore |
| 15 | |
| 16 | if !exists("ppwiz_highlight_defs") |
| 17 | let ppwiz_highlight_defs = 1 |
| 18 | endif |
| 19 | |
| 20 | if !exists("ppwiz_with_html") |
| 21 | let ppwiz_with_html = 1 |
| 22 | endif |
| 23 | |
| 24 | " comments |
| 25 | syn match ppwizComment "^;.*$" |
| 26 | syn match ppwizComment ";;.*$" |
| 27 | " HTML |
| 28 | if ppwiz_with_html > 0 |
| 29 | syn region ppwizHTML start="<" end=">" contains=ppwizArg,ppwizMacro |
| 30 | syn match ppwizHTML "\&\w\+;" |
| 31 | endif |
| 32 | " define, evaluate etc. |
| 33 | if ppwiz_highlight_defs == 1 |
| 34 | syn match ppwizDef "^\s*\#\S\+\s\+\S\+" contains=ALL |
| 35 | syn match ppwizDef "^\s*\#\(if\|else\|endif\)" contains=ALL |
| 36 | syn match ppwizDef "^\s*\#\({\|break\|continue\|}\)" contains=ALL |
| 37 | " elseif ppwiz_highlight_defs == 2 |
| 38 | " syn region ppwizDef start="^\s*\#" end="[^\\]$" end="^$" keepend contains=ALL |
| 39 | else |
| 40 | syn region ppwizDef start="^\s*\#" end="[^\\]$" end="^$" keepend contains=ppwizCont |
| 41 | endif |
| 42 | syn match ppwizError "\s.\\$" |
| 43 | syn match ppwizCont "\s\([+\-%]\|\)\\$" |
| 44 | " macros to execute |
| 45 | syn region ppwizMacro start="<\$" end=">" contains=@ppwizArgVal,ppwizCont |
| 46 | " macro arguments |
| 47 | syn region ppwizArg start="{" end="}" contains=ppwizEqual,ppwizString |
| 48 | syn match ppwizEqual "=" contained |
| 49 | syn match ppwizOperator "<>\|=\|<\|>" contained |
| 50 | " standard variables (builtin) |
| 51 | syn region ppwizStdVar start="<?[^?]" end=">" contains=@ppwizArgVal |
| 52 | " Rexx variables |
| 53 | syn region ppwizRexxVar start="<??" end=">" contains=@ppwizArgVal |
| 54 | " Constants |
| 55 | syn region ppwizString start=+"+ end=+"+ contained contains=ppwizMacro,ppwizArg,ppwizHTML,ppwizCont,ppwizStdVar,ppwizRexxVar |
| 56 | syn region ppwizString start=+'+ end=+'+ contained contains=ppwizMacro,ppwizArg,ppwizHTML,ppwizCont,ppwizStdVar,ppwizRexxVar |
| 57 | syn match ppwizInteger "\d\+" contained |
| 58 | |
| 59 | " Clusters |
| 60 | syn cluster ppwizArgVal add=ppwizString,ppwizInteger |
| 61 | |
| 62 | " Define the default highlighting. |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 63 | " Only when an item doesn't have highlighting yet |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 64 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 65 | hi def link ppwizSpecial Special |
| 66 | hi def link ppwizEqual ppwizSpecial |
| 67 | hi def link ppwizOperator ppwizSpecial |
| 68 | hi def link ppwizComment Comment |
| 69 | hi def link ppwizDef PreProc |
| 70 | hi def link ppwizMacro Statement |
| 71 | hi def link ppwizArg Identifier |
| 72 | hi def link ppwizStdVar Identifier |
| 73 | hi def link ppwizRexxVar Identifier |
| 74 | hi def link ppwizString Constant |
| 75 | hi def link ppwizInteger Constant |
| 76 | hi def link ppwizCont ppwizSpecial |
| 77 | hi def link ppwizError Error |
| 78 | hi def link ppwizHTML Type |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 79 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 80 | |
| 81 | let b:current_syntax = "ppwiz" |
| 82 | |
| 83 | " vim: ts=4 |
| 84 | |