annotate runtime/syntax/haml.vim @ 22550:d61c22faf4be

Added tag v8.2.1823 for changeset 5055805908f5c493a05cd62d628f2363a131fac4
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Oct 2020 17:00:04 +0200
parents 5c40013d45ee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
1 " Vim syntax file
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
2 " Language: Haml
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
4 " Filenames: *.haml
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
5 " Last Change: 2019 Dec 05
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
6
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
7 if exists("b:current_syntax")
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
8 finish
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
9 endif
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
10
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
11 if !exists("main_syntax")
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
12 let main_syntax = 'haml'
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
13 endif
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
14 let b:ruby_no_expensive = 1
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
15
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
16 runtime! syntax/html.vim
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
17 unlet! b:current_syntax
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
18 silent! syn include @hamlSassTop syntax/sass.vim
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
19 unlet! b:current_syntax
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
20 syn include @hamlRubyTop syntax/ruby.vim
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
21
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
22 syn case match
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
23
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
24 syn region rubyCurlyBlock start="{" end="}" contains=@hamlRubyTop contained
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
25 syn cluster hamlRubyTop add=rubyCurlyBlock
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
26
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
27 syn cluster hamlComponent contains=hamlAttributes,hamlAttributesHash,hamlClassChar,hamlIdChar,hamlObject,hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
28 syn cluster hamlEmbeddedRuby contains=hamlAttributesHash,hamlObject,hamlRuby,hamlRubyFilter
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
29 syn cluster hamlTop contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,hamlSassFilter,hamlComment,hamlHtmlComment
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
30
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
31 syn match hamlBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=hamlTag,hamlClassChar,hamlIdChar,hamlRuby,hamlPlainChar,hamlInterpolatable
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
32
2415
8f017e31750f Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
33 syn match hamlTag "%\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
34 syn region hamlAttributes matchgroup=hamlAttributesDelimiter start="(" end=")" contained contains=htmlArg,hamlAttributeString,hamlAttributeVariable,htmlEvent,htmlCssDefinition nextgroup=@hamlComponent
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
35 syn region hamlAttributesHash matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
36 syn region hamlObject matchgroup=hamlObjectDelimiter start="\[" end="\]" contained contains=@hamlRubyTop nextgroup=@hamlComponent
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
37 syn match hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
38 syn match hamlSelfCloser "/" contained
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
39 syn match hamlClassChar "\." contained nextgroup=hamlClass
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
40 syn match hamlIdChar "#{\@!" contained nextgroup=hamlId
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
41 syn match hamlClass "\%(\w\|-\|\:\)\+" contained nextgroup=@hamlComponent
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
42 syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
43 syn region hamlDocType start="^\s*!!!" end="$"
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
44
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
45 syn region hamlRuby matchgroup=hamlRubyOutputChar start="[!&]\==\|\~" skip=",\s*$" end="$" contained contains=@hamlRubyTop keepend
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
46 syn region hamlRuby matchgroup=hamlRubyChar start="-" skip=",\s*$" end="$" contained contains=@hamlRubyTop keepend
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
47 syn match hamlPlainChar "\\" contained
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
48 syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="!\===\|!=\@!" end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape,@hamlHtmlTop
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
49 syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="&==\|&=\@!" end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
50 syn region hamlInterpolation matchgroup=hamlInterpolationDelimiter start="#{" end="}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
51 syn match hamlInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
1702
5232b9862f23 updated for version 7.2-000
vimboss
parents: 1668
diff changeset
52 syn region hamlErbInterpolation matchgroup=hamlInterpolationDelimiter start="<%[=-]\=" end="-\=%>" contained contains=@hamlRubyTop
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
53
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
54 syn region hamlAttributeString start=+\%(=\s*\)\@<='+ skip=+\%(\\\\\)*\\'+ end=+'+ contains=hamlInterpolation,hamlInterpolationEscape
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
55 syn region hamlAttributeString start=+\%(=\s*\)\@<="+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=hamlInterpolation,hamlInterpolationEscape
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
56 syn match hamlAttributeVariable "\%(=\s*\)\@<=\%(@@\=\|\$\)\=\w\+" contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
57
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
58 syn match hamlHelper "\<action_view?\|\<block_is_haml?\|\<is_haml?\|\.\@<!\<flatten" contained containedin=@hamlEmbeddedRuby,@hamlRubyTop
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
59 syn keyword hamlHelper capture_haml escape_once find_and_preserve haml_concat haml_indent haml_tag html_attrs html_esape init_haml_helpers list_of non_haml precede preserve succeed surround tab_down tab_up page_class contained containedin=@hamlEmbeddedRuby,@hamlRubyTop
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
60
1702
5232b9862f23 updated for version 7.2-000
vimboss
parents: 1668
diff changeset
61 syn cluster hamlHtmlTop contains=@htmlTop,htmlBold,htmlItalic,htmlUnderline
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
62 syn region hamlPlainFilter matchgroup=hamlFilter start="^\z(\s*\):\%(plain\|preserve\|redcloth\|textile\|markdown\|maruku\)\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlInterpolation
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
63 syn region hamlEscapedFilter matchgroup=hamlFilter start="^\z(\s*\):\%(escaped\|cdata\)\s*$" end="^\%(\z1 \| *$\)\@!" contains=hamlInterpolation
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
64 syn region hamlErbFilter matchgroup=hamlFilter start="^\z(\s*\):erb\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlErbInterpolation
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
65 syn region hamlRubyFilter matchgroup=hamlFilter start="^\z(\s*\):ruby\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlRubyTop
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
66 syn region hamlJavascriptFilter matchgroup=hamlFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlJavaScript,hamlInterpolation keepend
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2415
diff changeset
67 syn region hamlCSSFilter matchgroup=hamlFilter start="^\z(\s*\):css\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,hamlInterpolation keepend
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
68 syn region hamlSassFilter matchgroup=hamlFilter start="^\z(\s*\):sass\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
69
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 2526
diff changeset
70 syn region hamlJavascriptBlock start="^\z(\s*\)%script\%((type=[\"']text/javascript[\"'])\)\=\s*$" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlJavaScript keepend
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
71 syn region hamlCssBlock start="^\z(\s*\)%style" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlCss keepend
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
72 syn match hamlError "\$" contained
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
73
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
74 syn region hamlComment start="^\z(\s*\)-#" end="^\%(\z1 \| *$\)\@!" contains=rubyTodo
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
75 syn region hamlHtmlComment start="^\z(\s*\)/" end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,rubyTodo
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
76 syn match hamlIEConditional "\%(^\s*/\)\@<=\[if\>[^]]*]" contained containedin=hamlHtmlComment
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
77
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
78 hi def link hamlSelfCloser Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
79 hi def link hamlDespacer Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
80 hi def link hamlClassChar Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
81 hi def link hamlIdChar Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
82 hi def link hamlTag Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
83 hi def link hamlClass Type
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
84 hi def link hamlId Identifier
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
85 hi def link hamlPlainChar Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
86 hi def link hamlInterpolatableChar hamlRubyChar
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
87 hi def link hamlRubyOutputChar hamlRubyChar
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
88 hi def link hamlRubyChar Special
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
89 hi def link hamlInterpolationDelimiter Delimiter
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
90 hi def link hamlInterpolationEscape Special
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
91 hi def link hamlAttributeString String
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
92 hi def link hamlAttributeVariable Identifier
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
93 hi def link hamlDocType PreProc
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
94 hi def link hamlFilter PreProc
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
95 hi def link hamlAttributesDelimiter Delimiter
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
96 hi def link hamlObjectDelimiter Delimiter
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
97 hi def link hamlHelper Function
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
98 hi def link hamlHtmlComment hamlComment
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
99 hi def link hamlComment Comment
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
100 hi def link hamlIEConditional SpecialComment
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
101 hi def link hamlError Error
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
102
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
103 let b:current_syntax = "haml"
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
104
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
105 if main_syntax == "haml"
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
106 unlet main_syntax
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
107 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1702
diff changeset
108
1668
0b796e045c42 updated for version 7.2b-000
vimboss
parents:
diff changeset
109 " vim:set sw=2: