webmacro.vim (3085B)
1 " WebMacro syntax file 2 " Language: WebMacro 3 " Maintainer: Claudio Fleiner <claudio@fleiner.com> 4 " URL: http://www.fleiner.com/vim/syntax/webmacro.vim 5 " Last Change: 2003 May 11 6 7 " webmacro is a nice little language that you should 8 " check out if you use java servlets. 9 " webmacro: http://www.webmacro.org 10 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") 14 " quit when a syntax file was already loaded 15 if exists("b:current_syntax") 16 finish 17 endif 18 let main_syntax = 'webmacro' 19 endif 20 21 22 runtime! syntax/html.vim 23 unlet b:current_syntax 24 25 syn cluster htmlPreProc add=webmacroIf,webmacroUse,webmacroBraces,webmacroParse,webmacroInclude,webmacroSet,webmacroForeach,webmacroComment 26 27 syn match webmacroVariable "\$[a-zA-Z0-9.()]*;\=" 28 syn match webmacroNumber "[-+]\=\d\+[lL]\=" contained 29 syn keyword webmacroBoolean true false contained 30 syn match webmacroSpecial "\\." contained 31 syn region webmacroString contained start=+"+ end=+"+ contains=webmacroSpecial,webmacroVariable 32 syn region webmacroString contained start=+'+ end=+'+ contains=webmacroSpecial,webmacroVariable 33 syn region webmacroList contained matchgroup=Structure start="\[" matchgroup=Structure end="\]" contains=webmacroString,webmacroVariable,webmacroNumber,webmacroBoolean,webmacroList 34 35 syn region webmacroIf start="#if" start="#else" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces 36 syn region webmacroForeach start="#foreach" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces 37 syn match webmacroSet "#set .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList 38 syn match webmacroInclude "#include .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList 39 syn match webmacroParse "#parse .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList 40 syn region webmacroUse matchgroup=PreProc start="#use .*" matchgroup=PreProc end="^-.*" contains=webmacroHash,@HtmlTop 41 syn region webmacroBraces matchgroup=Structure start="{" matchgroup=Structure end="}" contained transparent 42 syn match webmacroBracesError "[{}]" 43 syn match webmacroComment "##.*$" 44 syn match webmacroHash "[#{}\$]" contained 45 46 " Define the default highlighting. 47 " Only when an item doesn't have highlighting yet 48 49 hi def link webmacroComment CommentTitle 50 hi def link webmacroVariable PreProc 51 hi def link webmacroIf webmacroStatement 52 hi def link webmacroForeach webmacroStatement 53 hi def link webmacroSet webmacroStatement 54 hi def link webmacroInclude webmacroStatement 55 hi def link webmacroParse webmacroStatement 56 hi def link webmacroStatement Function 57 hi def link webmacroNumber Number 58 hi def link webmacroBoolean Boolean 59 hi def link webmacroSpecial Special 60 hi def link webmacroString String 61 hi def link webmacroBracesError Error 62 63 let b:current_syntax = "webmacro" 64 65 if main_syntax == 'webmacro' 66 unlet main_syntax 67 endif