1" WebMacro syntax file 2" Language: WebMacro 3" Maintainer: Claudio Fleiner <[email protected]> 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 13if !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' 19endif 20 21 22runtime! syntax/html.vim 23unlet b:current_syntax 24 25syn cluster htmlPreProc add=webmacroIf,webmacroUse,webmacroBraces,webmacroParse,webmacroInclude,webmacroSet,webmacroForeach,webmacroComment 26 27syn match webmacroVariable "\$[a-zA-Z0-9.()]*;\=" 28syn match webmacroNumber "[-+]\=\d\+[lL]\=" contained 29syn keyword webmacroBoolean true false contained 30syn match webmacroSpecial "\\." contained 31syn region webmacroString contained start=+"+ end=+"+ contains=webmacroSpecial,webmacroVariable 32syn region webmacroString contained start=+'+ end=+'+ contains=webmacroSpecial,webmacroVariable 33syn region webmacroList contained matchgroup=Structure start="\[" matchgroup=Structure end="\]" contains=webmacroString,webmacroVariable,webmacroNumber,webmacroBoolean,webmacroList 34 35syn region webmacroIf start="#if" start="#else" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces 36syn region webmacroForeach start="#foreach" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces 37syn match webmacroSet "#set .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList 38syn match webmacroInclude "#include .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList 39syn match webmacroParse "#parse .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList 40syn region webmacroUse matchgroup=PreProc start="#use .*" matchgroup=PreProc end="^-.*" contains=webmacroHash,@HtmlTop 41syn region webmacroBraces matchgroup=Structure start="{" matchgroup=Structure end="}" contained transparent 42syn match webmacroBracesError "[{}]" 43syn match webmacroComment "##.*$" 44syn match webmacroHash "[#{}\$]" contained 45 46" Define the default highlighting. 47" Only when an item doesn't have highlighting yet 48command -nargs=+ HiLink hi def link <args> 49 50HiLink webmacroComment CommentTitle 51HiLink webmacroVariable PreProc 52HiLink webmacroIf webmacroStatement 53HiLink webmacroForeach webmacroStatement 54HiLink webmacroSet webmacroStatement 55HiLink webmacroInclude webmacroStatement 56HiLink webmacroParse webmacroStatement 57HiLink webmacroStatement Function 58HiLink webmacroNumber Number 59HiLink webmacroBoolean Boolean 60HiLink webmacroSpecial Special 61HiLink webmacroString String 62HiLink webmacroBracesError Error 63delcommand HiLink 64 65let b:current_syntax = "webmacro" 66 67if main_syntax == 'webmacro' 68 unlet main_syntax 69endif 70