-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathHandlebars.JSON-tmLanguage
268 lines (260 loc) · 9.14 KB
/
Handlebars.JSON-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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
{
"name": "Handlebars",
"uuid": "1d7c0a8c-2361-4f78-b98e-1eaf2a288d3f",
"scopeName": "text.html.handlebars",
"fileTypes": ["handlebars", "hbs"],
"foldingStartMarker": "(?x)(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\\b.*?>|<!--(?!.*-->)|\\{\\s*($|\\?>\\s*$|//|/\\*(.*\\*/\\s*$|(?!.*?\\*/)))|\\{\\{\\#)",
"foldingStopMarker": "(?x)(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>|^\\s*-->|(^|\\s)\\}|\\{\\{/)",
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" },
{ "include": "#html_tags" }
],
"repository": {
"comments" : {
"patterns": [
{ "name" : "comment.block.handlebars",
"begin" : "\\{\\{!",
"end" : "\\}\\}",
"patterns" : [
{
"name" : "keyword.annotation.handlebars",
"match" : "@\\w*"
},
{ "include": "#comments" }
]
}
]
},
"partial_and_var": {
"name": "meta.function.inline.other.handlebars",
"begin": "(\\{\\{\\{*>*)\\s*([-a-zA-Z_\\./]+)*",
"end": "(\\}\\}\\}*)",
"beginCaptures": {
"1": { "name": "support.constant.handlebars" },
"2": { "name": "variable.parameter.handlebars" }
},
"endCaptures": {
"1": { "name": "support.constant.handlebars" }
},
"patterns": [
{ "include": "#string_single_quoted" },
{ "include": "#string_double_quoted" }
]
},
"block_helper": {
"name": "meta.function.block.start.handlebars",
"begin": "(\\{\\{\\#)([-a-zA-Z_\\./]+)\\s+([-a-zA-Z_\\./]+)*",
"end": "(\\}\\})",
"beginCaptures": {
"1": { "name": "support.constant.handlebars" },
"2": { "name": "support.constant.handlebars" },
"3": { "name": "variable.parameter.handlebars" }
},
"endCaptures": {
"1": { "name": "support.constant.handlebars" }
},
"patterns": [
{ "include": "#string_single_quoted" },
{ "include": "#string_double_quoted" }
]
},
"end_block": {
"name": "meta.function.block.end.handlebars.sproutcore",
"begin": "(\\{\\{/)([a-zA-Z_\\.-]+)\\s*",
"end": "(\\}\\})",
"beginCaptures": {
"1": { "name": "support.constant.handlebars" },
"2": { "name": "support.constant.handlebars" }
},
"endCaptures": {
"1": { "name": "support.constant.handlebars" }
},
"patterns": [
]
},
"string_double_quoted": {
"name": "string.quoted.double.html",
"begin": "\"",
"end": "\"",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.html" }
},
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.html" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" }
]
},
"string_single_quoted": {
"name": "string.quoted.single.html",
"begin": "'",
"end": "'",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.html" }
},
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.html" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" }
]
},
"tag_generic_attribute": {
"name": "entity.other.attribute-name.html",
"match": "\\b([a-zA-Z\\-:]+)",
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" }
]
},
"tag-id-attribute": {
"name": "meta.attribute-with-value.id.html",
"begin": "\\b(id)\\b\\s*(=)",
"end": "(?<=''|\")",
"captures": {
"1": { "name": "entity.other.attribute-name.id.html" },
"2": { "name": "punctuation.separator.key-value.html" }
},
"patterns": [
{ "name": "string.quoted.double.html",
"contentName": "meta.toc-list.id.html",
"begin": "\"",
"end": "\"",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.html" }
},
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.html" }
},
"patterns": [
{ "include": "#partial_and_var" }
]
},
{ "name": "string.quoted.single.html",
"contentName": "meta.toc-list.id.html",
"begin": "'",
"end": "'",
"beginCaptures": {
"0": { "name": "punctuation.definition.string.begin.html" }
},
"endCaptures": {
"0": { "name": "punctuation.definition.string.end.html" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#block_helper" },
{ "include": "#end_block" },
{ "include": "#partial_and_var" }
]
}
]
},
"html_tags": {
"patterns": [
{ "name": "meta.tag.any.html",
"begin": "(<)([a-zA-Z0-9:]++)(?=[^>]*></\\2>)",
"end": "(>)(<)(/)(\\2)(>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.html" }
},
"endCaptures": {
"1": { "name": "punctuation.definition.tag.end.html" },
"2": { "name": "punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html" },
"3": { "name": "punctuation.definition.tag.begin.html" },
"4": { "name": "entity.name.tag.html" },
"5": { "name": "punctuation.definition.tag.end.html" }
},
"patterns": [
{ "include": "#tag_stuff" }
]
},
{ "name": "meta.tag.structure.any.html",
"begin": "(</?)((?i:body|head|html)\\b)",
"end": "(>)",
"captures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.structure.any.html" }
},
"endCaptures": { "1": { "name": "punctuation.definition.tag.end.html" } },
"patterns": [ { "include": "#tag_stuff" } ]
},
{ "name": "meta.tag.block.any.html",
"begin": "(</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\\b)",
"end": "(>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.block.any.html" }
},
"endCaptures": { "1": { "name": "punctuation.definition.tag.end.html" } },
"patterns": [ { "include": "#tag_stuff" } ]
},
{ "name": "meta.tag.inline.any.html",
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
"end": "((?: ?/)?>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.inline.any.html" }
},
"endCaptures": {
"1": { "name": "punctuation.definition.tag.end.html" }
},
"patterns": [ { "include": "#tag_stuff" } ]
},
{ "name": "meta.tag.other.html",
"begin": "(</?)([a-zA-Z0-9:]+)",
"end": "(>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.other.html" }
},
"endCaptures": { "1": { "name": "punctuation.definition.tag.end.html" } },
"patterns": [
{ "include": "#tag_stuff" }
]
},
{ "include": "#entities" },
{ "name": "invalid.illegal.incomplete.html",
"match": "<>"
},
{ "name": "invalid.illegal.bad-angle-bracket.html",
"match": "<"
}
]
},
"entities": {
"patterns": [
{ "name": "constant.character.entity.html",
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
"captures": {
"1": { "name": "punctuation.definition.entity.html" },
"3": { "name": "punctuation.definition.entity.html" }
}
},
{ "name": "invalid.illegal.bad-ampersand.html",
"match": "&"
}
]
},
"tag_stuff": {
"patterns": [
{ "include": "#tag_id_attribute" },
{ "include": "#tag_generic_attribute" },
{ "include": "#string_double_quoted" },
{ "include": "#string_single_quoted" }
]
}
}
}