3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
4 " URL: http://www.fleiner.com/vim/syntax/webmacro.vim
5 " Last Change: 2003 May 11
7 " webmacro is a nice little language that you should
8 " check out if you use java servlets.
9 " webmacro: http://www.webmacro.org
11 " For version 5.x: Clear all syntax items
12 " For version 6.x: Quit when a syntax file was already loaded
13 if !exists("main_syntax")
16 elseif exists("b:current_syntax")
19 let main_syntax = 'webmacro'
24 source <sfile>:p:h/html.vim
26 runtime! syntax/html.vim
27 unlet b:current_syntax
30 syn cluster htmlPreProc add=webmacroIf,webmacroUse,webmacroBraces,webmacroParse,webmacroInclude,webmacroSet,webmacroForeach,webmacroComment
32 syn match webmacroVariable "\$[a-zA-Z0-9.()]*;\="
33 syn match webmacroNumber "[-+]\=\d\+[lL]\=" contained
34 syn keyword webmacroBoolean true false contained
35 syn match webmacroSpecial "\\." contained
36 syn region webmacroString contained start=+"+ end=+"+ contains=webmacroSpecial,webmacroVariable
37 syn region webmacroString contained start=+'+ end=+'+ contains=webmacroSpecial,webmacroVariable
38 syn region webmacroList contained matchgroup=Structure start="\[" matchgroup=Structure end="\]" contains=webmacroString,webmacroVariable,webmacroNumber,webmacroBoolean,webmacroList
40 syn region webmacroIf start="#if" start="#else" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces
41 syn region webmacroForeach start="#foreach" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces
42 syn match webmacroSet "#set .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
43 syn match webmacroInclude "#include .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
44 syn match webmacroParse "#parse .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
45 syn region webmacroUse matchgroup=PreProc start="#use .*" matchgroup=PreProc end="^-.*" contains=webmacroHash,@HtmlTop
46 syn region webmacroBraces matchgroup=Structure start="{" matchgroup=Structure end="}" contained transparent
47 syn match webmacroBracesError "[{}]"
48 syn match webmacroComment "##.*$"
49 syn match webmacroHash "[#{}\$]" contained
51 " Define the default highlighting.
52 " For version 5.7 and earlier: only when not done already
53 " For version 5.8 and later: only when an item doesn't have highlighting yet
54 if version >= 508 || !exists("did_webmacro_syn_inits")
56 let did_webmacro_syn_inits = 1
57 command -nargs=+ HiLink hi link <args>
59 command -nargs=+ HiLink hi def link <args>
62 HiLink webmacroComment CommentTitle
63 HiLink webmacroVariable PreProc
64 HiLink webmacroIf webmacroStatement
65 HiLink webmacroForeach webmacroStatement
66 HiLink webmacroSet webmacroStatement
67 HiLink webmacroInclude webmacroStatement
68 HiLink webmacroParse webmacroStatement
69 HiLink webmacroStatement Function
70 HiLink webmacroNumber Number
71 HiLink webmacroBoolean Boolean
72 HiLink webmacroSpecial Special
73 HiLink webmacroString String
74 HiLink webmacroBracesError Error
78 let b:current_syntax = "webmacro"
80 if main_syntax == 'webmacro'