Mercurial > vim
comparison runtime/syntax/liquid.vim @ 28141:dce918af0c00
Update runtime files
Commit: https://github.com/vim/vim/commit/47c532e2bc55e8a48f7f47e1fae1ed30144f2fa1
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 19 15:18:53 2022 +0000
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 19 Mar 2022 16:30:05 +0100 |
parents | 2eb30f341e8d |
children |
comparison
equal
deleted
inserted
replaced
28140:4511c6ef2893 | 28141:dce918af0c00 |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: Liquid | 2 " Language: Liquid |
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
4 " Filenames: *.liquid | 4 " Filenames: *.liquid |
5 " Last Change: 2013 May 30 | 5 " Last Change: 2022 Mar 15 |
6 | 6 |
7 if exists('b:current_syntax') | 7 if exists('b:current_syntax') |
8 finish | 8 finish |
9 endif | 9 endif |
10 | 10 |
66 let b:liquid_subtype = s:subtype | 66 let b:liquid_subtype = s:subtype |
67 endif | 67 endif |
68 unlet s:subtype | 68 unlet s:subtype |
69 endif | 69 endif |
70 | 70 |
71 syn region liquidStatement matchgroup=liquidDelimiter start="{%" end="%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend | 71 syn region liquidStatement matchgroup=liquidDelimiter start="{%-\=" end="-\=%}" contains=@liquidStatement containedin=ALLBUT,@liquidExempt keepend |
72 syn region liquidExpression matchgroup=liquidDelimiter start="{{" end="}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend | 72 syn region liquidExpression matchgroup=liquidDelimiter start="{{-\=" end="-\=}}" contains=@liquidExpression containedin=ALLBUT,@liquidExempt keepend |
73 syn region liquidComment matchgroup=liquidDelimiter start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend | 73 syn region liquidComment matchgroup=liquidDelimiter start="{%-\=\s*comment\s*-\=%}" end="{%-\=\s*endcomment\s*-\=%}" contains=liquidTodo,@Spell containedin=ALLBUT,@liquidExempt keepend |
74 syn region liquidRaw matchgroup=liquidDelimiter start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend | 74 syn region liquidRaw matchgroup=liquidDelimiter start="{%-\=\s*raw\s*-\=%}" end="{%-\=\s*endraw\s*-\=%}" contains=TOP,@liquidExempt containedin=ALLBUT,@liquidExempt keepend |
75 | 75 |
76 syn cluster liquidExempt contains=liquidStatement,liquidExpression,liquidComment,liquidRaw,@liquidStatement,liquidYamlHead | 76 syn cluster liquidExempt contains=liquidStatement,liquidExpression,liquidComment,liquidRaw,@liquidStatement,liquidYamlHead |
77 syn cluster liquidStatement contains=liquidConditional,liquidRepeat,liquidKeyword,@liquidExpression | 77 syn cluster liquidStatement contains=liquidConditional,liquidRepeat,liquidKeyword,@liquidExpression |
78 syn cluster liquidExpression contains=liquidOperator,liquidString,liquidNumber,liquidFloat,liquidBoolean,liquidNull,liquidEmpty,liquidPipe,liquidForloop | 78 syn cluster liquidExpression contains=liquidOperator,liquidString,liquidNumber,liquidFloat,liquidBoolean,liquidNull,liquidEmpty,liquidPipe,liquidForloop |
79 | 79 |
80 syn keyword liquidKeyword highlight nextgroup=liquidTypeHighlight skipwhite contained | 80 syn keyword liquidKeyword highlight nextgroup=liquidTypeHighlight skipwhite contained |
81 syn keyword liquidKeyword endhighlight contained | 81 syn keyword liquidKeyword endhighlight contained |
82 syn region liquidHighlight start="{%\s*highlight\s\+\w\+\s*%}" end="{% endhighlight %}" keepend | 82 syn region liquidHighlight start="{%-\=\s*highlight\s\+\w\+\s*-\=%}" end="{%-\= endhighlight -\=%}" keepend |
83 | 83 |
84 for s:type in g:liquid_highlight_types | 84 for s:type in g:liquid_highlight_types |
85 exe 'syn match liquidTypeHighlight "\<'.matchstr(s:type,'[^=]*').'\>" contained' | 85 exe 'syn match liquidTypeHighlight "\<'.matchstr(s:type,'[^=]*').'\>" contained' |
86 exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*%}" end="{% endhighlight %}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') | 86 exe 'syn region liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' start="{%-\=\s*highlight\s\+'.matchstr(s:type,'[^=]*').'\s*-\=%}" end="{%-\= endhighlight -\=%}" keepend contains=@liquidHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') |
87 endfor | 87 endfor |
88 unlet! s:type | 88 unlet! s:type |
89 | 89 |
90 syn region liquidString matchgroup=liquidQuote start=+"+ end=+"+ contained | 90 syn region liquidString matchgroup=liquidQuote start=+"+ end=+"+ contained |
91 syn region liquidString matchgroup=liquidQuote start=+'+ end=+'+ contained | 91 syn region liquidString matchgroup=liquidQuote start=+'+ end=+'+ contained |
92 syn match liquidNumber "-\=\<\d\+\>" contained | 92 syn match liquidNumber "-\=\<\d\+\>" contained |
93 syn match liquidFloat "-\=\<\d\+\>\.\.\@!\%(\d\+\>\)\=" contained | 93 syn match liquidFloat "-\=\<\d\+\>\.\.\@!\%(\d\+\>\)\=" contained |
94 syn keyword liquidBoolean true false contained | 94 syn keyword liquidBoolean true false contained |
95 syn keyword liquidNull null nil contained | 95 syn keyword liquidNull null nil blank contained |
96 syn match liquidEmpty "\<empty\>" contained | 96 syn match liquidEmpty "\<empty\>" contained |
97 | 97 |
98 syn keyword liquidOperator and or not contained | 98 syn keyword liquidOperator and or not contained |
99 syn match liquidPipe '|' contained skipwhite nextgroup=liquidFilter | 99 syn match liquidPipe '|' contained skipwhite nextgroup=liquidFilter |
100 | 100 |
101 syn keyword liquidFilter date capitalize downcase upcase first last join sort size strip_html strip_newlines newline_to_br replace replace_first remove remove_first truncate truncatewords prepend append minus plus times divided_by contained | 101 syn keyword liquidFilter date capitalize downcase upcase escape escape_once first last join sort size where uniq strip_html strip_newlines newline_to_br replace replace_first remove remove_first slice split strip truncate truncatewords prepend append url_encode url_decode abs at_most at_least ceil divided_by floor minus plus round times modulo contained |
102 | 102 |
103 syn keyword liquidConditional if elsif else endif unless endunless case when endcase ifchanged endifchanged contained | 103 syn keyword liquidConditional if elsif else endif unless endunless case when endcase ifchanged endifchanged contained |
104 syn keyword liquidRepeat for endfor tablerow endtablerow in contained | 104 syn keyword liquidRepeat for endfor tablerow endtablerow in break continue limit offset reversed contained |
105 syn match liquidRepeat "\%({%\s*\)\@<=empty\>" contained | 105 syn match liquidRepeat "\%({%-\=\s*\)\@<=empty\>" contained |
106 syn keyword liquidKeyword assign cycle include with contained | 106 syn keyword liquidKeyword assign capture endcapture increasement decreasement cycle include with render contained |
107 | 107 |
108 syn keyword liquidForloop forloop nextgroup=liquidForloopDot contained | 108 syn keyword liquidForloop forloop nextgroup=liquidForloopDot contained |
109 syn match liquidForloopDot "\." nextgroup=liquidForloopAttribute contained | 109 syn match liquidForloopDot "\." nextgroup=liquidForloopAttribute contained |
110 syn keyword liquidForloopAttribute length index index0 rindex rindex0 first last contained | 110 syn keyword liquidForloopAttribute length index index0 rindex rindex0 first last contained |
111 | 111 |