Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: Cheetah template engine |
| 3 | " Maintainer: Max Ischenko <mfi@ukr.net> |
| 4 | " Last Change: 2003-05-11 |
| 5 | " |
| 6 | " Missing features: |
| 7 | " match invalid syntax, like bad variable ref. or unmatched closing tag |
| 8 | " PSP-style tags: <% .. %> (obsoleted feature) |
| 9 | " doc-strings and header comments (rarely used feature) |
| 10 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 11 | " quit when a syntax file was already loaded |
| 12 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 13 | finish |
| 14 | endif |
| 15 | |
| 16 | syntax case match |
| 17 | |
| 18 | syn keyword cheetahKeyword contained if else unless elif for in not |
| 19 | syn keyword cheetahKeyword contained while repeat break continue pass end |
| 20 | syn keyword cheetahKeyword contained set del attr def global include raw echo |
| 21 | syn keyword cheetahKeyword contained import from extends implements |
| 22 | syn keyword cheetahKeyword contained assert raise try catch finally |
| 23 | syn keyword cheetahKeyword contained errorCatcher breakpoint silent cache filter |
| 24 | syn match cheetahKeyword contained "\<compiler-settings\>" |
| 25 | |
| 26 | " Matches cached placeholders |
| 27 | syn match cheetahPlaceHolder "$\(\*[0-9.]\+[wdhms]\?\*\|\*\)\?\h\w*\(\.\h\w*\)*" display |
| 28 | syn match cheetahPlaceHolder "$\(\*[0-9.]\+[wdhms]\?\*\|\*\)\?{\h\w*\(\.\h\w*\)*}" display |
| 29 | syn match cheetahDirective "^\s*#[^#].*$" contains=cheetahPlaceHolder,cheetahKeyword,cheetahComment display |
| 30 | |
| 31 | syn match cheetahContinuation "\\$" |
| 32 | syn match cheetahComment "##.*$" display |
| 33 | syn region cheetahMultiLineComment start="#\*" end="\*#" |
| 34 | |
| 35 | " Define the default highlighting. |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 36 | " Only when an item doesn't have highlighting yet |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 37 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 38 | hi def link cheetahPlaceHolder Identifier |
| 39 | hi def link cheetahDirective PreCondit |
| 40 | hi def link cheetahKeyword Define |
| 41 | hi def link cheetahContinuation Special |
| 42 | hi def link cheetahComment Comment |
| 43 | hi def link cheetahMultiLineComment Comment |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 44 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 45 | |
| 46 | let b:current_syntax = "cheetah" |
| 47 | |