blob: 2c32f537d80200c4958b29c5fa68afcd9a6a12a6 [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
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.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020047" Only when an item doesn't have highlighting yet
48command -nargs=+ HiLink hi def link <args>
Bram Moolenaar071d4272004-06-13 20:20:40 +000049
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020050HiLink 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000064
65let b:current_syntax = "webmacro"
66
67if main_syntax == 'webmacro'
68 unlet main_syntax
69endif