]> git.pld-linux.org Git - packages/vim-syntax-vcl.git/blame - vcl.vim
- add C strings, add synthetic
[packages/vim-syntax-vcl.git] / vcl.vim
CommitLineData
3964de95
ER
1" Vim syntax file
2" Filename: vcl.vim
3" Language: Varnish configuation Language, http://www.varnish-cache.org/
4" Maintainer: Elan Ruusamäe <glen@delfi.ee>
5" Version Info: $Revision$
6" Last Change: $Date$ UTC
7
8" For version 5.x: Clear all syntax items
9" For version 6.x: Quit when a syntax file was already loaded
10if version < 600
11 syntax clear
12elseif exists("b:current_syntax")
13 finish
14endif
15
16syn match vclComment '#.*'
17
18" Code Blocks
19" sub NAME {
20" backend NAME {
21" director NAME FLAGS {
22" acl NAME {
868a0fb9
ER
23"syn region vclCodeBlock start="\s*\<sub\|backend\|director\|acl\>" end="{"he=e-1 contains=vclCodeBlockName,vclFunctionName
24"syn match vclCodeBlockName "\<sub\|backend\|director\|acl\>" contained
3964de95 25"syn match vclFunctionName "\h[[:alnum:]_:]*" contained
868a0fb9
ER
26"syn match vclFunctionName "\h\w*[^:]" contained
27"
28syn keyword vclOperator set call return synthetic deliver include
29
30" C strings
31syn region vclString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=vclSpecial
32syn match vclSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
33syn match vclSpecialError "L\='\\[^'\"?\\abfnrtv]'"
34syn match vclSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
35syn match vclSpecialCharacter display "L\='\\\o\{1,3}'"
36syn match vclSpecialCharacter display "'\\x\x\{1,2}'"
37syn match vclSpecialCharacter display "L'\\x\x\+'"
38
3964de95
ER
39
40" Highlight the C block
41syn include @vclC syntax/c.vim
42unlet b:current_syntax
868a0fb9 43
3964de95
ER
44" Mark block tags itself as comment
45syn region vclCBlock matchgroup=vclComment start=/C{/ end=/}C/ contains=@vclC keepend
46
868a0fb9
ER
47" Synthetic
48syn region vclSynthetic start=/{"/hs=s+2 end=/"}/he=e-2
49
3964de95
ER
50hi link vclCodeBlock Function
51hi link vclComment Comment
52hi link vclStatement Statement
53hi link vclFunctionName Identifier
54hi link vclCodeBlockName Statement
868a0fb9
ER
55hi link vclSpecial SpecialChar
56hi link vclString String
57hi link vclSynthetic vclString
58hi link vclSpecialCharacter vclSpecialSpecial
59hi link vclOperator Operator
60
This page took 0.069136 seconds and 4 git commands to generate.