Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json
3292 views
1
{
2
"information_for_contributors": [
3
"This file has been converted from https://github.com/daaain/Handlebars/blob/master/grammars/Handlebars.json",
4
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
5
"Once accepted there, we are happy to receive an update request."
6
],
7
"version": "https://github.com/daaain/Handlebars/commit/85a153a6f759df4e8da7533e1b3651f007867c51",
8
"name": "Handlebars",
9
"scopeName": "text.html.handlebars",
10
"patterns": [
11
{
12
"include": "#yfm"
13
},
14
{
15
"include": "#extends"
16
},
17
{
18
"include": "#block_comments"
19
},
20
{
21
"include": "#comments"
22
},
23
{
24
"include": "#block_helper"
25
},
26
{
27
"include": "#end_block"
28
},
29
{
30
"include": "#else_token"
31
},
32
{
33
"include": "#partial_and_var"
34
},
35
{
36
"include": "#inline_script"
37
},
38
{
39
"include": "#html_tags"
40
},
41
{
42
"include": "text.html.basic"
43
}
44
],
45
"repository": {
46
"html_tags": {
47
"patterns": [
48
{
49
"begin": "(<)([a-zA-Z0-9:-]+)(?=[^>]*></\\2>)",
50
"beginCaptures": {
51
"1": {
52
"name": "punctuation.definition.tag.html"
53
},
54
"2": {
55
"name": "entity.name.tag.html"
56
}
57
},
58
"end": "(>(<)/)(\\2)(>)",
59
"endCaptures": {
60
"1": {
61
"name": "punctuation.definition.tag.html"
62
},
63
"2": {
64
"name": "meta.scope.between-tag-pair.html"
65
},
66
"3": {
67
"name": "entity.name.tag.html"
68
},
69
"4": {
70
"name": "punctuation.definition.tag.html"
71
}
72
},
73
"name": "meta.tag.any.html",
74
"patterns": [
75
{
76
"include": "#tag-stuff"
77
}
78
]
79
},
80
{
81
"begin": "(<\\?)(xml)",
82
"captures": {
83
"1": {
84
"name": "punctuation.definition.tag.html"
85
},
86
"2": {
87
"name": "entity.name.tag.xml.html"
88
}
89
},
90
"end": "(\\?>)",
91
"name": "meta.tag.preprocessor.xml.html",
92
"patterns": [
93
{
94
"include": "#tag_generic_attribute"
95
},
96
{
97
"include": "#string"
98
}
99
]
100
},
101
{
102
"begin": "<!--",
103
"captures": {
104
"0": {
105
"name": "punctuation.definition.comment.html"
106
}
107
},
108
"end": "--\\s*>",
109
"name": "comment.block.html",
110
"patterns": [
111
{
112
"match": "--",
113
"name": "invalid.illegal.bad-comments-or-CDATA.html"
114
}
115
]
116
},
117
{
118
"begin": "<!",
119
"captures": {
120
"0": {
121
"name": "punctuation.definition.tag.html"
122
}
123
},
124
"end": ">",
125
"name": "meta.tag.sgml.html",
126
"patterns": [
127
{
128
"begin": "(DOCTYPE|doctype)",
129
"captures": {
130
"1": {
131
"name": "entity.name.tag.doctype.html"
132
}
133
},
134
"end": "(?=>)",
135
"name": "meta.tag.sgml.doctype.html",
136
"patterns": [
137
{
138
"match": "\"[^\">]*\"",
139
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
140
}
141
]
142
},
143
{
144
"begin": "\\[CDATA\\[",
145
"end": "]](?=>)",
146
"name": "constant.other.inline-data.html"
147
},
148
{
149
"match": "(\\s*)(?!--|>)\\S(\\s*)",
150
"name": "invalid.illegal.bad-comments-or-CDATA.html"
151
}
152
]
153
},
154
{
155
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
156
"captures": {
157
"1": {
158
"name": "punctuation.definition.tag.html"
159
},
160
"2": {
161
"name": "entity.name.tag.style.html"
162
},
163
"3": {
164
"name": "punctuation.definition.tag.html"
165
}
166
},
167
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
168
"name": "source.css.embedded.html",
169
"patterns": [
170
{
171
"include": "#tag-stuff"
172
},
173
{
174
"begin": "(>)",
175
"beginCaptures": {
176
"1": {
177
"name": "punctuation.definition.tag.html"
178
}
179
},
180
"end": "(?=</(?i:style))",
181
"patterns": [
182
{
183
"include": "source.css"
184
}
185
]
186
}
187
]
188
},
189
{
190
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)",
191
"beginCaptures": {
192
"1": {
193
"name": "punctuation.definition.tag.html"
194
},
195
"2": {
196
"name": "entity.name.tag.script.html"
197
}
198
},
199
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
200
"endCaptures": {
201
"2": {
202
"name": "punctuation.definition.tag.html"
203
}
204
},
205
"name": "source.js.embedded.html",
206
"patterns": [
207
{
208
"include": "#tag-stuff"
209
},
210
{
211
"begin": "(?<!</(?:script|SCRIPT))(>)",
212
"captures": {
213
"1": {
214
"name": "punctuation.definition.tag.html"
215
},
216
"2": {
217
"name": "entity.name.tag.script.html"
218
}
219
},
220
"end": "(</)((?i:script))",
221
"patterns": [
222
{
223
"captures": {
224
"1": {
225
"name": "punctuation.definition.comment.js"
226
}
227
},
228
"match": "(//).*?((?=</script)|$\\n?)",
229
"name": "comment.line.double-slash.js"
230
},
231
{
232
"begin": "/\\*",
233
"captures": {
234
"0": {
235
"name": "punctuation.definition.comment.js"
236
}
237
},
238
"end": "\\*/|(?=</script)",
239
"name": "comment.block.js"
240
},
241
{
242
"include": "source.js"
243
}
244
]
245
}
246
]
247
},
248
{
249
"begin": "(</?)((?i:body|head|html)\\b)",
250
"captures": {
251
"1": {
252
"name": "punctuation.definition.tag.html"
253
},
254
"2": {
255
"name": "entity.name.tag.structure.any.html"
256
}
257
},
258
"end": "(>)",
259
"name": "meta.tag.structure.any.html",
260
"patterns": [
261
{
262
"include": "#tag-stuff"
263
}
264
]
265
},
266
{
267
"begin": "(</?)((?i:address|blockquote|dd|div|header|section|footer|aside|nav|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)",
268
"captures": {
269
"1": {
270
"name": "punctuation.definition.tag.html"
271
},
272
"2": {
273
"name": "entity.name.tag.block.any.html"
274
}
275
},
276
"end": "(>)",
277
"name": "meta.tag.block.any.html",
278
"patterns": [
279
{
280
"include": "#tag-stuff"
281
}
282
]
283
},
284
{
285
"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)",
286
"captures": {
287
"1": {
288
"name": "punctuation.definition.tag.html"
289
},
290
"2": {
291
"name": "entity.name.tag.inline.any.html"
292
}
293
},
294
"end": "((?: ?/)?>)",
295
"name": "meta.tag.inline.any.html",
296
"patterns": [
297
{
298
"include": "#tag-stuff"
299
}
300
]
301
},
302
{
303
"begin": "(</?)([a-zA-Z0-9:-]+)",
304
"captures": {
305
"1": {
306
"name": "punctuation.definition.tag.html"
307
},
308
"2": {
309
"name": "entity.name.tag.other.html"
310
}
311
},
312
"end": "(>)",
313
"name": "meta.tag.other.html",
314
"patterns": [
315
{
316
"include": "#tag-stuff"
317
}
318
]
319
},
320
{
321
"begin": "(</?)([a-zA-Z0-9{}:-]+)",
322
"captures": {
323
"1": {
324
"name": "punctuation.definition.tag.html"
325
},
326
"2": {
327
"name": "entity.name.tag.tokenised.html"
328
}
329
},
330
"end": "(>)",
331
"name": "meta.tag.tokenised.html",
332
"patterns": [
333
{
334
"include": "#tag-stuff"
335
}
336
]
337
},
338
{
339
"include": "#entities"
340
},
341
{
342
"match": "<>",
343
"name": "invalid.illegal.incomplete.html"
344
},
345
{
346
"match": "<",
347
"name": "invalid.illegal.bad-angle-bracket.html"
348
}
349
]
350
},
351
"entities": {
352
"patterns": [
353
{
354
"captures": {
355
"1": {
356
"name": "punctuation.definition.entity.html"
357
},
358
"3": {
359
"name": "punctuation.definition.entity.html"
360
}
361
},
362
"name": "constant.character.entity.html",
363
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
364
},
365
{
366
"name": "invalid.illegal.bad-ampersand.html",
367
"match": "&"
368
}
369
]
370
},
371
"end_block": {
372
"begin": "(\\{\\{)(~?/)([a-zA-Z0-9/_\\.-]+)\\s*",
373
"end": "(~?\\}\\})",
374
"name": "meta.function.block.end.handlebars",
375
"endCaptures": {
376
"1": {
377
"name": "support.constant.handlebars"
378
}
379
},
380
"beginCaptures": {
381
"1": {
382
"name": "support.constant.handlebars"
383
},
384
"2": {
385
"name": "support.constant.handlebars keyword.control"
386
},
387
"3": {
388
"name": "support.constant.handlebars keyword.control"
389
}
390
},
391
"patterns": []
392
},
393
"yfm": {
394
"patterns": [
395
{
396
"patterns": [
397
{
398
"include": "source.yaml"
399
}
400
],
401
"begin": "(?<!\\s)---\\n$",
402
"end": "^---\\s",
403
"name": "markup.raw.yaml.front-matter"
404
}
405
]
406
},
407
"comments": {
408
"patterns": [
409
{
410
"patterns": [
411
{
412
"name": "keyword.annotation.handlebars",
413
"match": "@\\w*"
414
},
415
{
416
"include": "#comments"
417
}
418
],
419
"begin": "\\{\\{!",
420
"end": "\\}\\}",
421
"name": "comment.block.handlebars"
422
},
423
{
424
"captures": {
425
"0": {
426
"name": "punctuation.definition.comment.html"
427
}
428
},
429
"begin": "<!--",
430
"end": "-{2,3}\\s*>",
431
"name": "comment.block.html",
432
"patterns": [
433
{
434
"name": "invalid.illegal.bad-comments-or-CDATA.html",
435
"match": "--"
436
}
437
]
438
}
439
]
440
},
441
"block_comments": {
442
"patterns": [
443
{
444
"patterns": [
445
{
446
"name": "keyword.annotation.handlebars",
447
"match": "@\\w*"
448
},
449
{
450
"include": "#comments"
451
}
452
],
453
"begin": "\\{\\{!--",
454
"end": "--\\}\\}",
455
"name": "comment.block.handlebars"
456
},
457
{
458
"captures": {
459
"0": {
460
"name": "punctuation.definition.comment.html"
461
}
462
},
463
"begin": "<!--",
464
"end": "-{2,3}\\s*>",
465
"name": "comment.block.html",
466
"patterns": [
467
{
468
"name": "invalid.illegal.bad-comments-or-CDATA.html",
469
"match": "--"
470
}
471
]
472
}
473
]
474
},
475
"block_helper": {
476
"begin": "(\\{\\{)(~?\\#)([-a-zA-Z0-9_\\./>]+)\\s?(@?[-a-zA-Z0-9_\\./]+)*\\s?(@?[-a-zA-Z0-9_\\./]+)*\\s?(@?[-a-zA-Z0-9_\\./]+)*",
477
"end": "(~?\\}\\})",
478
"name": "meta.function.block.start.handlebars",
479
"endCaptures": {
480
"1": {
481
"name": "support.constant.handlebars"
482
}
483
},
484
"beginCaptures": {
485
"1": {
486
"name": "support.constant.handlebars"
487
},
488
"2": {
489
"name": "support.constant.handlebars keyword.control"
490
},
491
"3": {
492
"name": "support.constant.handlebars keyword.control"
493
},
494
"4": {
495
"name": "variable.parameter.handlebars"
496
},
497
"5": {
498
"name": "support.constant.handlebars"
499
},
500
"6": {
501
"name": "variable.parameter.handlebars"
502
},
503
"7": {
504
"name": "support.constant.handlebars"
505
}
506
},
507
"patterns": [
508
{
509
"include": "#string"
510
},
511
{
512
"include": "#handlebars_attribute"
513
}
514
]
515
},
516
"string-single-quoted": {
517
"begin": "'",
518
"end": "'",
519
"name": "string.quoted.single.handlebars",
520
"endCaptures": {
521
"0": {
522
"name": "punctuation.definition.string.end.html"
523
}
524
},
525
"beginCaptures": {
526
"0": {
527
"name": "punctuation.definition.string.begin.html"
528
}
529
},
530
"patterns": [
531
{
532
"include": "#escaped-single-quote"
533
},
534
{
535
"include": "#block_comments"
536
},
537
{
538
"include": "#comments"
539
},
540
{
541
"include": "#block_helper"
542
},
543
{
544
"include": "#else_token"
545
},
546
{
547
"include": "#end_block"
548
},
549
{
550
"include": "#partial_and_var"
551
}
552
]
553
},
554
"string": {
555
"patterns": [
556
{
557
"include": "#string-single-quoted"
558
},
559
{
560
"include": "#string-double-quoted"
561
}
562
]
563
},
564
"escaped-single-quote": {
565
"name": "constant.character.escape.js",
566
"match": "\\\\'"
567
},
568
"escaped-double-quote": {
569
"name": "constant.character.escape.js",
570
"match": "\\\\\""
571
},
572
"partial_and_var": {
573
"begin": "(\\{\\{~?\\{*(>|!<)*)\\s*(@?[-a-zA-Z0-9$_\\./]+)*",
574
"end": "(~?\\}\\}\\}*)",
575
"name": "meta.function.inline.other.handlebars",
576
"beginCaptures": {
577
"1": {
578
"name": "support.constant.handlebars"
579
},
580
"3": {
581
"name": "variable.parameter.handlebars"
582
}
583
},
584
"endCaptures": {
585
"1": {
586
"name": "support.constant.handlebars"
587
}
588
},
589
"patterns": [
590
{
591
"include": "#string"
592
},
593
{
594
"include": "#handlebars_attribute"
595
}
596
]
597
},
598
"handlebars_attribute_name": {
599
"begin": "\\b([-a-zA-Z0-9_\\.]+)\\b=",
600
"captures": {
601
"1": {
602
"name": "variable.parameter.handlebars"
603
}
604
},
605
"end": "(?='|\"|)",
606
"name": "entity.other.attribute-name.handlebars"
607
},
608
"handlebars_attribute_value": {
609
"begin": "([-a-zA-Z0-9_\\./]+)\\b",
610
"captures": {
611
"1": {
612
"name": "variable.parameter.handlebars"
613
}
614
},
615
"end": "('|\"|)",
616
"name": "entity.other.attribute-value.handlebars",
617
"patterns": [
618
{
619
"include": "#string"
620
}
621
]
622
},
623
"handlebars_attribute": {
624
"patterns": [
625
{
626
"include": "#handlebars_attribute_name"
627
},
628
{
629
"include": "#handlebars_attribute_value"
630
}
631
]
632
},
633
"extends": {
634
"patterns": [
635
{
636
"end": "(\\}\\})",
637
"begin": "(\\{\\{!<)\\s([-a-zA-Z0-9_\\./]+)",
638
"beginCaptures": {
639
"1": {
640
"name": "support.function.handlebars"
641
},
642
"2": {
643
"name": "support.class.handlebars"
644
}
645
},
646
"endCaptures": {
647
"1": {
648
"name": "support.function.handlebars"
649
}
650
},
651
"name": "meta.preprocessor.handlebars"
652
}
653
]
654
},
655
"else_token": {
656
"begin": "(\\{\\{)(~?else)(@?\\s(if)\\s([-a-zA-Z0-9_\\.\\(\\s\\)/]+))?",
657
"end": "(~?\\}\\}\\}*)",
658
"name": "meta.function.inline.else.handlebars",
659
"beginCaptures": {
660
"1": {
661
"name": "support.constant.handlebars"
662
},
663
"2": {
664
"name": "support.constant.handlebars keyword.control"
665
},
666
"3": {
667
"name": "support.constant.handlebars"
668
},
669
"4": {
670
"name": "variable.parameter.handlebars"
671
}
672
},
673
"endCaptures": {
674
"1": {
675
"name": "support.constant.handlebars"
676
}
677
}
678
},
679
"string-double-quoted": {
680
"begin": "\"",
681
"end": "\"",
682
"name": "string.quoted.double.handlebars",
683
"beginCaptures": {
684
"0": {
685
"name": "punctuation.definition.string.begin.html"
686
}
687
},
688
"endCaptures": {
689
"0": {
690
"name": "punctuation.definition.string.end.html"
691
}
692
},
693
"patterns": [
694
{
695
"include": "#escaped-double-quote"
696
},
697
{
698
"include": "#block_comments"
699
},
700
{
701
"include": "#comments"
702
},
703
{
704
"include": "#block_helper"
705
},
706
{
707
"include": "#else_token"
708
},
709
{
710
"include": "#end_block"
711
},
712
{
713
"include": "#partial_and_var"
714
}
715
]
716
},
717
"inline_script": {
718
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?:.*(type)=([\"'](?:text/x-handlebars-template|text/x-handlebars|text/template|x-tmpl-handlebars)[\"']))(?![^>]*/>)",
719
"beginCaptures": {
720
"1": {
721
"name": "punctuation.definition.tag.html"
722
},
723
"2": {
724
"name": "entity.name.tag.script.html"
725
},
726
"3": {
727
"name": "entity.other.attribute-name.html"
728
},
729
"4": {
730
"name": "string.quoted.double.html"
731
}
732
},
733
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
734
"endCaptures": {
735
"2": {
736
"name": "punctuation.definition.tag.html"
737
}
738
},
739
"name": "source.handlebars.embedded.html",
740
"patterns": [
741
{
742
"include": "#tag-stuff"
743
},
744
{
745
"begin": "(?<!</(?:script|SCRIPT))(>)",
746
"captures": {
747
"1": {
748
"name": "punctuation.definition.tag.html"
749
},
750
"2": {
751
"name": "entity.name.tag.script.html"
752
}
753
},
754
"end": "(</)((?i:script))",
755
"patterns": [
756
{
757
"include": "#block_comments"
758
},
759
{
760
"include": "#comments"
761
},
762
{
763
"include": "#block_helper"
764
},
765
{
766
"include": "#end_block"
767
},
768
{
769
"include": "#else_token"
770
},
771
{
772
"include": "#partial_and_var"
773
},
774
{
775
"include": "#html_tags"
776
},
777
{
778
"include": "text.html.basic"
779
}
780
]
781
}
782
]
783
},
784
"tag_generic_attribute": {
785
"begin": "\\b([a-zA-Z0-9_-]+)\\b\\s*(=)",
786
"captures": {
787
"1": {
788
"name": "entity.other.attribute-name.generic.html"
789
},
790
"2": {
791
"name": "punctuation.separator.key-value.html"
792
}
793
},
794
"patterns": [
795
{
796
"include": "#string"
797
}
798
],
799
"name": "entity.other.attribute-name.html",
800
"end": "(?<='|\"|)"
801
},
802
"tag_id_attribute": {
803
"begin": "\\b(id)\\b\\s*(=)",
804
"captures": {
805
"1": {
806
"name": "entity.other.attribute-name.id.html"
807
},
808
"2": {
809
"name": "punctuation.separator.key-value.html"
810
}
811
},
812
"end": "(?<='|\"|)",
813
"name": "meta.attribute-with-value.id.html",
814
"patterns": [
815
{
816
"include": "#string"
817
}
818
]
819
},
820
"tag-stuff": {
821
"patterns": [
822
{
823
"include": "#tag_id_attribute"
824
},
825
{
826
"include": "#tag_generic_attribute"
827
},
828
{
829
"include": "#string"
830
},
831
{
832
"include": "#block_comments"
833
},
834
{
835
"include": "#comments"
836
},
837
{
838
"include": "#block_helper"
839
},
840
{
841
"include": "#end_block"
842
},
843
{
844
"include": "#else_token"
845
},
846
{
847
"include": "#partial_and_var"
848
}
849
]
850
}
851
}
852
}
853