/
HTML (Liquid).YAML-tmLanguage
96 lines (89 loc) · 3.19 KB
/
HTML (Liquid).YAML-tmLanguage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# [PackageDev] target_format: plist, ext: tmLanguage
name: HTML (Liquid)
scopeName: text.html.liquid
fileTypes: [liquid]
uuid: f2a39460-98fd-11e1-a8b0-0800200c9a66
patterns:
- name: comment.block.liquid
begin: '{%-?\s*comment\s*-?%}'
end: '{%-?\s*endcomment\s*-?%}'
- name: punctuation.output.liquid
begin: '{{-?'
end: '-?}}'
patterns:
- include: '#template_var'
- name: punctuation.tag.liquid
begin: '{%-?'
end: '-?%}'
patterns:
- include: '#template_tag_name'
- include: '#template_var'
- include: text.html.basic
repository:
assign_op:
patterns:
- name: keyword.operator.assignment.augmented.liquid
match: /=
logic_expression:
patterns:
- match: /=
name: keyword.operator.assignment.augmented.liquid
logic_op:
patterns:
- name: keyword.operator.logical.liquid
match: \s+(and|or|not|contains|(\!\=|\=\=|<\=|>\=|<|>)\s+
template_tag_name:
patterns:
- name: entity.name.tag.liquid
match: (?<={%)\s*(\w+)
- name: entity.name.tag.liquid
match: (?<={%-)\s*(\w+)
template_var:
patterns:
- match: (\[)(\|)(?=[^\]]*)(?=\])
captures:
'2': {name: invalid.illegal.filter.liquid}
'3': {name: invalid.illegal.filter.liquid}
- name: invalid.illegal.filter.liquid
match: (?<=\s)(\+|\-|\/|\*)(?=\s)
- name: constant.language.liquid
match: (false|true|nil)
- match: (?=if|unless|elsif)\s*[^%}]+\s(in)\s
captures:
'3': {name: invalid.illegal.operator.liquid}
- name: keyword.operator.liquid
match: \s+(and|or|not|contains|in|by|((\!|\=|\<|\>)\=))\s+
- match: (?<=assign)([^\=]+)(\=\=+)
captures:
'2': {name: invalid.illegal.assignment.liquid}
- name: support.function.with-args.liquid
match: \|\s+(?![\.0-9])[a-zA-Z0-9_-]+\:\s+
- name: support.function.without-args.liquid
match: \|\s+(?![\.0-9])[a-zA-Z0-9_-]+\s+
- name: keyword.control.liquid
match: (?<=\s)(with|offset\:|limit\:)(?=\s)
- match: (?<=include)(.*)(with\:|offset|limit)(?=\s)
captures:
'2': {name: invalid.illegal.argument.liquid}
- name: invalid.illegal.liquid
match: (?<=\s)(\w+\:)(?=\:\s)
- name: string.quoted.double.liquid
begin: '"'
end: '"'
- name: string.quoted.single.liquid
begin: ''''
end: ''''
- name: constant.numeric.liquid
match: (-|\+)?\s*[0-9]+(\.[0-9]+)?
- name: support.class.liquid
match: \b(collection|product|linklist|linklists|order|link|customer|customer_address|line_item|shop|collections|page_title|template|image|blog|blogs|cart|pages|theme|themes|variant|items|comment|forloop|settings)\b
- name: support.class.liquid
match: \b(assets|author|body|body_raw|current|date|excerpt_raw|meta|next|pages|parent|posts|previous|site|tags|taxonomy|title|url)\b
- name: variable.parameter.liquid
match: ((?<=\w\:\s)\w+)
- name: support.variable.liquid
match: (?<=\.)\w+\b
- name: variable.other.liquid
match: \w+
foldingStartMarker: (?x){%\s*(if|unless|for|paginate|capture|form|case|tablerow|raw|comment)[^(%})]+%}
foldingStopMarker: (?x){%\s*(endif|endunless|endfor|endpaginate|endcapture|endform|endcase|endtablerow|endraw|endcomment)[^(%})]+%}