coffeehaml 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,425 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "CoffeeHaml",
4
+ "scopeName": "source.coffeehaml",
5
+ "fileTypes": ["chaml", "coffeehaml"],
6
+ "patterns": [
7
+ { "include": "#prologue" },
8
+ { "include": "#comment-haml" },
9
+ { "include": "#comment-html" },
10
+ { "include": "#doctype" },
11
+ { "include": "#element" },
12
+ { "include": "#implicit-div" },
13
+ { "include": "#control-flow" },
14
+ { "include": "#output" },
15
+ { "include": "#filter" },
16
+ { "include": "#text" }
17
+ ],
18
+ "repository": {
19
+
20
+ "prologue": {
21
+ "name": "meta.prologue.coffeehaml",
22
+ "match": "^(import\\b.*|export\\b.*|const\\b.*|let\\b.*|var\\b.*|function\\b.*|class\\b.*|@\\w+.*|type\\b.*|interface\\b.*|enum\\b.*)$",
23
+ "captures": {
24
+ "0": { "patterns": [ { "include": "#coffeescript-expression" } ] }
25
+ }
26
+ },
27
+
28
+ "comment-haml": {
29
+ "name": "comment.line.haml.coffeehaml",
30
+ "match": "^(\\s*)(-#)\\s*(.*)$",
31
+ "captures": {
32
+ "2": { "name": "punctuation.definition.comment.coffeehaml" },
33
+ "3": { "name": "comment.line.haml.coffeehaml" }
34
+ }
35
+ },
36
+
37
+ "comment-html": {
38
+ "name": "comment.block.html.coffeehaml",
39
+ "match": "^(\\s*)(/)\\s*(.*)$",
40
+ "captures": {
41
+ "2": { "name": "punctuation.definition.comment.coffeehaml" },
42
+ "3": { "name": "comment.block.html.coffeehaml" }
43
+ }
44
+ },
45
+
46
+ "doctype": {
47
+ "name": "meta.doctype.coffeehaml",
48
+ "match": "^(\\s*)(!!!)\\s*(.*)$",
49
+ "captures": {
50
+ "2": { "name": "keyword.other.doctype.coffeehaml" },
51
+ "3": { "name": "string.unquoted.coffeehaml" }
52
+ }
53
+ },
54
+
55
+ "element": {
56
+ "name": "meta.tag.coffeehaml",
57
+ "begin": "^(\\s*)(%)([\\w-]+(?:\\:[\\w-]+)*)",
58
+ "beginCaptures": {
59
+ "2": { "name": "punctuation.definition.tag.coffeehaml" },
60
+ "3": { "name": "entity.name.tag.coffeehaml" }
61
+ },
62
+ "end": "$",
63
+ "patterns": [
64
+ { "include": "#self-close" },
65
+ { "include": "#modifiers" },
66
+ { "include": "#attribute-brace" },
67
+ { "include": "#attribute-paren" },
68
+ { "include": "#inline-output" },
69
+ { "include": "#inline-text" }
70
+ ]
71
+ },
72
+
73
+ "implicit-div": {
74
+ "name": "meta.tag.implicit.coffeehaml",
75
+ "begin": "^(\\s*)([.#])([\\w-]+)",
76
+ "beginCaptures": {
77
+ "2": { "name": "punctuation.definition.tag.coffeehaml" }
78
+ },
79
+ "end": "$",
80
+ "patterns": [
81
+ { "include": "#modifiers" },
82
+ { "include": "#attribute-brace" },
83
+ { "include": "#attribute-paren" },
84
+ { "include": "#inline-output" },
85
+ { "include": "#inline-text" }
86
+ ]
87
+ },
88
+
89
+ "self-close": {
90
+ "name": "keyword.operator.self-close.coffeehaml",
91
+ "match": "/(?=\\s|$)"
92
+ },
93
+
94
+ "modifiers": {
95
+ "patterns": [
96
+ {
97
+ "name": "entity.other.attribute-name.class.coffeehaml",
98
+ "match": "\\.([\\w-]+)",
99
+ "captures": { "1": { "name": "entity.other.attribute-name.class.coffeehaml" } }
100
+ },
101
+ {
102
+ "name": "entity.other.attribute-name.id.coffeehaml",
103
+ "match": "#([\\w-]+)",
104
+ "captures": { "1": { "name": "entity.other.attribute-name.id.coffeehaml" } }
105
+ }
106
+ ]
107
+ },
108
+
109
+ "attribute-brace": {
110
+ "name": "meta.attribute.brace.coffeehaml",
111
+ "begin": "\\{",
112
+ "beginCaptures": { "0": { "name": "punctuation.definition.attributes.begin.coffeehaml" } },
113
+ "end": "\\}",
114
+ "endCaptures": { "0": { "name": "punctuation.definition.attributes.end.coffeehaml" } },
115
+ "patterns": [
116
+ { "include": "#attribute-content" }
117
+ ]
118
+ },
119
+
120
+ "attribute-paren": {
121
+ "name": "meta.attribute.paren.coffeehaml",
122
+ "begin": "\\(",
123
+ "beginCaptures": { "0": { "name": "punctuation.definition.attributes.begin.coffeehaml" } },
124
+ "end": "\\)",
125
+ "endCaptures": { "0": { "name": "punctuation.definition.attributes.end.coffeehaml" } },
126
+ "patterns": [
127
+ { "include": "#attribute-content" }
128
+ ]
129
+ },
130
+
131
+ "attribute-content": {
132
+ "patterns": [
133
+ {
134
+ "include": "#spread-jsx"
135
+ },
136
+ {
137
+ "include": "#spread-coffee"
138
+ },
139
+ {
140
+ "include": "#attribute-pair"
141
+ },
142
+ {
143
+ "include": "#attribute-shorthand"
144
+ },
145
+ {
146
+ "include": "#coffeescript-expression"
147
+ }
148
+ ]
149
+ },
150
+
151
+ "spread-jsx": {
152
+ "name": "meta.spread.jsx.coffeehaml",
153
+ "match": "(\\.\\.\\.)\\s*([\\w$]+)",
154
+ "captures": {
155
+ "1": { "name": "keyword.operator.spread.coffeehaml" },
156
+ "2": { "name": "variable.other.spread.coffeehaml" }
157
+ }
158
+ },
159
+
160
+ "spread-coffee": {
161
+ "name": "meta.spread.coffee.coffeehaml",
162
+ "match": "([\\w$]+)(\\.\\.\\.)",
163
+ "captures": {
164
+ "1": { "name": "variable.other.spread.coffeehaml" },
165
+ "2": { "name": "keyword.operator.spread.coffeehaml" }
166
+ }
167
+ },
168
+
169
+ "attribute-pair": {
170
+ "name": "meta.attribute.pair.coffeehaml",
171
+ "match": "([\\w_-]+|\"[^\"]*\"|'[^']*')\\s*(:)(?!:)\\s*",
172
+ "captures": {
173
+ "1": { "name": "entity.other.attribute-name.coffeehaml" },
174
+ "2": { "name": "keyword.operator.assignment.coffeehaml" }
175
+ }
176
+ },
177
+
178
+ "attribute-shorthand": {
179
+ "name": "meta.attribute.shorthand.coffeehaml",
180
+ "match": "(?<=[\\{,])[\\s]*([\\w$]+)(?=[,\\}])",
181
+ "captures": {
182
+ "1": { "name": "variable.other.shorthand.coffeehaml" }
183
+ }
184
+ },
185
+
186
+ "control-flow": {
187
+ "name": "meta.control.coffeehaml",
188
+ "begin": "^(\\s*)(-)\\s*",
189
+ "beginCaptures": {
190
+ "2": { "name": "punctuation.definition.control.coffeehaml" }
191
+ },
192
+ "end": "$",
193
+ "patterns": [
194
+ {
195
+ "name": "keyword.control.conditional.coffeehaml",
196
+ "match": "\\b(if|unless)\\b"
197
+ },
198
+ {
199
+ "name": "keyword.control.loop.coffeehaml",
200
+ "match": "\\b(for|while|do)\\b"
201
+ },
202
+ {
203
+ "name": "keyword.control.flow.coffeehaml",
204
+ "match": "\\b(else|then|when|by|of|in)\\b"
205
+ },
206
+ { "include": "#coffeescript-expression" }
207
+ ]
208
+ },
209
+
210
+ "output": {
211
+ "name": "meta.output.coffeehaml",
212
+ "begin": "^(\\s*)(!=|=)(?!=)(\\s*)",
213
+ "beginCaptures": {
214
+ "2": { "name": "keyword.operator.output.coffeehaml" }
215
+ },
216
+ "end": "$",
217
+ "patterns": [
218
+ { "include": "#coffeescript-expression" }
219
+ ]
220
+ },
221
+
222
+ "inline-output": {
223
+ "name": "meta.output.inline.coffeehaml",
224
+ "begin": "(!=|=)(?!=)\\s*",
225
+ "beginCaptures": {
226
+ "1": { "name": "keyword.operator.output.coffeehaml" }
227
+ },
228
+ "end": "$",
229
+ "patterns": [
230
+ { "include": "#coffeescript-expression" }
231
+ ]
232
+ },
233
+
234
+ "filter": {
235
+ "name": "meta.filter.coffeehaml",
236
+ "begin": "^(\\s*)(:)([\\w-]+)",
237
+ "beginCaptures": {
238
+ "2": { "name": "punctuation.definition.filter.coffeehaml" },
239
+ "3": { "name": "entity.name.filter.coffeehaml" }
240
+ },
241
+ "end": "$",
242
+ "patterns": [
243
+ { "include": "#inline-text" }
244
+ ]
245
+ },
246
+
247
+ "text": {
248
+ "name": "text.plain.coffeehaml",
249
+ "match": "^(\\s*)(\\S.*)$",
250
+ "captures": {
251
+ "2": { "name": "text.plain.coffeehaml" }
252
+ }
253
+ },
254
+
255
+ "inline-text": {
256
+ "patterns": [
257
+ {
258
+ "name": "text.plain.coffeehaml",
259
+ "match": "[^%#\\-=/:!.{}()\\\\s]+"
260
+ }
261
+ ]
262
+ },
263
+
264
+ "coffeescript-expression": {
265
+ "patterns": [
266
+ { "include": "#coffee-string-double" },
267
+ { "include": "#coffee-string-single" },
268
+ { "include": "#coffee-string-template" },
269
+ { "include": "#coffee-string-heredoc" },
270
+ { "include": "#coffee-regex" },
271
+ { "include": "#coffee-function" },
272
+ { "include": "#coffee-interpolation" },
273
+ { "include": "#coffee-number" },
274
+ { "include": "#coffee-boolean" },
275
+ { "include": "#coffee-null" },
276
+ { "include": "#coffee-operator" },
277
+ { "include": "#coffee-comment" },
278
+ { "include": "#coffee-bracket" },
279
+ { "include": "#coffee-splat" },
280
+ { "include": "#coffee-variable" }
281
+ ]
282
+ },
283
+
284
+ "coffee-string-double": {
285
+ "name": "string.quoted.double.coffeehaml",
286
+ "begin": "\"",
287
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.coffeehaml" } },
288
+ "end": "\"",
289
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.coffeehaml" } },
290
+ "patterns": [
291
+ { "include": "#coffee-interpolation" },
292
+ { "name": "constant.character.escape.coffeehaml", "match": "\\\\." }
293
+ ]
294
+ },
295
+
296
+ "coffee-string-single": {
297
+ "name": "string.quoted.single.coffeehaml",
298
+ "begin": "'",
299
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.coffeehaml" } },
300
+ "end": "'",
301
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.coffeehaml" } },
302
+ "patterns": [
303
+ { "name": "constant.character.escape.coffeehaml", "match": "\\\\." }
304
+ ]
305
+ },
306
+
307
+ "coffee-string-template": {
308
+ "name": "string.quoted.template.coffeehaml",
309
+ "begin": "`",
310
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.coffeehaml" } },
311
+ "end": "`",
312
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.coffeehaml" } },
313
+ "patterns": [
314
+ { "include": "#coffee-interpolation" },
315
+ { "name": "constant.character.escape.coffeehaml", "match": "\\\\." }
316
+ ]
317
+ },
318
+
319
+ "coffee-string-heredoc": {
320
+ "name": "string.quoted.heredoc.coffeehaml",
321
+ "begin": "(\"\"\"|''')",
322
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.coffeehaml" } },
323
+ "end": "\\1",
324
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.coffeehaml" } },
325
+ "patterns": [
326
+ { "include": "#coffee-interpolation" }
327
+ ]
328
+ },
329
+
330
+ "coffee-regex": {
331
+ "name": "string.regexp.coffeehaml",
332
+ "begin": "(?<=[=:(\\[,!&|?:;,\\{\\(])\\s*(/{1,3})(?![/*])",
333
+ "beginCaptures": { "2": { "name": "punctuation.definition.string.regexp.begin.coffeehaml" } },
334
+ "end": "\\2[gimuy]*",
335
+ "endCaptures": { "0": { "name": "punctuation.definition.string.regexp.end.coffeehaml" } },
336
+ "patterns": [
337
+ { "name": "constant.character.escape.regexp.coffeehaml", "match": "\\\\." }
338
+ ]
339
+ },
340
+
341
+ "coffee-function": {
342
+ "name": "meta.function.arrow.coffeehaml",
343
+ "match": "(->|=>)|\\b(function)\\b",
344
+ "captures": {
345
+ "1": { "name": "storage.type.function.arrow.coffeehaml" },
346
+ "2": { "name": "storage.type.function.coffeehaml" }
347
+ }
348
+ },
349
+
350
+ "coffee-interpolation": {
351
+ "name": "meta.embedded.interpolation.coffeehaml",
352
+ "begin": "#\\{",
353
+ "beginCaptures": { "0": { "name": "punctuation.definition.interpolation.begin.coffeehaml" } },
354
+ "end": "\\}",
355
+ "endCaptures": { "0": { "name": "punctuation.definition.interpolation.end.coffeehaml" } },
356
+ "patterns": [
357
+ { "include": "#coffeescript-expression" }
358
+ ]
359
+ },
360
+
361
+ "coffee-number": {
362
+ "name": "constant.numeric.coffeehaml",
363
+ "match": "\\b(0[xX][0-9a-fA-F]+|0[oO]?[0-7]+|0[bB][01]+|(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?)\\b"
364
+ },
365
+
366
+ "coffee-boolean": {
367
+ "name": "constant.language.boolean.coffeehaml",
368
+ "match": "\\b(true|false|yes|no|on|off)\\b"
369
+ },
370
+
371
+ "coffee-null": {
372
+ "name": "constant.language.null.coffeehaml",
373
+ "match": "\\b(null|undefined|this|Infinity|NaN)\\b"
374
+ },
375
+
376
+ "coffee-operator": {
377
+ "name": "keyword.operator.coffeehaml",
378
+ "match": "\\b(and|or|not|is|isnt|instanceof|typeof|new|delete|of|in|then|when|do|by|own|unless|loop|break|continue|return|yield|await|throw|try|catch|finally|class|extends|super|import|export|default|from|as)\\b|(\\?\\?|\\.\\.\\.|\\?\\=|\\.\\.|\\?\\.?|:{2,3}|\\|\\||&&|[<>=!]==?|[-+*/%&|^~]=?|[<>=!]=|[-+*/%&|^~<>]=?)"
379
+ },
380
+
381
+ "coffee-bracket": {
382
+ "patterns": [
383
+ {
384
+ "name": "meta.brace.curly.coffeehaml",
385
+ "begin": "\\{",
386
+ "beginCaptures": { "0": { "name": "punctuation.definition.bracket.curly.begin.coffeehaml" } },
387
+ "end": "\\}",
388
+ "endCaptures": { "0": { "name": "punctuation.definition.bracket.curly.end.coffeehaml" } },
389
+ "patterns": [ { "include": "#coffeescript-expression" } ]
390
+ },
391
+ {
392
+ "name": "meta.brace.round.coffeehaml",
393
+ "begin": "\\(",
394
+ "beginCaptures": { "0": { "name": "punctuation.definition.bracket.round.begin.coffeehaml" } },
395
+ "end": "\\)",
396
+ "endCaptures": { "0": { "name": "punctuation.definition.bracket.round.end.coffeehaml" } },
397
+ "patterns": [ { "include": "#coffeescript-expression" } ]
398
+ },
399
+ {
400
+ "name": "meta.brace.square.coffeehaml",
401
+ "begin": "\\[",
402
+ "beginCaptures": { "0": { "name": "punctuation.definition.bracket.square.begin.coffeehaml" } },
403
+ "end": "\\]",
404
+ "endCaptures": { "0": { "name": "punctuation.definition.bracket.square.end.coffeehaml" } },
405
+ "patterns": [ { "include": "#coffeescript-expression" } ]
406
+ }
407
+ ]
408
+ },
409
+
410
+ "coffee-splat": {
411
+ "name": "keyword.operator.spread.coffeehaml",
412
+ "match": "\\.\\.\\."
413
+ },
414
+
415
+ "coffee-variable": {
416
+ "name": "variable.other.coffeehaml",
417
+ "match": "\\b([a-zA-Z_$][\\w$]*)\\b"
418
+ },
419
+
420
+ "coffee-comment": {
421
+ "name": "comment.line.number-sign.coffeehaml",
422
+ "match": "#(?![\\{@]).*$"
423
+ }
424
+ }
425
+ }