xref: /vim-8.2.3635/runtime/syntax/webmacro.vim (revision f37506f6)
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
48
49hi 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
62
63let b:current_syntax = "webmacro"
64
65if main_syntax == 'webmacro'
66  unlet main_syntax
67endif
68