blob: 95975251af750339eebe283daaa5fafce0fcf2cc [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" 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
13if !exists("main_syntax")
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020014 " quit when a syntax file was already loaded
15 if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000016 finish
17 endif
18 let main_syntax = 'webmacro'
19endif
20
21
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020022runtime! syntax/html.vim
23unlet b:current_syntax
Bram Moolenaar071d4272004-06-13 20:20:40 +000024
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
Bram Moolenaar63f32602022-06-09 20:45:54 +010037syn match webmacroSet "#set .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
38syn match webmacroInclude "#include .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
39syn match webmacroParse "#parse .*$" contains=webmacroVariable,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
Bram Moolenaar071d4272004-06-13 20:20:40 +000040syn 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.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020047" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000048
Bram Moolenaarf37506f2016-08-31 22:22:10 +020049hi def link webmacroComment CommentTitle
50hi def link webmacroVariable PreProc
51hi def link webmacroIf webmacroStatement
52hi def link webmacroForeach webmacroStatement
53hi def link webmacroSet webmacroStatement
54hi def link webmacroInclude webmacroStatement
55hi def link webmacroParse webmacroStatement
56hi def link webmacroStatement Function
57hi def link webmacroNumber Number
58hi def link webmacroBoolean Boolean
59hi def link webmacroSpecial Special
60hi def link webmacroString String
61hi def link webmacroBracesError Error
Bram Moolenaar071d4272004-06-13 20:20:40 +000062
63let b:current_syntax = "webmacro"
64
65if main_syntax == 'webmacro'
66 unlet main_syntax
67endif