squiffy-compiler 6.0.1 → 7.0.0-beta.2

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,972 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "Squiffy",
4
+ "scopeName": "source.squiffy",
5
+ "fileTypes": [
6
+ "squiffy"
7
+ ],
8
+ "patterns": [
9
+ {
10
+ "include": "#preamble"
11
+ },
12
+ {
13
+ "include": "#block"
14
+ },
15
+ {
16
+ "include": "#text"
17
+ }
18
+ ],
19
+ "repository": {
20
+ "block": {
21
+ "comment": "Each header starts a block. Until the block's first line of text, lines indented by a tab or four spaces are JavaScript, as in the compiler (compiler/src/parse.ts).",
22
+ "patterns": [
23
+ {
24
+ "include": "#snippet"
25
+ },
26
+ {
27
+ "include": "#section-header"
28
+ },
29
+ {
30
+ "include": "#passage-header"
31
+ },
32
+ {
33
+ "include": "#continue"
34
+ },
35
+ {
36
+ "include": "#separator"
37
+ },
38
+ {
39
+ "include": "#ui-block"
40
+ }
41
+ ]
42
+ },
43
+ "preamble": {
44
+ "comment": "The top of the file works like the start of a section.",
45
+ "begin": "\\A(?=\\s*$|\\t| {4}|\\s*@)",
46
+ "end": "^(?!\\s*$|\\t| {4}|\\s*@)",
47
+ "patterns": [
48
+ {
49
+ "include": "#ui-block"
50
+ },
51
+ {
52
+ "include": "#js-line"
53
+ },
54
+ {
55
+ "include": "#directive"
56
+ }
57
+ ]
58
+ },
59
+ "section-header": {
60
+ "begin": "^\\s*(\\[\\[)(.*)(\\]\\])(:)\\s*$",
61
+ "beginCaptures": {
62
+ "0": {
63
+ "name": "markup.heading.section.squiffy"
64
+ },
65
+ "1": {
66
+ "name": "punctuation.definition.heading.begin.squiffy"
67
+ },
68
+ "2": {
69
+ "name": "entity.name.section.squiffy"
70
+ },
71
+ "3": {
72
+ "name": "punctuation.definition.heading.end.squiffy"
73
+ },
74
+ "4": {
75
+ "name": "punctuation.separator.key-value.squiffy"
76
+ }
77
+ },
78
+ "end": "^(?!\\s*$|\\t| {4}|\\s*@)",
79
+ "patterns": [
80
+ {
81
+ "include": "#ui-block"
82
+ },
83
+ {
84
+ "include": "#js-line"
85
+ },
86
+ {
87
+ "include": "#directive"
88
+ }
89
+ ]
90
+ },
91
+ "passage-header": {
92
+ "begin": "^\\s*(\\[)(?!\\[|snippet:)(.*)(\\])(:)\\s*$",
93
+ "beginCaptures": {
94
+ "0": {
95
+ "name": "markup.heading.passage.squiffy"
96
+ },
97
+ "1": {
98
+ "name": "punctuation.definition.heading.begin.squiffy"
99
+ },
100
+ "2": {
101
+ "name": "entity.name.function.passage.squiffy"
102
+ },
103
+ "3": {
104
+ "name": "punctuation.definition.heading.end.squiffy"
105
+ },
106
+ "4": {
107
+ "name": "punctuation.separator.key-value.squiffy"
108
+ }
109
+ },
110
+ "end": "^(?!\\s*$|\\t| {4}|\\s*@)",
111
+ "patterns": [
112
+ {
113
+ "include": "#ui-block"
114
+ },
115
+ {
116
+ "include": "#js-line"
117
+ },
118
+ {
119
+ "include": "#directive"
120
+ }
121
+ ]
122
+ },
123
+ "continue": {
124
+ "begin": "^\\s*(\\+\\+\\+)(.*)$",
125
+ "beginCaptures": {
126
+ "0": {
127
+ "name": "markup.heading.continue.squiffy"
128
+ },
129
+ "1": {
130
+ "name": "keyword.control.continue.squiffy"
131
+ },
132
+ "2": {
133
+ "name": "string.other.link.title.squiffy",
134
+ "patterns": [
135
+ {
136
+ "include": "#inline"
137
+ }
138
+ ]
139
+ }
140
+ },
141
+ "end": "^(?!\\s*$|\\t| {4}|\\s*@)",
142
+ "patterns": [
143
+ {
144
+ "include": "#ui-block"
145
+ },
146
+ {
147
+ "include": "#js-line"
148
+ },
149
+ {
150
+ "include": "#directive"
151
+ }
152
+ ]
153
+ },
154
+ "separator": {
155
+ "begin": "^\\s*(---)\\s*$",
156
+ "beginCaptures": {
157
+ "1": {
158
+ "name": "meta.separator.squiffy keyword.control.separator.squiffy"
159
+ }
160
+ },
161
+ "end": "^(?!\\s*$|\\t| {4}|\\s*@)",
162
+ "patterns": [
163
+ {
164
+ "include": "#ui-block"
165
+ },
166
+ {
167
+ "include": "#js-line"
168
+ },
169
+ {
170
+ "include": "#directive"
171
+ }
172
+ ]
173
+ },
174
+ "snippet": {
175
+ "comment": "A snippet's content is plain text up to the next section or snippet header. Passage headers inside it are just text.",
176
+ "begin": "^\\s*(\\[)(snippet)(:)\\s*(.+)(\\])(:)\\s*$",
177
+ "beginCaptures": {
178
+ "0": {
179
+ "name": "markup.heading.snippet.squiffy"
180
+ },
181
+ "1": {
182
+ "name": "punctuation.definition.heading.begin.squiffy"
183
+ },
184
+ "2": {
185
+ "name": "keyword.other.snippet.squiffy"
186
+ },
187
+ "3": {
188
+ "name": "punctuation.separator.squiffy"
189
+ },
190
+ "4": {
191
+ "name": "entity.name.type.snippet.squiffy"
192
+ },
193
+ "5": {
194
+ "name": "punctuation.definition.heading.end.squiffy"
195
+ },
196
+ "6": {
197
+ "name": "punctuation.separator.key-value.squiffy"
198
+ }
199
+ },
200
+ "end": "^(?=\\s*\\[\\[.*\\]\\]:\\s*$|\\s*\\[snippet:\\s*.+\\]:\\s*$)",
201
+ "contentName": "meta.snippet.body.squiffy",
202
+ "patterns": [
203
+ {
204
+ "include": "#markdown-block"
205
+ },
206
+ {
207
+ "include": "#inline"
208
+ }
209
+ ]
210
+ },
211
+ "ui-block": {
212
+ "comment": "@ui on its own starts a block of story-wide JavaScript and HTML, ended by ---.",
213
+ "begin": "^\\s*(@ui)\\s*$",
214
+ "beginCaptures": {
215
+ "1": {
216
+ "name": "keyword.control.directive.squiffy"
217
+ }
218
+ },
219
+ "end": "^(?=\\s*---\\s*$)",
220
+ "name": "meta.ui-block.squiffy",
221
+ "patterns": [
222
+ {
223
+ "include": "#js-line"
224
+ },
225
+ {
226
+ "include": "#inline"
227
+ }
228
+ ]
229
+ },
230
+ "js-line": {
231
+ "match": "^(\\t| {4})(.*)$",
232
+ "captures": {
233
+ "2": {
234
+ "name": "meta.embedded.block.javascript",
235
+ "patterns": [
236
+ {
237
+ "include": "source.js"
238
+ }
239
+ ]
240
+ }
241
+ }
242
+ },
243
+ "directive": {
244
+ "patterns": [
245
+ {
246
+ "comment": "One setter per line, so its value runs to the end of the line: @set score = 10, @set greeting := Hello, {{name}}!, @set not has_key",
247
+ "match": "^\\s*(@)(set|unset)\\s+(.*?)\\s*$",
248
+ "captures": {
249
+ "0": {
250
+ "name": "meta.directive.attribute.squiffy"
251
+ },
252
+ "1": {
253
+ "name": "punctuation.definition.directive.squiffy keyword.control.directive.squiffy"
254
+ },
255
+ "2": {
256
+ "name": "keyword.control.directive.squiffy"
257
+ },
258
+ "3": {
259
+ "patterns": [
260
+ {
261
+ "include": "#assignment"
262
+ }
263
+ ]
264
+ }
265
+ }
266
+ },
267
+ {
268
+ "match": "^\\s*(@)(inc|dec)\\s+(\\S+)(?:\\s+(\\d+))?\\s*$",
269
+ "captures": {
270
+ "0": {
271
+ "name": "meta.directive.attribute.squiffy"
272
+ },
273
+ "1": {
274
+ "name": "punctuation.definition.directive.squiffy keyword.control.directive.squiffy"
275
+ },
276
+ "2": {
277
+ "name": "keyword.control.directive.squiffy"
278
+ },
279
+ "3": {
280
+ "name": "variable.parameter.attribute.squiffy"
281
+ },
282
+ "4": {
283
+ "name": "constant.numeric.squiffy"
284
+ }
285
+ }
286
+ },
287
+ {
288
+ "match": "^\\s*(@)(title|start|import|ui)\\s+(.*?)\\s*$",
289
+ "captures": {
290
+ "0": {
291
+ "name": "meta.directive.squiffy"
292
+ },
293
+ "1": {
294
+ "name": "punctuation.definition.directive.squiffy keyword.control.directive.squiffy"
295
+ },
296
+ "2": {
297
+ "name": "keyword.control.directive.squiffy"
298
+ },
299
+ "3": {
300
+ "name": "string.unquoted.squiffy"
301
+ }
302
+ }
303
+ },
304
+ {
305
+ "match": "^\\s*(@)(clear|end)\\s*$",
306
+ "captures": {
307
+ "1": {
308
+ "name": "punctuation.definition.directive.squiffy keyword.control.directive.squiffy"
309
+ },
310
+ "2": {
311
+ "name": "keyword.control.directive.squiffy"
312
+ }
313
+ }
314
+ }
315
+ ]
316
+ },
317
+ "text": {
318
+ "patterns": [
319
+ {
320
+ "include": "#directive"
321
+ },
322
+ {
323
+ "include": "#markdown-block"
324
+ },
325
+ {
326
+ "include": "#inline"
327
+ }
328
+ ]
329
+ },
330
+ "inline": {
331
+ "patterns": [
332
+ {
333
+ "include": "#handlebars-comment"
334
+ },
335
+ {
336
+ "include": "#handlebars"
337
+ },
338
+ {
339
+ "include": "#html-comment"
340
+ },
341
+ {
342
+ "include": "#link"
343
+ },
344
+ {
345
+ "include": "#html-tag"
346
+ },
347
+ {
348
+ "include": "#markdown-inline"
349
+ }
350
+ ]
351
+ },
352
+ "link": {
353
+ "comment": "In the order the compiler tries them (compiler/src/text.ts).",
354
+ "patterns": [
355
+ {
356
+ "name": "meta.link.section.next.squiffy",
357
+ "match": "(\\[\\[)([^\\]]*?)(>)(\\]\\])",
358
+ "captures": {
359
+ "1": {
360
+ "name": "punctuation.definition.link.begin.squiffy"
361
+ },
362
+ "2": {
363
+ "name": "string.other.link.title.squiffy",
364
+ "patterns": [
365
+ {
366
+ "include": "#handlebars"
367
+ }
368
+ ]
369
+ },
370
+ "3": {
371
+ "name": "keyword.operator.next-section.squiffy"
372
+ },
373
+ "4": {
374
+ "name": "punctuation.definition.link.end.squiffy"
375
+ }
376
+ }
377
+ },
378
+ {
379
+ "name": "meta.link.section.squiffy",
380
+ "match": "(\\[\\[)([^\\]]*?)(\\]\\])(\\()(.*?)(\\))",
381
+ "captures": {
382
+ "1": {
383
+ "name": "punctuation.definition.link.begin.squiffy"
384
+ },
385
+ "2": {
386
+ "name": "string.other.link.title.squiffy",
387
+ "patterns": [
388
+ {
389
+ "include": "#handlebars"
390
+ }
391
+ ]
392
+ },
393
+ "3": {
394
+ "name": "punctuation.definition.link.end.squiffy"
395
+ },
396
+ "4": {
397
+ "name": "punctuation.definition.metadata.begin.squiffy"
398
+ },
399
+ "5": {
400
+ "patterns": [
401
+ {
402
+ "include": "#link-target"
403
+ }
404
+ ]
405
+ },
406
+ "6": {
407
+ "name": "punctuation.definition.metadata.end.squiffy"
408
+ }
409
+ }
410
+ },
411
+ {
412
+ "name": "meta.image.markdown.squiffy",
413
+ "match": "(!)(\\[)([^\\]]*?)(\\])(\\()(.*?)(\\))",
414
+ "captures": {
415
+ "1": {
416
+ "name": "punctuation.definition.link.image.squiffy"
417
+ },
418
+ "2": {
419
+ "name": "punctuation.definition.link.begin.squiffy"
420
+ },
421
+ "3": {
422
+ "name": "string.other.link.description.squiffy"
423
+ },
424
+ "4": {
425
+ "name": "punctuation.definition.link.end.squiffy"
426
+ },
427
+ "5": {
428
+ "name": "punctuation.definition.metadata.begin.squiffy"
429
+ },
430
+ "6": {
431
+ "name": "markup.underline.link.image.squiffy"
432
+ },
433
+ "7": {
434
+ "name": "punctuation.definition.metadata.end.squiffy"
435
+ }
436
+ }
437
+ },
438
+ {
439
+ "name": "meta.link.url.squiffy",
440
+ "match": "(\\[)([^\\]]*?)(\\])(\\()(https?://.*?)(\\))",
441
+ "captures": {
442
+ "1": {
443
+ "name": "punctuation.definition.link.begin.squiffy"
444
+ },
445
+ "2": {
446
+ "name": "string.other.link.title.squiffy"
447
+ },
448
+ "3": {
449
+ "name": "punctuation.definition.link.end.squiffy"
450
+ },
451
+ "4": {
452
+ "name": "punctuation.definition.metadata.begin.squiffy"
453
+ },
454
+ "5": {
455
+ "name": "markup.underline.link.squiffy"
456
+ },
457
+ "6": {
458
+ "name": "punctuation.definition.metadata.end.squiffy"
459
+ }
460
+ }
461
+ },
462
+ {
463
+ "name": "meta.link.passage.squiffy",
464
+ "match": "(\\[)([^\\]]*?)(\\])(\\()(.*?)(\\))",
465
+ "captures": {
466
+ "1": {
467
+ "name": "punctuation.definition.link.begin.squiffy"
468
+ },
469
+ "2": {
470
+ "name": "string.other.link.title.squiffy",
471
+ "patterns": [
472
+ {
473
+ "include": "#handlebars"
474
+ }
475
+ ]
476
+ },
477
+ "3": {
478
+ "name": "punctuation.definition.link.end.squiffy"
479
+ },
480
+ "4": {
481
+ "name": "punctuation.definition.metadata.begin.squiffy"
482
+ },
483
+ "5": {
484
+ "patterns": [
485
+ {
486
+ "include": "#link-target"
487
+ }
488
+ ]
489
+ },
490
+ "6": {
491
+ "name": "punctuation.definition.metadata.end.squiffy"
492
+ }
493
+ }
494
+ },
495
+ {
496
+ "name": "meta.link.section.squiffy",
497
+ "match": "(\\[\\[)(.*?)(\\]\\])",
498
+ "captures": {
499
+ "1": {
500
+ "name": "punctuation.definition.link.begin.squiffy"
501
+ },
502
+ "2": {
503
+ "name": "string.other.link.title.squiffy markup.underline.link.squiffy",
504
+ "patterns": [
505
+ {
506
+ "include": "#handlebars"
507
+ }
508
+ ]
509
+ },
510
+ "3": {
511
+ "name": "punctuation.definition.link.end.squiffy"
512
+ }
513
+ }
514
+ },
515
+ {
516
+ "name": "meta.link.passage.squiffy",
517
+ "match": "(\\[)([^\\]]*?)(\\])",
518
+ "captures": {
519
+ "1": {
520
+ "name": "punctuation.definition.link.begin.squiffy"
521
+ },
522
+ "2": {
523
+ "name": "string.other.link.title.squiffy markup.underline.link.squiffy",
524
+ "patterns": [
525
+ {
526
+ "include": "#handlebars"
527
+ }
528
+ ]
529
+ },
530
+ "3": {
531
+ "name": "punctuation.definition.link.end.squiffy"
532
+ }
533
+ }
534
+ }
535
+ ]
536
+ },
537
+ "link-target": {
538
+ "comment": "A link's target, then any attribute setters after a comma: [[text]](section, score=1, not visited).",
539
+ "match": "\\s*([^,]*?)\\s*(?:(,)(.*))?$",
540
+ "captures": {
541
+ "1": {
542
+ "name": "markup.underline.link.squiffy",
543
+ "patterns": [
544
+ {
545
+ "match": ">",
546
+ "name": "keyword.operator.next-section.squiffy"
547
+ }
548
+ ]
549
+ },
550
+ "2": {
551
+ "name": "punctuation.separator.squiffy"
552
+ },
553
+ "3": {
554
+ "patterns": [
555
+ {
556
+ "include": "#assignments"
557
+ }
558
+ ]
559
+ }
560
+ }
561
+ },
562
+ "assignments": {
563
+ "comment": "Comma-separated setters after a link's target: [[text]](section, score+=1, not visited)",
564
+ "patterns": [
565
+ {
566
+ "match": "([^,]+)|(,)",
567
+ "captures": {
568
+ "1": {
569
+ "patterns": [
570
+ {
571
+ "include": "#assignment"
572
+ }
573
+ ]
574
+ },
575
+ "2": {
576
+ "name": "punctuation.separator.squiffy"
577
+ }
578
+ }
579
+ }
580
+ ]
581
+ },
582
+ "assignment": {
583
+ "comment": "One setter, as the runtime reads it (setAttribute in runtime/src/squiffy.runtime.ts): a = 1, a += 1 (or -=, *=, /=), a := text with {{...}}, a = @b, not a, a. Patterns inside a capture can't anchor to its start (^ and \\G never match there), but $ is its end, and the earliest match wins.",
584
+ "patterns": [
585
+ {
586
+ "match": "\\s*(\\w*)\\s*(:=)(.*)$",
587
+ "captures": {
588
+ "1": {
589
+ "name": "variable.parameter.attribute.squiffy"
590
+ },
591
+ "2": {
592
+ "name": "keyword.operator.assignment.squiffy"
593
+ },
594
+ "3": {
595
+ "name": "string.unquoted.squiffy",
596
+ "patterns": [
597
+ {
598
+ "include": "#handlebars"
599
+ }
600
+ ]
601
+ }
602
+ }
603
+ },
604
+ {
605
+ "match": "\\s*(\\w*)\\s*([+\\-*/]?=)\\s*(.*?)\\s*$",
606
+ "captures": {
607
+ "1": {
608
+ "name": "variable.parameter.attribute.squiffy"
609
+ },
610
+ "2": {
611
+ "name": "keyword.operator.assignment.squiffy"
612
+ },
613
+ "3": {
614
+ "patterns": [
615
+ {
616
+ "include": "#value"
617
+ }
618
+ ]
619
+ }
620
+ }
621
+ },
622
+ {
623
+ "match": "\\s*(?:(not)\\s+)?(.*?)\\s*$",
624
+ "captures": {
625
+ "1": {
626
+ "name": "keyword.operator.logical.squiffy"
627
+ },
628
+ "2": {
629
+ "name": "variable.parameter.attribute.squiffy"
630
+ }
631
+ }
632
+ }
633
+ ]
634
+ },
635
+ "value": {
636
+ "patterns": [
637
+ {
638
+ "match": "-?\\d+(?:\\.\\d+)?$",
639
+ "name": "constant.numeric.squiffy"
640
+ },
641
+ {
642
+ "match": "(?:true|false)$",
643
+ "name": "constant.language.boolean.squiffy"
644
+ },
645
+ {
646
+ "match": "@\\w+$",
647
+ "name": "variable.parameter.attribute.squiffy"
648
+ },
649
+ {
650
+ "match": ".+$",
651
+ "name": "string.unquoted.squiffy"
652
+ }
653
+ ]
654
+ },
655
+ "handlebars-comment": {
656
+ "patterns": [
657
+ {
658
+ "begin": "\\{\\{!--",
659
+ "end": "--\\}\\}",
660
+ "name": "comment.block.handlebars.squiffy"
661
+ },
662
+ {
663
+ "begin": "\\{\\{!",
664
+ "end": "\\}\\}",
665
+ "name": "comment.block.handlebars.squiffy"
666
+ }
667
+ ]
668
+ },
669
+ "handlebars": {
670
+ "patterns": [
671
+ {
672
+ "comment": "Block helper open {{#if ...}} and close {{/if}}",
673
+ "begin": "(\\{\\{~?)\\s*([#/][\\w-]+)",
674
+ "beginCaptures": {
675
+ "1": {
676
+ "name": "support.constant.handlebars.squiffy punctuation.section.embedded.begin.handlebars.squiffy"
677
+ },
678
+ "2": {
679
+ "name": "keyword.control.block.handlebars.squiffy"
680
+ }
681
+ },
682
+ "end": "~?\\}\\}",
683
+ "endCaptures": {
684
+ "0": {
685
+ "name": "support.constant.handlebars.squiffy punctuation.section.embedded.end.handlebars.squiffy"
686
+ }
687
+ },
688
+ "name": "meta.embedded.expression.handlebars.squiffy",
689
+ "patterns": [
690
+ {
691
+ "include": "#handlebars-expression"
692
+ }
693
+ ]
694
+ },
695
+ {
696
+ "comment": "{{else}} and {{else if ...}}",
697
+ "begin": "(\\{\\{~?)\\s*(else)\\b(?:\\s+(if|unless)\\b)?",
698
+ "beginCaptures": {
699
+ "1": {
700
+ "name": "support.constant.handlebars.squiffy punctuation.section.embedded.begin.handlebars.squiffy"
701
+ },
702
+ "2": {
703
+ "name": "keyword.control.block.handlebars.squiffy"
704
+ },
705
+ "3": {
706
+ "name": "keyword.control.block.handlebars.squiffy"
707
+ }
708
+ },
709
+ "end": "~?\\}\\}",
710
+ "endCaptures": {
711
+ "0": {
712
+ "name": "support.constant.handlebars.squiffy punctuation.section.embedded.end.handlebars.squiffy"
713
+ }
714
+ },
715
+ "name": "meta.embedded.expression.handlebars.squiffy",
716
+ "patterns": [
717
+ {
718
+ "include": "#handlebars-expression"
719
+ }
720
+ ]
721
+ },
722
+ {
723
+ "comment": "{{helper args}}, or {{attribute}} on its own",
724
+ "begin": "(\\{\\{\\{?~?)\\s*(?:([\\w.-]+)(?=\\s)|([\\w.-]+)(?=\\s*~?\\}))?",
725
+ "beginCaptures": {
726
+ "1": {
727
+ "name": "support.constant.handlebars.squiffy punctuation.section.embedded.begin.handlebars.squiffy"
728
+ },
729
+ "2": {
730
+ "name": "support.function.helper.handlebars.squiffy"
731
+ },
732
+ "3": {
733
+ "name": "variable.parameter.attribute.handlebars.squiffy"
734
+ }
735
+ },
736
+ "end": "~?\\}\\}\\}?",
737
+ "endCaptures": {
738
+ "0": {
739
+ "name": "support.constant.handlebars.squiffy punctuation.section.embedded.end.handlebars.squiffy"
740
+ }
741
+ },
742
+ "name": "meta.embedded.expression.handlebars.squiffy",
743
+ "patterns": [
744
+ {
745
+ "include": "#handlebars-expression"
746
+ }
747
+ ]
748
+ }
749
+ ]
750
+ },
751
+ "handlebars-expression": {
752
+ "patterns": [
753
+ {
754
+ "begin": "(\\()\\s*([\\w.-]+)?",
755
+ "beginCaptures": {
756
+ "1": {
757
+ "name": "punctuation.section.parens.begin.handlebars.squiffy"
758
+ },
759
+ "2": {
760
+ "name": "support.function.helper.handlebars.squiffy"
761
+ }
762
+ },
763
+ "end": "\\)",
764
+ "endCaptures": {
765
+ "0": {
766
+ "name": "punctuation.section.parens.end.handlebars.squiffy"
767
+ }
768
+ },
769
+ "patterns": [
770
+ {
771
+ "include": "#handlebars-expression"
772
+ }
773
+ ]
774
+ },
775
+ {
776
+ "begin": "\"",
777
+ "end": "\"",
778
+ "name": "string.quoted.double.handlebars.squiffy"
779
+ },
780
+ {
781
+ "begin": "'",
782
+ "end": "'",
783
+ "name": "string.quoted.single.handlebars.squiffy"
784
+ },
785
+ {
786
+ "match": "-?\\b\\d+(?:\\.\\d+)?\\b",
787
+ "name": "constant.numeric.handlebars.squiffy"
788
+ },
789
+ {
790
+ "match": "\\b(?:true|false|null|undefined)\\b",
791
+ "name": "constant.language.handlebars.squiffy"
792
+ },
793
+ {
794
+ "match": "\\b(?:and|or|not)\\b",
795
+ "name": "keyword.operator.logical.handlebars.squiffy"
796
+ },
797
+ {
798
+ "match": "!=|>=|<=|=(?!=)|>|<",
799
+ "name": "keyword.operator.comparison.handlebars.squiffy"
800
+ },
801
+ {
802
+ "match": "([\\w-]+)(=)",
803
+ "captures": {
804
+ "1": {
805
+ "name": "entity.other.attribute-name.handlebars.squiffy"
806
+ },
807
+ "2": {
808
+ "name": "punctuation.separator.key-value.handlebars.squiffy"
809
+ }
810
+ }
811
+ },
812
+ {
813
+ "match": "\\bas\\s*\\|[^|]*\\|",
814
+ "name": "variable.parameter.block.handlebars.squiffy"
815
+ },
816
+ {
817
+ "match": "\\[[^\\]]*\\]",
818
+ "name": "variable.parameter.attribute.handlebars.squiffy"
819
+ },
820
+ {
821
+ "match": "@?[\\w.-]+",
822
+ "name": "variable.parameter.attribute.handlebars.squiffy"
823
+ }
824
+ ]
825
+ },
826
+ "html-comment": {
827
+ "begin": "<!--",
828
+ "end": "-->",
829
+ "name": "comment.block.html.squiffy"
830
+ },
831
+ "html-tag": {
832
+ "begin": "(</?)([A-Za-z][\\w:-]*)",
833
+ "beginCaptures": {
834
+ "1": {
835
+ "name": "punctuation.definition.tag.begin.html.squiffy"
836
+ },
837
+ "2": {
838
+ "name": "entity.name.tag.html.squiffy"
839
+ }
840
+ },
841
+ "end": "/?>",
842
+ "endCaptures": {
843
+ "0": {
844
+ "name": "punctuation.definition.tag.end.html.squiffy"
845
+ }
846
+ },
847
+ "name": "meta.tag.html.squiffy",
848
+ "patterns": [
849
+ {
850
+ "include": "#handlebars"
851
+ },
852
+ {
853
+ "match": "[\\w:-]+",
854
+ "name": "entity.other.attribute-name.html.squiffy"
855
+ },
856
+ {
857
+ "match": "=",
858
+ "name": "punctuation.separator.key-value.html.squiffy"
859
+ },
860
+ {
861
+ "begin": "\"",
862
+ "end": "\"",
863
+ "name": "string.quoted.double.html.squiffy",
864
+ "patterns": [
865
+ {
866
+ "include": "#handlebars"
867
+ }
868
+ ]
869
+ },
870
+ {
871
+ "begin": "'",
872
+ "end": "'",
873
+ "name": "string.quoted.single.html.squiffy",
874
+ "patterns": [
875
+ {
876
+ "include": "#handlebars"
877
+ }
878
+ ]
879
+ }
880
+ ]
881
+ },
882
+ "markdown-block": {
883
+ "patterns": [
884
+ {
885
+ "match": "^\\s*(#{1,6})\\s+(.*)$",
886
+ "captures": {
887
+ "0": {
888
+ "name": "markup.heading.markdown.squiffy"
889
+ },
890
+ "1": {
891
+ "name": "punctuation.definition.heading.markdown.squiffy"
892
+ },
893
+ "2": {
894
+ "name": "entity.name.section.markdown.squiffy",
895
+ "patterns": [
896
+ {
897
+ "include": "#inline"
898
+ }
899
+ ]
900
+ }
901
+ }
902
+ },
903
+ {
904
+ "match": "^\\s*([*+-]|\\d+\\.)(?=\\s)",
905
+ "captures": {
906
+ "1": {
907
+ "name": "punctuation.definition.list.begin.markdown.squiffy"
908
+ }
909
+ }
910
+ },
911
+ {
912
+ "match": "^\\s*(>)(?=\\s)",
913
+ "captures": {
914
+ "1": {
915
+ "name": "punctuation.definition.quote.begin.markdown.squiffy"
916
+ }
917
+ }
918
+ }
919
+ ]
920
+ },
921
+ "markdown-inline": {
922
+ "patterns": [
923
+ {
924
+ "match": "(\\*\\*|__)(?=\\S)(.+?)(?<=\\S)(\\1)",
925
+ "captures": {
926
+ "0": {
927
+ "name": "markup.bold.markdown.squiffy"
928
+ },
929
+ "1": {
930
+ "name": "punctuation.definition.bold.markdown.squiffy"
931
+ },
932
+ "3": {
933
+ "name": "punctuation.definition.bold.markdown.squiffy"
934
+ }
935
+ }
936
+ },
937
+ {
938
+ "match": "(?<![\\w*])(\\*)(?=[^\\s*])(.+?)(?<=[^\\s*])(\\*)(?![\\w*])",
939
+ "captures": {
940
+ "0": {
941
+ "name": "markup.italic.markdown.squiffy"
942
+ },
943
+ "1": {
944
+ "name": "punctuation.definition.italic.markdown.squiffy"
945
+ },
946
+ "3": {
947
+ "name": "punctuation.definition.italic.markdown.squiffy"
948
+ }
949
+ }
950
+ },
951
+ {
952
+ "match": "(?<!\\w)(_)(?=\\S)(.+?)(?<=\\S)(_)(?!\\w)",
953
+ "captures": {
954
+ "0": {
955
+ "name": "markup.italic.markdown.squiffy"
956
+ },
957
+ "1": {
958
+ "name": "punctuation.definition.italic.markdown.squiffy"
959
+ },
960
+ "3": {
961
+ "name": "punctuation.definition.italic.markdown.squiffy"
962
+ }
963
+ }
964
+ },
965
+ {
966
+ "match": "(`)([^`]+)(`)",
967
+ "name": "markup.inline.raw.markdown.squiffy"
968
+ }
969
+ ]
970
+ }
971
+ }
972
+ }