annotate runtime/syntax/mason.vim @ 13705:7dd71a906267

Added tag v8.0.1724 for changeset e7b8c896fa96e91f239ec522e3b7bb885887f53f
author Christian Brabandt <cb@256bit.org>
date Mon, 16 Apr 2018 15:45:07 +0200
parents d91cf2e26ef0
children d1fe80fb35e6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
2 " Language: Mason (Perl embedded in HTML)
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
4 " Homepage: http://github.com/vim-perl/vim-perl/tree/master
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
5 " Bugs/requests: http://github.com/vim-perl/vim-perl/issues
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
6 " Last Change: 2017-09-12
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
7 " Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
8 " Andrew Smith <andrewdsmith@yahoo.com>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 "
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
10 " TODO:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " - Fix <%text> blocks to show HTML tags but ignore Mason tags.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
14 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
15 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " The HTML syntax file included below uses this variable.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 if !exists("main_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 let main_syntax = 'mason'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " First pull in the HTML syntax.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 "
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
27 runtime! syntax/html.vim
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
28 unlet b:current_syntax
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn cluster htmlPreproc add=@masonTop
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " Now pull in the Perl syntax.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 "
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
34 syn include @perlTop syntax/perl.vim
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
35 unlet b:current_syntax
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
36 syn include @podTop syntax/pod.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " It's hard to reduce down to the correct sub-set of Perl to highlight in some
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " of these cases so I've taken the safe option of just using perlTop in all of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " them. If you have any suggestions, please let me know.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 "
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
42 syn region masonPod start="^=[a-z]" end="^=cut" keepend contained contains=@podTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
43 syn cluster perlTop remove=perlBraces
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
44 syn region masonLine matchgroup=Delimiter start="^%" end="$" keepend contains=@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
45 syn region masonPerlComment start="#" end="\%(%>\)\@=\|$" contained contains=perlTodo,@Spell
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
46 syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop,masonPerlComment
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
47 syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
48 syn region masonComp keepend matchgroup=Delimiter start="<&\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
49 syn region masonComp keepend matchgroup=Delimiter skipnl start="<&|\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop nextgroup=masonCompContent
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
50 syn region masonCompContent matchgroup=Delimiter start="" end="</&>" contained contains=@masonTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
52 syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=masonPod,@perlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
54 syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
55 syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
56 syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
57 syn region masonClass matchgroup=Delimiter start="<%class>" end="</%class>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
58 syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=masonPod,@perlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
60 syn region masonDef matchgroup=Delimiter start="<%def\s*[-._/[:alnum:]]\+\s*>" end="</%def>" contains=@htmlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
61 syn region masonMethod matchgroup=Delimiter start="<%method\s*[-._/[:alnum:]]\+\s*>" end="</%method>" contains=@htmlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
63 syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=masonPod,@perlTop
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
64 syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=masonPod,@perlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
66 syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=masonPod,@perlTop
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn region masonDoc matchgroup=Delimiter start="<%doc>" end="</%doc>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn region masonText matchgroup=Delimiter start="<%text>" end="</%text>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs,masonInit,masonCleanup,masonOnce,masonShared,masonDef,masonMethod,masonFlags,masonAttr,masonFilter,masonDoc,masonText
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " Set up default highlighting. Almost all of this is done in the included
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 " syntax files.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
75 hi def link masonDoc Comment
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
76 hi def link masonPod Comment
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
77 hi def link masonPerlComment perlComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 let b:current_syntax = "mason"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 if main_syntax == 'mason'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 endif