xref: /vim-8.2.3635/runtime/syntax/cheetah.vim (revision cf2d8dee)
1" Vim syntax file
2" Language:	Cheetah template engine
3" Maintainer:	Max Ischenko <[email protected]>
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
11" For version 5.x: Clear all syntax items
12" For version 6.x: Quit when a syntax file was already loaded
13if version < 600
14	syntax clear
15elseif exists("b:current_syntax")
16	finish
17endif
18
19syntax case match
20
21syn keyword cheetahKeyword contained if else unless elif for in not
22syn keyword cheetahKeyword contained while repeat break continue pass end
23syn keyword cheetahKeyword contained set del attr def global include raw echo
24syn keyword cheetahKeyword contained import from extends implements
25syn keyword cheetahKeyword contained assert raise try catch finally
26syn keyword cheetahKeyword contained errorCatcher breakpoint silent cache filter
27syn match   cheetahKeyword contained "\<compiler-settings\>"
28
29" Matches cached placeholders
30syn match   cheetahPlaceHolder "$\(\*[0-9.]\+[wdhms]\?\*\|\*\)\?\h\w*\(\.\h\w*\)*" display
31syn match   cheetahPlaceHolder "$\(\*[0-9.]\+[wdhms]\?\*\|\*\)\?{\h\w*\(\.\h\w*\)*}" display
32syn match   cheetahDirective "^\s*#[^#].*$"  contains=cheetahPlaceHolder,cheetahKeyword,cheetahComment display
33
34syn match   cheetahContinuation "\\$"
35syn match   cheetahComment "##.*$" display
36syn region  cheetahMultiLineComment start="#\*" end="\*#"
37
38" Define the default highlighting.
39" For version 5.7 and earlier: only when not done already
40" For version 5.8 and later: only when an item doesn't have highlighting yet
41if version >= 508 || !exists("did_cheetah_syn_inits")
42	if version < 508
43		let did_cheetah_syn_inits = 1
44		command -nargs=+ HiLink hi link <args>
45	else
46		command -nargs=+ HiLink hi def link <args>
47	endif
48
49	HiLink cheetahPlaceHolder Identifier
50	HiLink cheetahDirective PreCondit
51	HiLink cheetahKeyword Define
52	HiLink cheetahContinuation Special
53	HiLink cheetahComment Comment
54	HiLink cheetahMultiLineComment Comment
55
56	delcommand HiLink
57endif
58
59let b:current_syntax = "cheetah"
60
61