tm-grammars 1.7.1 → 1.8.0

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,610 @@
1
+ {
2
+ "displayName": "Closure Templates",
3
+ "fileTypes": [
4
+ "soy"
5
+ ],
6
+ "injections": {
7
+ "meta.tag": {
8
+ "patterns": [
9
+ {
10
+ "include": "#body"
11
+ }
12
+ ]
13
+ }
14
+ },
15
+ "name": "soy",
16
+ "patterns": [
17
+ {
18
+ "include": "#alias"
19
+ },
20
+ {
21
+ "include": "#delpackage"
22
+ },
23
+ {
24
+ "include": "#namespace"
25
+ },
26
+ {
27
+ "include": "#template"
28
+ },
29
+ {
30
+ "include": "#comment"
31
+ }
32
+ ],
33
+ "repository": {
34
+ "alias": {
35
+ "captures": {
36
+ "1": {
37
+ "name": "storage.type.soy"
38
+ },
39
+ "2": {
40
+ "name": "entity.name.type.soy"
41
+ },
42
+ "3": {
43
+ "name": "storage.type.soy"
44
+ },
45
+ "4": {
46
+ "name": "entity.name.type.soy"
47
+ }
48
+ },
49
+ "match": "{(alias)\\s+([\\w\\.]+)(?:\\s+(as)\\s+(\\w+))?}"
50
+ },
51
+ "attribute": {
52
+ "captures": {
53
+ "1": {
54
+ "name": "storage.other.attribute.soy"
55
+ },
56
+ "2": {
57
+ "name": "string.double.quoted.soy"
58
+ }
59
+ },
60
+ "match": "(\\w+)=(\"(?:\\\\?.)*?\")"
61
+ },
62
+ "body": {
63
+ "patterns": [
64
+ {
65
+ "include": "#comment"
66
+ },
67
+ {
68
+ "include": "#let"
69
+ },
70
+ {
71
+ "include": "#call"
72
+ },
73
+ {
74
+ "include": "#css"
75
+ },
76
+ {
77
+ "include": "#xid"
78
+ },
79
+ {
80
+ "include": "#condition"
81
+ },
82
+ {
83
+ "include": "#condition-control"
84
+ },
85
+ {
86
+ "include": "#for"
87
+ },
88
+ {
89
+ "include": "#literal"
90
+ },
91
+ {
92
+ "include": "#msg"
93
+ },
94
+ {
95
+ "include": "#special-character"
96
+ },
97
+ {
98
+ "include": "#print"
99
+ },
100
+ {
101
+ "include": "text.html.basic"
102
+ }
103
+ ]
104
+ },
105
+ "boolean": {
106
+ "match": "true|false",
107
+ "name": "language.constant.boolean.soy"
108
+ },
109
+ "call": {
110
+ "patterns": [
111
+ {
112
+ "begin": "{((?:del)?call)\\s+([\\w\\.]+)(?=[^/]*?})",
113
+ "beginCaptures": {
114
+ "1": {
115
+ "name": "storage.type.function.soy"
116
+ },
117
+ "2": {
118
+ "name": "entity.name.function.soy"
119
+ }
120
+ },
121
+ "end": "{/(\\1)}",
122
+ "endCaptures": {
123
+ "1": {
124
+ "name": "storage.type.function.soy"
125
+ }
126
+ },
127
+ "patterns": [
128
+ {
129
+ "include": "#comment"
130
+ },
131
+ {
132
+ "include": "#variant"
133
+ },
134
+ {
135
+ "include": "#attribute"
136
+ },
137
+ {
138
+ "include": "#param"
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "begin": "{((?:del)?call)(\\s+[\\w\\.]+)",
144
+ "beginCaptures": {
145
+ "1": {
146
+ "name": "storage.type.function.soy"
147
+ },
148
+ "2": {
149
+ "name": "entity.name.function.soy"
150
+ }
151
+ },
152
+ "end": "/}",
153
+ "patterns": [
154
+ {
155
+ "include": "#variant"
156
+ },
157
+ {
158
+ "include": "#attribute"
159
+ }
160
+ ]
161
+ }
162
+ ]
163
+ },
164
+ "comment": {
165
+ "patterns": [
166
+ {
167
+ "begin": "/\\*",
168
+ "end": "\\*/",
169
+ "name": "comment.block.documentation.soy",
170
+ "patterns": [
171
+ {
172
+ "captures": {
173
+ "1": {
174
+ "name": "keyword.parameter.soy"
175
+ },
176
+ "2": {
177
+ "name": "variable.parameter.soy"
178
+ }
179
+ },
180
+ "match": "(@param\\??)\\s+(\\S+)"
181
+ }
182
+ ]
183
+ },
184
+ {
185
+ "match": "^\\s*(\\/\\/.*)$",
186
+ "name": "comment.line.double-slash.soy"
187
+ }
188
+ ]
189
+ },
190
+ "condition": {
191
+ "begin": "{/?(if|elseif|switch|case)\\s*",
192
+ "beginCaptures": {
193
+ "1": {
194
+ "name": "keyword.control.soy"
195
+ }
196
+ },
197
+ "end": "}",
198
+ "patterns": [
199
+ {
200
+ "include": "#attribute"
201
+ },
202
+ {
203
+ "include": "#expression"
204
+ }
205
+ ]
206
+ },
207
+ "condition-control": {
208
+ "captures": {
209
+ "1": {
210
+ "name": "keyword.control.soy"
211
+ }
212
+ },
213
+ "match": "{(else|ifempty|default)}"
214
+ },
215
+ "css": {
216
+ "begin": "{(css)\\s+",
217
+ "beginCaptures": {
218
+ "1": {
219
+ "name": "keyword.other.soy"
220
+ }
221
+ },
222
+ "end": "}",
223
+ "patterns": [
224
+ {
225
+ "include": "#expression"
226
+ }
227
+ ]
228
+ },
229
+ "delpackage": {
230
+ "captures": {
231
+ "1": {
232
+ "name": "storage.type.soy"
233
+ },
234
+ "2": {
235
+ "name": "entity.name.type.soy"
236
+ }
237
+ },
238
+ "match": "{(delpackage)\\s+([\\w\\.]+)}"
239
+ },
240
+ "expression": {
241
+ "patterns": [
242
+ {
243
+ "include": "#boolean"
244
+ },
245
+ {
246
+ "include": "#number"
247
+ },
248
+ {
249
+ "include": "#function"
250
+ },
251
+ {
252
+ "include": "#null"
253
+ },
254
+ {
255
+ "include": "#string"
256
+ },
257
+ {
258
+ "include": "#variable-ref"
259
+ },
260
+ {
261
+ "include": "#operator"
262
+ }
263
+ ]
264
+ },
265
+ "for": {
266
+ "begin": "{/?(foreach|for)(?=\\s|})",
267
+ "beginCaptures": {
268
+ "1": {
269
+ "name": "keyword.control.soy"
270
+ }
271
+ },
272
+ "end": "}",
273
+ "patterns": [
274
+ {
275
+ "match": "in",
276
+ "name": "keyword.control.soy"
277
+ },
278
+ {
279
+ "include": "#expression"
280
+ },
281
+ {
282
+ "include": "#body"
283
+ }
284
+ ]
285
+ },
286
+ "function": {
287
+ "begin": "(\\w+)\\(",
288
+ "beginCaptures": {
289
+ "1": {
290
+ "name": "support.function.soy"
291
+ }
292
+ },
293
+ "end": "\\)",
294
+ "patterns": [
295
+ {
296
+ "include": "#expression"
297
+ }
298
+ ]
299
+ },
300
+ "let": {
301
+ "patterns": [
302
+ {
303
+ "begin": "{(let)\\s+(\\$\\w+\\s*:)",
304
+ "beginCaptures": {
305
+ "1": {
306
+ "name": "storage.type.soy"
307
+ },
308
+ "2": {
309
+ "name": "variable.soy"
310
+ }
311
+ },
312
+ "end": "/}",
313
+ "patterns": [
314
+ {
315
+ "include": "#comment"
316
+ },
317
+ {
318
+ "include": "#expression"
319
+ }
320
+ ]
321
+ },
322
+ {
323
+ "begin": "{(let)\\s+(\\$\\w+)",
324
+ "beginCaptures": {
325
+ "1": {
326
+ "name": "storage.type.soy"
327
+ },
328
+ "2": {
329
+ "name": "variable.soy"
330
+ }
331
+ },
332
+ "end": "{/(\\1)}",
333
+ "endCaptures": {
334
+ "1": {
335
+ "name": "storage.type.soy"
336
+ }
337
+ },
338
+ "patterns": [
339
+ {
340
+ "include": "#attribute"
341
+ },
342
+ {
343
+ "include": "#body"
344
+ }
345
+ ]
346
+ }
347
+ ]
348
+ },
349
+ "literal": {
350
+ "begin": "{(literal)}",
351
+ "beginCaptures": {
352
+ "1": {
353
+ "name": "keyword.other.soy"
354
+ }
355
+ },
356
+ "end": "{/(\\1)}",
357
+ "endCaptures": {
358
+ "1": {
359
+ "name": "keyword.other.soy"
360
+ }
361
+ },
362
+ "name": "meta.literal"
363
+ },
364
+ "msg": {
365
+ "captures": {
366
+ "1": {
367
+ "name": "keyword.other.soy"
368
+ }
369
+ },
370
+ "end": "}",
371
+ "match": "{/?(msg|fallbackmsg)",
372
+ "patterns": [
373
+ {
374
+ "include": "#attribute"
375
+ }
376
+ ]
377
+ },
378
+ "namespace": {
379
+ "captures": {
380
+ "1": {
381
+ "name": "storage.type.soy"
382
+ },
383
+ "2": {
384
+ "name": "entity.name.type.soy"
385
+ }
386
+ },
387
+ "match": "{(namespace)\\s+([\\w\\.]+)}"
388
+ },
389
+ "null": {
390
+ "match": "null",
391
+ "name": "language.constant.null.soy"
392
+ },
393
+ "number": {
394
+ "match": "-?\\.?\\d+|\\d[\\.\\d]*",
395
+ "name": "language.constant.numeric"
396
+ },
397
+ "operator": {
398
+ "match": "-|not|\\*|\\/|%|\\+|<=|>=|<|>|==|!=|and|or|\\?:|\\?|:",
399
+ "name": "keyword.operator.soy"
400
+ },
401
+ "param": {
402
+ "patterns": [
403
+ {
404
+ "begin": "{(param)\\s+(\\w+\\s*\\:)",
405
+ "beginCaptures": {
406
+ "1": {
407
+ "name": "storage.type.soy"
408
+ },
409
+ "2": {
410
+ "name": "variable.parameter.soy"
411
+ }
412
+ },
413
+ "end": "/}",
414
+ "patterns": [
415
+ {
416
+ "include": "#expression"
417
+ }
418
+ ]
419
+ },
420
+ {
421
+ "begin": "{(param)\\s+(\\w+)",
422
+ "beginCaptures": {
423
+ "1": {
424
+ "name": "storage.type.soy"
425
+ },
426
+ "2": {
427
+ "name": "variable.parameter.soy"
428
+ }
429
+ },
430
+ "end": "{/(\\1)}",
431
+ "endCaptures": {
432
+ "1": {
433
+ "name": "storage.type.soy"
434
+ }
435
+ },
436
+ "patterns": [
437
+ {
438
+ "include": "#attribute"
439
+ },
440
+ {
441
+ "include": "#body"
442
+ }
443
+ ]
444
+ }
445
+ ]
446
+ },
447
+ "print": {
448
+ "begin": "{(print)?\\s*",
449
+ "beginCaptures": {
450
+ "1": {
451
+ "name": "keyword.other.soy"
452
+ }
453
+ },
454
+ "end": "}",
455
+ "patterns": [
456
+ {
457
+ "captures": {
458
+ "1": {
459
+ "name": "support.function.soy"
460
+ }
461
+ },
462
+ "match": "\\|\\s*(changeNewlineToBr|truncate|bidiSpanWrap|bidiUnicodeWrap)"
463
+ },
464
+ {
465
+ "include": "#expression"
466
+ }
467
+ ]
468
+ },
469
+ "special-character": {
470
+ "captures": {
471
+ "1": {
472
+ "name": "language.support.constant"
473
+ }
474
+ },
475
+ "match": "{(sp|nil|\\\\r|\\\\n|\\\\t|lb|rb)}"
476
+ },
477
+ "string": {
478
+ "begin": "'",
479
+ "end": "'",
480
+ "name": "string.quoted.single.soy",
481
+ "patterns": [
482
+ {
483
+ "match": "\\\\(?:[\\\\'\"nrtbf]|u[0-9a-fA-F]{4})",
484
+ "name": "constant.character.escape.soy"
485
+ }
486
+ ]
487
+ },
488
+ "template": {
489
+ "begin": "{(template|deltemplate)\\s([\\w\\.]+)",
490
+ "beginCaptures": {
491
+ "1": {
492
+ "name": "storage.type.soy"
493
+ },
494
+ "2": {
495
+ "name": "entity.name.function.soy"
496
+ }
497
+ },
498
+ "end": "{(/\\1)}",
499
+ "endCaptures": {
500
+ "1": {
501
+ "name": "storage.type.soy"
502
+ }
503
+ },
504
+ "patterns": [
505
+ {
506
+ "begin": "{(@param)(\\??)\\s+(\\S+\\s*:)",
507
+ "beginCaptures": {
508
+ "1": {
509
+ "name": "keyword.parameter.soy"
510
+ },
511
+ "2": {
512
+ "name": "storage.modifier.keyword.operator.soy"
513
+ },
514
+ "3": {
515
+ "name": "variable.parameter.soy"
516
+ }
517
+ },
518
+ "end": "}",
519
+ "name": "meta.parameter.soy",
520
+ "patterns": [
521
+ {
522
+ "include": "#type"
523
+ }
524
+ ]
525
+ },
526
+ {
527
+ "include": "#variant"
528
+ },
529
+ {
530
+ "include": "#body"
531
+ },
532
+ {
533
+ "include": "#attribute"
534
+ }
535
+ ]
536
+ },
537
+ "type": {
538
+ "patterns": [
539
+ {
540
+ "match": "any|null|\\?|string|bool|int|float|number|html|uri|js|css|attributes",
541
+ "name": "support.type.soy"
542
+ },
543
+ {
544
+ "begin": "(list|map)(<)",
545
+ "beginCaptures": {
546
+ "1": {
547
+ "name": "support.type.soy"
548
+ },
549
+ "2": {
550
+ "name": "support.type.punctuation.soy"
551
+ }
552
+ },
553
+ "end": "(>)",
554
+ "endCaptures": {
555
+ "1": {
556
+ "name": "support.type.modifier.soy"
557
+ }
558
+ },
559
+ "patterns": [
560
+ {
561
+ "include": "#type"
562
+ }
563
+ ]
564
+ }
565
+ ]
566
+ },
567
+ "variable-ref": {
568
+ "match": "\\$[\\a-zA-Z_][\\w\\.]*",
569
+ "name": "variable.other.soy"
570
+ },
571
+ "variant": {
572
+ "begin": "(variant)=(\")",
573
+ "beginCaptures": {
574
+ "1": {
575
+ "name": "storage.other.attribute.soy"
576
+ },
577
+ "2": {
578
+ "name": "string.double.quoted.soy"
579
+ }
580
+ },
581
+ "contentName": "string.double.quoted.soy",
582
+ "end": "(\")",
583
+ "endCaptures": {
584
+ "1": {
585
+ "name": "string.double.quoted.soy"
586
+ }
587
+ },
588
+ "patterns": [
589
+ {
590
+ "include": "#expression"
591
+ }
592
+ ]
593
+ },
594
+ "xid": {
595
+ "begin": "{(xid)\\s+",
596
+ "beginCaptures": {
597
+ "1": {
598
+ "name": "keyword.other.soy"
599
+ }
600
+ },
601
+ "end": "}",
602
+ "patterns": [
603
+ {
604
+ "include": "#expression"
605
+ }
606
+ ]
607
+ }
608
+ },
609
+ "scopeName": "text.html.soy"
610
+ }
@@ -280,54 +280,6 @@
280
280
  }
281
281
  ]
282
282
  },
283
- "embeddedJinja": {
284
- "patterns": [
285
- {
286
- "begin": "({\\%)\\s*(raw)\\s*(%\\})",
287
- "captures": {
288
- "1": {
289
- "name": "entity.other.jinja.delimiter.tag"
290
- },
291
- "2": {
292
- "name": "keyword.control.jinja"
293
- },
294
- "3": {
295
- "name": "entity.other.jinja.delimiter.tag"
296
- }
297
- },
298
- "end": "(\\{%)\\s*(endraw)\\s*(%\\})",
299
- "name": "meta.scope.jinja.raw",
300
- "patterns": [
301
- {
302
- "include": "source.systemd"
303
- }
304
- ]
305
- },
306
- {
307
- "begin": "\\{\\{\\-?",
308
- "end": "-?\\}\\}",
309
- "name": "variable.meta.scope.jinja",
310
- "patterns": [
311
- {
312
- "include": "source.jinja#expression"
313
- }
314
- ]
315
- },
316
- {
317
- "begin": "\\{%\\-?",
318
- "end": "-?%\\}",
319
- "name": "meta.scope.jinja.tag",
320
- "patterns": [
321
- {
322
- "include": "source.jinja#expression"
323
- }
324
- ]
325
- },
326
- {
327
- "include": "source.jinja#comments"
328
- }
329
- ]
330
- },
331
283
  "executablePrefixes": {
332
284
  "patterns": [
333
285
  {
@@ -339,7 +291,7 @@
339
291
  "numbers": {
340
292
  "patterns": [
341
293
  {
342
- "match": "(?<=\\s|=)\\d+(?:\\.\\d+)?(?=\\s|$)",
294
+ "match": "(?<=\\s|=)\\d+(?:\\.\\d+)?(?=[\\s:]|$)",
343
295
  "name": "constant.numeric"
344
296
  }
345
297
  ]
@@ -393,11 +345,11 @@
393
345
  "sizes": {
394
346
  "patterns": [
395
347
  {
396
- "match": "(?<=\\s|=)\\d+(?:\\.\\d+)?[KMGT](?=\\s|$)",
348
+ "match": "(?<=\\s|=)\\d+(?:\\.\\d+)?[KMGT](?=[\\s:]|$)",
397
349
  "name": "constant.numeric"
398
350
  },
399
351
  {
400
- "match": "(?<==)infinity(?=\\s|$)",
352
+ "match": "(?<==)infinity(?=[\\s:]|$)",
401
353
  "name": "constant.numeric"
402
354
  }
403
355
  ]