@boundaryml/baml-grammar 0.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,4781 @@
1
+ // Generated by scripts/build.ts from src/baml.ts. Do not edit.
2
+ // The grammar is inlined as a JS object literal so consumers never import
3
+ // JSON (avoids `with { type: "json" }` import-attribute incompatibilities
4
+ // across Vite, Metro, and nodenext).
5
+ const grammar = {
6
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
7
+ "name": "baml",
8
+ "scopeName": "source.baml",
9
+ "fileTypes": [
10
+ "baml"
11
+ ],
12
+ "patterns": [
13
+ {
14
+ "include": "#comments"
15
+ },
16
+ {
17
+ "include": "#client"
18
+ },
19
+ {
20
+ "include": "#retry-policy"
21
+ },
22
+ {
23
+ "include": "#generator"
24
+ },
25
+ {
26
+ "include": "#template-string"
27
+ },
28
+ {
29
+ "include": "#block-attribute"
30
+ },
31
+ {
32
+ "include": "#enum"
33
+ },
34
+ {
35
+ "include": "#type-alias"
36
+ },
37
+ {
38
+ "include": "#implements-for"
39
+ },
40
+ {
41
+ "include": "#interface"
42
+ },
43
+ {
44
+ "include": "#class"
45
+ },
46
+ {
47
+ "include": "#function"
48
+ },
49
+ {
50
+ "include": "#testset"
51
+ },
52
+ {
53
+ "include": "#test"
54
+ },
55
+ {
56
+ "include": "#let-statement"
57
+ },
58
+ {
59
+ "include": "#semicolon"
60
+ }
61
+ ],
62
+ "repository": {
63
+ "accessor-dot": {
64
+ "name": "punctuation.accessor.baml",
65
+ "match": "\\."
66
+ },
67
+ "array-destructure-pattern": {
68
+ "name": "meta.pattern.destructure.array.baml",
69
+ "begin": "(?:\\b((?:let|const))\\b\\s*)?(\\[)",
70
+ "beginCaptures": {
71
+ "1": {
72
+ "name": "keyword.declaration.binding.baml"
73
+ },
74
+ "2": {
75
+ "name": "punctuation.definition.array.begin.baml"
76
+ }
77
+ },
78
+ "end": "(\\])(?:\\s*(:)\\s*((?:(?!\\s*(?:in\\b|if\\b|=>|=|[,}\\)])).)+))?",
79
+ "endCaptures": {
80
+ "1": {
81
+ "name": "punctuation.definition.array.end.baml"
82
+ },
83
+ "2": {
84
+ "name": "punctuation.separator.colon.baml"
85
+ },
86
+ "3": {
87
+ "patterns": [
88
+ {
89
+ "include": "#comments"
90
+ },
91
+ {
92
+ "include": "#type-expression"
93
+ }
94
+ ]
95
+ }
96
+ },
97
+ "patterns": [
98
+ {
99
+ "include": "#comments"
100
+ },
101
+ {
102
+ "include": "#array-destructure-rest-operator"
103
+ },
104
+ {
105
+ "include": "#pattern"
106
+ },
107
+ {
108
+ "include": "#comma"
109
+ }
110
+ ]
111
+ },
112
+ "array-destructure-rest-operator": {
113
+ "name": "keyword.operator.rest.baml",
114
+ "match": "\\.\\."
115
+ },
116
+ "array-expression": {
117
+ "name": "meta.expression.array.baml",
118
+ "begin": "\\[",
119
+ "beginCaptures": {
120
+ "0": {
121
+ "name": "punctuation.definition.array.begin.baml"
122
+ }
123
+ },
124
+ "end": "\\]",
125
+ "endCaptures": {
126
+ "0": {
127
+ "name": "punctuation.definition.array.end.baml"
128
+ }
129
+ },
130
+ "patterns": [
131
+ {
132
+ "include": "#comments"
133
+ },
134
+ {
135
+ "include": "#expression"
136
+ },
137
+ {
138
+ "include": "#comma"
139
+ }
140
+ ]
141
+ },
142
+ "assignment-operator": {
143
+ "name": "keyword.operator.assignment.baml",
144
+ "match": "="
145
+ },
146
+ "associated-type": {
147
+ "name": "meta.associated-type.baml",
148
+ "begin": "(?:^\\s*|(?<=\\{)\\s*)(type)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
149
+ "beginCaptures": {
150
+ "1": {
151
+ "name": "keyword.declaration.associated-type.baml"
152
+ },
153
+ "2": {
154
+ "name": "entity.name.type.associated.baml"
155
+ }
156
+ },
157
+ "end": "(?<=;)|(?=\\r?\\n|\\})",
158
+ "patterns": [
159
+ {
160
+ "include": "#comments"
161
+ },
162
+ {
163
+ "include": "#associated-type-extends"
164
+ },
165
+ {
166
+ "include": "#assignment-operator"
167
+ },
168
+ {
169
+ "include": "#type-expression"
170
+ },
171
+ {
172
+ "include": "#semicolon"
173
+ }
174
+ ]
175
+ },
176
+ "associated-type-extends": {
177
+ "name": "keyword.operator.extends.baml",
178
+ "match": "\\bextends\\b"
179
+ },
180
+ "associated-type-projection": {
181
+ "name": "meta.type.associated-projection.baml",
182
+ "begin": "\\((?=[^)\\r\\n]*\\bas\\b)",
183
+ "beginCaptures": {
184
+ "0": {
185
+ "name": "punctuation.definition.type.begin.baml"
186
+ }
187
+ },
188
+ "end": "(\\))\\s*(\\.)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
189
+ "endCaptures": {
190
+ "1": {
191
+ "name": "punctuation.definition.type.end.baml"
192
+ },
193
+ "2": {
194
+ "name": "punctuation.accessor.baml"
195
+ },
196
+ "3": {
197
+ "name": "entity.name.type.associated.baml"
198
+ }
199
+ },
200
+ "patterns": [
201
+ {
202
+ "include": "#comments"
203
+ },
204
+ {
205
+ "include": "#type-as-operator"
206
+ },
207
+ {
208
+ "include": "#type-expression"
209
+ }
210
+ ]
211
+ },
212
+ "attribute": {
213
+ "name": "meta.attribute.baml",
214
+ "begin": "(@)(?!@)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b",
215
+ "beginCaptures": {
216
+ "1": {
217
+ "name": "punctuation.definition.annotation.baml storage.type.annotation.baml"
218
+ },
219
+ "2": {
220
+ "patterns": [
221
+ {
222
+ "include": "#accessor-dot"
223
+ },
224
+ {
225
+ "include": "#attribute-path-segment"
226
+ }
227
+ ]
228
+ }
229
+ },
230
+ "end": "(?<=\\))|(?=\\s*@|\\s*,|\\s*\\}|\\s+\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|\\r?\\n\\s*(?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|@@|\\}))",
231
+ "patterns": [
232
+ {
233
+ "include": "#comments"
234
+ },
235
+ {
236
+ "include": "#attribute-arguments"
237
+ }
238
+ ]
239
+ },
240
+ "attribute-arguments": {
241
+ "name": "meta.attribute.arguments.baml",
242
+ "begin": "\\(",
243
+ "beginCaptures": {
244
+ "0": {
245
+ "name": "punctuation.definition.annotation-arguments.begin.bracket.round.baml"
246
+ }
247
+ },
248
+ "end": "\\)",
249
+ "endCaptures": {
250
+ "0": {
251
+ "name": "punctuation.definition.annotation-arguments.end.bracket.round.baml"
252
+ }
253
+ },
254
+ "patterns": [
255
+ {
256
+ "include": "#comments"
257
+ },
258
+ {
259
+ "include": "#attribute-expression-block"
260
+ },
261
+ {
262
+ "include": "#literal"
263
+ },
264
+ {
265
+ "include": "#attribute-unquoted-string"
266
+ },
267
+ {
268
+ "include": "#comma"
269
+ }
270
+ ]
271
+ },
272
+ "attribute-expression-block": {
273
+ "name": "meta.attribute.expression.baml",
274
+ "begin": "\\{\\{",
275
+ "beginCaptures": {
276
+ "0": {
277
+ "name": "punctuation.section.expression.begin.baml"
278
+ }
279
+ },
280
+ "end": "\\}\\}",
281
+ "endCaptures": {
282
+ "0": {
283
+ "name": "punctuation.section.expression.end.baml"
284
+ }
285
+ },
286
+ "patterns": [
287
+ {
288
+ "include": "#comments"
289
+ },
290
+ {
291
+ "include": "#expression"
292
+ }
293
+ ]
294
+ },
295
+ "attribute-path-segment": {
296
+ "name": "storage.type.annotation.baml",
297
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
298
+ },
299
+ "attribute-unquoted-string": {
300
+ "name": "string.unquoted.baml",
301
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
302
+ },
303
+ "await-expression": {
304
+ "name": "keyword.operator.await.baml",
305
+ "match": "\\bawait\\b"
306
+ },
307
+ "backtick-else": {
308
+ "name": "meta.interpolation.control.else.baml",
309
+ "match": "(\\$\\{)\\s*(else)\\s*(\\})",
310
+ "captures": {
311
+ "1": {
312
+ "name": "punctuation.section.interpolation.begin.baml"
313
+ },
314
+ "2": {
315
+ "name": "keyword.control.conditional.baml"
316
+ },
317
+ "3": {
318
+ "name": "punctuation.section.interpolation.end.baml"
319
+ }
320
+ }
321
+ },
322
+ "backtick-else-if": {
323
+ "name": "meta.interpolation.control.else-if.baml",
324
+ "begin": "(\\$\\{)\\s*(else)\\b\\s*(if)\\b",
325
+ "beginCaptures": {
326
+ "1": {
327
+ "name": "punctuation.section.interpolation.begin.baml"
328
+ },
329
+ "2": {
330
+ "name": "keyword.control.conditional.baml"
331
+ },
332
+ "3": {
333
+ "name": "keyword.control.conditional.baml"
334
+ }
335
+ },
336
+ "end": "\\}",
337
+ "endCaptures": {
338
+ "0": {
339
+ "name": "punctuation.section.interpolation.end.baml"
340
+ }
341
+ },
342
+ "patterns": [
343
+ {
344
+ "include": "#comments"
345
+ },
346
+ {
347
+ "include": "#backtick-else-if-condition"
348
+ }
349
+ ]
350
+ },
351
+ "backtick-else-if-condition": {
352
+ "name": "meta.if.condition.baml",
353
+ "begin": "\\G\\s*",
354
+ "end": "(?=\\})",
355
+ "patterns": [
356
+ {
357
+ "include": "#comments"
358
+ },
359
+ {
360
+ "include": "#condition-expression"
361
+ }
362
+ ]
363
+ },
364
+ "backtick-endfor": {
365
+ "name": "meta.interpolation.control.endfor.baml",
366
+ "match": "(\\$\\{)\\s*(endfor)\\s*(\\})",
367
+ "captures": {
368
+ "1": {
369
+ "name": "punctuation.section.interpolation.begin.baml"
370
+ },
371
+ "2": {
372
+ "name": "keyword.control.loop.endfor.baml"
373
+ },
374
+ "3": {
375
+ "name": "punctuation.section.interpolation.end.baml"
376
+ }
377
+ }
378
+ },
379
+ "backtick-endif": {
380
+ "name": "meta.interpolation.control.endif.baml",
381
+ "match": "(\\$\\{)\\s*(endif)\\s*(\\})",
382
+ "captures": {
383
+ "1": {
384
+ "name": "punctuation.section.interpolation.begin.baml"
385
+ },
386
+ "2": {
387
+ "name": "keyword.control.conditional.endif.baml"
388
+ },
389
+ "3": {
390
+ "name": "punctuation.section.interpolation.end.baml"
391
+ }
392
+ }
393
+ },
394
+ "backtick-expression-interpolation": {
395
+ "name": "meta.interpolation.baml",
396
+ "begin": "(\\$\\{)",
397
+ "beginCaptures": {
398
+ "1": {
399
+ "name": "punctuation.section.interpolation.begin.baml"
400
+ }
401
+ },
402
+ "end": "\\}",
403
+ "endCaptures": {
404
+ "0": {
405
+ "name": "punctuation.section.interpolation.end.baml"
406
+ }
407
+ },
408
+ "patterns": [
409
+ {
410
+ "include": "#comments"
411
+ },
412
+ {
413
+ "include": "#backtick-interpolation-let-statement"
414
+ },
415
+ {
416
+ "include": "#block-contents"
417
+ },
418
+ {
419
+ "include": "#expression"
420
+ },
421
+ {
422
+ "include": "#semicolon"
423
+ }
424
+ ]
425
+ },
426
+ "backtick-for-c-style-let-initializer": {
427
+ "name": "meta.for.initializer.baml",
428
+ "begin": "(?=(?:let|const)\\b)",
429
+ "end": "(?=;)",
430
+ "patterns": [
431
+ {
432
+ "include": "#comments"
433
+ },
434
+ {
435
+ "include": "#pattern"
436
+ },
437
+ {
438
+ "include": "#let-else-clause"
439
+ },
440
+ {
441
+ "include": "#expression"
442
+ }
443
+ ]
444
+ },
445
+ "backtick-for-open": {
446
+ "name": "meta.interpolation.control.for.baml",
447
+ "begin": "(\\$\\{)\\s*(for)\\b",
448
+ "beginCaptures": {
449
+ "1": {
450
+ "name": "punctuation.section.interpolation.begin.baml"
451
+ },
452
+ "2": {
453
+ "name": "keyword.control.loop.for.baml"
454
+ }
455
+ },
456
+ "end": "\\}",
457
+ "endCaptures": {
458
+ "0": {
459
+ "name": "punctuation.section.interpolation.end.baml"
460
+ }
461
+ },
462
+ "patterns": [
463
+ {
464
+ "include": "#comments"
465
+ },
466
+ {
467
+ "include": "#backtick-for-parenthesized-in-header"
468
+ },
469
+ {
470
+ "include": "#backtick-for-parenthesized-c-style-header"
471
+ },
472
+ {
473
+ "include": "#backtick-for-unparenthesized-header"
474
+ }
475
+ ]
476
+ },
477
+ "backtick-for-parenthesized-c-style-header": {
478
+ "name": "meta.for.header.baml",
479
+ "begin": "\\G\\s*(\\()",
480
+ "beginCaptures": {
481
+ "1": {
482
+ "name": "punctuation.definition.for-header.begin.baml"
483
+ }
484
+ },
485
+ "end": "\\)(?=\\s*\\})",
486
+ "endCaptures": {
487
+ "0": {
488
+ "name": "punctuation.definition.for-header.end.baml"
489
+ }
490
+ },
491
+ "patterns": [
492
+ {
493
+ "include": "#comments"
494
+ },
495
+ {
496
+ "include": "#backtick-for-c-style-let-initializer"
497
+ },
498
+ {
499
+ "include": "#semicolon"
500
+ },
501
+ {
502
+ "include": "#expression"
503
+ }
504
+ ]
505
+ },
506
+ "backtick-for-parenthesized-in-header": {
507
+ "name": "meta.for.header.baml",
508
+ "begin": "\\G\\s*(\\()(?=\\s*(?:let|const)\\b(?:(?![=;]).)*\\bin\\b)",
509
+ "beginCaptures": {
510
+ "1": {
511
+ "name": "punctuation.definition.for-header.begin.baml"
512
+ }
513
+ },
514
+ "end": "\\)(?=\\s*\\})",
515
+ "endCaptures": {
516
+ "0": {
517
+ "name": "punctuation.definition.for-header.end.baml"
518
+ }
519
+ },
520
+ "patterns": [
521
+ {
522
+ "include": "#comments"
523
+ },
524
+ {
525
+ "include": "#for-in-pattern"
526
+ },
527
+ {
528
+ "include": "#for-in-keyword"
529
+ },
530
+ {
531
+ "include": "#expression"
532
+ }
533
+ ]
534
+ },
535
+ "backtick-for-unparenthesized-header": {
536
+ "name": "meta.for.header.baml",
537
+ "begin": "\\G\\s*(?=(?:let|const)\\b)",
538
+ "end": "(?=\\})",
539
+ "patterns": [
540
+ {
541
+ "include": "#comments"
542
+ },
543
+ {
544
+ "include": "#for-in-pattern"
545
+ },
546
+ {
547
+ "include": "#for-in-keyword"
548
+ },
549
+ {
550
+ "include": "#condition-expression"
551
+ }
552
+ ]
553
+ },
554
+ "backtick-if-condition": {
555
+ "name": "meta.if.condition.baml",
556
+ "begin": "\\G\\s*",
557
+ "end": "(?=\\})",
558
+ "patterns": [
559
+ {
560
+ "include": "#comments"
561
+ },
562
+ {
563
+ "include": "#condition-expression"
564
+ }
565
+ ]
566
+ },
567
+ "backtick-if-open": {
568
+ "name": "meta.interpolation.control.if.baml",
569
+ "begin": "(\\$\\{)\\s*(if)\\b(?=(?:(?![\\{\\}]).)*\\})",
570
+ "beginCaptures": {
571
+ "1": {
572
+ "name": "punctuation.section.interpolation.begin.baml"
573
+ },
574
+ "2": {
575
+ "name": "keyword.control.conditional.baml"
576
+ }
577
+ },
578
+ "end": "\\}",
579
+ "endCaptures": {
580
+ "0": {
581
+ "name": "punctuation.section.interpolation.end.baml"
582
+ }
583
+ },
584
+ "patterns": [
585
+ {
586
+ "include": "#comments"
587
+ },
588
+ {
589
+ "include": "#backtick-if-condition"
590
+ }
591
+ ]
592
+ },
593
+ "backtick-interpolation": {
594
+ "patterns": [
595
+ {
596
+ "include": "#backtick-for-open"
597
+ },
598
+ {
599
+ "include": "#backtick-else-if"
600
+ },
601
+ {
602
+ "include": "#backtick-if-open"
603
+ },
604
+ {
605
+ "include": "#backtick-else"
606
+ },
607
+ {
608
+ "include": "#backtick-endfor"
609
+ },
610
+ {
611
+ "include": "#backtick-endif"
612
+ },
613
+ {
614
+ "include": "#backtick-expression-interpolation"
615
+ }
616
+ ]
617
+ },
618
+ "backtick-interpolation-let-pattern": {
619
+ "name": "meta.pattern.statement.baml",
620
+ "begin": "\\G\\s*",
621
+ "end": "(?=\\s*=)",
622
+ "patterns": [
623
+ {
624
+ "include": "#comments"
625
+ },
626
+ {
627
+ "include": "#pattern"
628
+ }
629
+ ]
630
+ },
631
+ "backtick-interpolation-let-statement": {
632
+ "name": "meta.statement.let.baml",
633
+ "begin": "(?=(?:let|const)\\b)",
634
+ "end": "(?=;|\\})",
635
+ "patterns": [
636
+ {
637
+ "include": "#comments"
638
+ },
639
+ {
640
+ "include": "#backtick-interpolation-let-pattern"
641
+ },
642
+ {
643
+ "include": "#assignment-operator"
644
+ },
645
+ {
646
+ "include": "#expression"
647
+ }
648
+ ]
649
+ },
650
+ "backtick-string": {
651
+ "patterns": [
652
+ {
653
+ "include": "#backtick-string-8"
654
+ },
655
+ {
656
+ "include": "#backtick-string-7"
657
+ },
658
+ {
659
+ "include": "#backtick-string-6"
660
+ },
661
+ {
662
+ "include": "#backtick-string-5"
663
+ },
664
+ {
665
+ "include": "#backtick-string-4"
666
+ },
667
+ {
668
+ "include": "#backtick-string-3"
669
+ },
670
+ {
671
+ "include": "#backtick-string-2"
672
+ },
673
+ {
674
+ "include": "#backtick-string-1"
675
+ }
676
+ ]
677
+ },
678
+ "backtick-string-1": {
679
+ "name": "string.interpolated.baml",
680
+ "begin": "(?<!\\`)(\\`{1})(?!\\`)",
681
+ "beginCaptures": {
682
+ "1": {
683
+ "name": "punctuation.definition.string.begin.baml"
684
+ }
685
+ },
686
+ "end": "(?<!\\`)(\\`{1})(?!\\`)",
687
+ "endCaptures": {
688
+ "1": {
689
+ "name": "punctuation.definition.string.end.baml"
690
+ }
691
+ },
692
+ "patterns": [
693
+ {
694
+ "include": "#backtick-interpolation"
695
+ },
696
+ {
697
+ "include": "#backtick-string-escape"
698
+ }
699
+ ]
700
+ },
701
+ "backtick-string-2": {
702
+ "name": "string.interpolated.baml",
703
+ "begin": "(?<!\\`)(\\`{2})(?!\\`)",
704
+ "beginCaptures": {
705
+ "1": {
706
+ "name": "punctuation.definition.string.begin.baml"
707
+ }
708
+ },
709
+ "end": "(?<!\\`)(\\`{2})(?!\\`)",
710
+ "endCaptures": {
711
+ "1": {
712
+ "name": "punctuation.definition.string.end.baml"
713
+ }
714
+ },
715
+ "patterns": [
716
+ {
717
+ "include": "#backtick-interpolation"
718
+ },
719
+ {
720
+ "include": "#backtick-string-escape"
721
+ }
722
+ ]
723
+ },
724
+ "backtick-string-3": {
725
+ "name": "string.interpolated.baml",
726
+ "begin": "(?<!\\`)(\\`{3})(?!\\`)",
727
+ "beginCaptures": {
728
+ "1": {
729
+ "name": "punctuation.definition.string.begin.baml"
730
+ }
731
+ },
732
+ "end": "(?<!\\`)(\\`{3})(?!\\`)",
733
+ "endCaptures": {
734
+ "1": {
735
+ "name": "punctuation.definition.string.end.baml"
736
+ }
737
+ },
738
+ "patterns": [
739
+ {
740
+ "include": "#backtick-interpolation"
741
+ },
742
+ {
743
+ "include": "#backtick-string-escape"
744
+ }
745
+ ]
746
+ },
747
+ "backtick-string-4": {
748
+ "name": "string.interpolated.baml",
749
+ "begin": "(?<!\\`)(\\`{4})(?!\\`)",
750
+ "beginCaptures": {
751
+ "1": {
752
+ "name": "punctuation.definition.string.begin.baml"
753
+ }
754
+ },
755
+ "end": "(?<!\\`)(\\`{4})(?!\\`)",
756
+ "endCaptures": {
757
+ "1": {
758
+ "name": "punctuation.definition.string.end.baml"
759
+ }
760
+ },
761
+ "patterns": [
762
+ {
763
+ "include": "#backtick-interpolation"
764
+ },
765
+ {
766
+ "include": "#backtick-string-escape"
767
+ }
768
+ ]
769
+ },
770
+ "backtick-string-5": {
771
+ "name": "string.interpolated.baml",
772
+ "begin": "(?<!\\`)(\\`{5})(?!\\`)",
773
+ "beginCaptures": {
774
+ "1": {
775
+ "name": "punctuation.definition.string.begin.baml"
776
+ }
777
+ },
778
+ "end": "(?<!\\`)(\\`{5})(?!\\`)",
779
+ "endCaptures": {
780
+ "1": {
781
+ "name": "punctuation.definition.string.end.baml"
782
+ }
783
+ },
784
+ "patterns": [
785
+ {
786
+ "include": "#backtick-interpolation"
787
+ },
788
+ {
789
+ "include": "#backtick-string-escape"
790
+ }
791
+ ]
792
+ },
793
+ "backtick-string-6": {
794
+ "name": "string.interpolated.baml",
795
+ "begin": "(?<!\\`)(\\`{6})(?!\\`)",
796
+ "beginCaptures": {
797
+ "1": {
798
+ "name": "punctuation.definition.string.begin.baml"
799
+ }
800
+ },
801
+ "end": "(?<!\\`)(\\`{6})(?!\\`)",
802
+ "endCaptures": {
803
+ "1": {
804
+ "name": "punctuation.definition.string.end.baml"
805
+ }
806
+ },
807
+ "patterns": [
808
+ {
809
+ "include": "#backtick-interpolation"
810
+ },
811
+ {
812
+ "include": "#backtick-string-escape"
813
+ }
814
+ ]
815
+ },
816
+ "backtick-string-7": {
817
+ "name": "string.interpolated.baml",
818
+ "begin": "(?<!\\`)(\\`{7})(?!\\`)",
819
+ "beginCaptures": {
820
+ "1": {
821
+ "name": "punctuation.definition.string.begin.baml"
822
+ }
823
+ },
824
+ "end": "(?<!\\`)(\\`{7})(?!\\`)",
825
+ "endCaptures": {
826
+ "1": {
827
+ "name": "punctuation.definition.string.end.baml"
828
+ }
829
+ },
830
+ "patterns": [
831
+ {
832
+ "include": "#backtick-interpolation"
833
+ },
834
+ {
835
+ "include": "#backtick-string-escape"
836
+ }
837
+ ]
838
+ },
839
+ "backtick-string-8": {
840
+ "name": "string.interpolated.baml",
841
+ "begin": "(?<!\\`)(\\`{8})(?!\\`)",
842
+ "beginCaptures": {
843
+ "1": {
844
+ "name": "punctuation.definition.string.begin.baml"
845
+ }
846
+ },
847
+ "end": "(?<!\\`)(\\`{8})(?!\\`)",
848
+ "endCaptures": {
849
+ "1": {
850
+ "name": "punctuation.definition.string.end.baml"
851
+ }
852
+ },
853
+ "patterns": [
854
+ {
855
+ "include": "#backtick-interpolation"
856
+ },
857
+ {
858
+ "include": "#backtick-string-escape"
859
+ }
860
+ ]
861
+ },
862
+ "backtick-string-escape": {
863
+ "patterns": [
864
+ {
865
+ "include": "#string-escape-control"
866
+ },
867
+ {
868
+ "include": "#string-escape-quoted-delimiter"
869
+ },
870
+ {
871
+ "include": "#backtick-string-escape-delimiter"
872
+ },
873
+ {
874
+ "include": "#string-escape-unknown"
875
+ }
876
+ ]
877
+ },
878
+ "backtick-string-escape-delimiter": {
879
+ "name": "constant.character.escape.delimiter.baml",
880
+ "match": "\\\\[`$]"
881
+ },
882
+ "bare-attribute": {
883
+ "name": "meta.attribute.baml",
884
+ "match": "(@)(?!@)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*|skip)\\b(?=\\s*(?:@|,|\\}|$|//|/\\*))",
885
+ "captures": {
886
+ "1": {
887
+ "name": "punctuation.definition.annotation.baml storage.type.annotation.baml"
888
+ },
889
+ "2": {
890
+ "patterns": [
891
+ {
892
+ "include": "#accessor-dot"
893
+ },
894
+ {
895
+ "include": "#attribute-path-segment"
896
+ }
897
+ ]
898
+ }
899
+ }
900
+ },
901
+ "bare-binding-pattern": {
902
+ "name": "meta.pattern.binding.baml",
903
+ "match": "\\b((?:let|const))\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
904
+ "captures": {
905
+ "1": {
906
+ "name": "keyword.declaration.binding.baml"
907
+ },
908
+ "2": {
909
+ "name": "variable.other.binding.baml"
910
+ }
911
+ }
912
+ },
913
+ "bigint-literal": {
914
+ "name": "constant.numeric.bigint.baml",
915
+ "match": "\\b[0-9]+n"
916
+ },
917
+ "block-attribute": {
918
+ "name": "meta.attribute.block.baml",
919
+ "begin": "(@@)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b",
920
+ "beginCaptures": {
921
+ "1": {
922
+ "name": "punctuation.definition.annotation.baml storage.type.annotation.baml"
923
+ },
924
+ "2": {
925
+ "patterns": [
926
+ {
927
+ "include": "#accessor-dot"
928
+ },
929
+ {
930
+ "include": "#attribute-path-segment"
931
+ }
932
+ ]
933
+ }
934
+ },
935
+ "end": "(?<=\\))|(?=\\s*@@|\\s*@|\\s*,|\\s*\\}|\\s+\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|\\r?\\n\\s*(?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|@@|\\}))",
936
+ "patterns": [
937
+ {
938
+ "include": "#comments"
939
+ },
940
+ {
941
+ "include": "#attribute-arguments"
942
+ }
943
+ ]
944
+ },
945
+ "block-comment": {
946
+ "name": "comment.block.baml",
947
+ "begin": "/\\*",
948
+ "end": "\\*/"
949
+ },
950
+ "block-contents": {
951
+ "patterns": [
952
+ {
953
+ "include": "#comments"
954
+ },
955
+ {
956
+ "include": "#testset"
957
+ },
958
+ {
959
+ "include": "#test"
960
+ },
961
+ {
962
+ "include": "#watch-statement"
963
+ },
964
+ {
965
+ "include": "#let-statement"
966
+ },
967
+ {
968
+ "include": "#return-statement"
969
+ },
970
+ {
971
+ "include": "#break-statement"
972
+ },
973
+ {
974
+ "include": "#continue-statement"
975
+ },
976
+ {
977
+ "include": "#defer-statement"
978
+ },
979
+ {
980
+ "include": "#if-else-clause"
981
+ },
982
+ {
983
+ "include": "#for-statement"
984
+ },
985
+ {
986
+ "include": "#while-statement"
987
+ },
988
+ {
989
+ "include": "#expression"
990
+ },
991
+ {
992
+ "include": "#semicolon"
993
+ }
994
+ ]
995
+ },
996
+ "boolean-literal": {
997
+ "name": "constant.language.boolean.baml",
998
+ "match": "\\b(?:true|false)\\b"
999
+ },
1000
+ "break-statement": {
1001
+ "name": "meta.statement.break.baml",
1002
+ "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(break)\\b",
1003
+ "beginCaptures": {
1004
+ "1": {
1005
+ "name": "keyword.control.flow.break.baml"
1006
+ }
1007
+ },
1008
+ "end": "(?=[;}]|$)",
1009
+ "patterns": [
1010
+ {
1011
+ "include": "#comments"
1012
+ }
1013
+ ]
1014
+ },
1015
+ "byte-string-escape": {
1016
+ "patterns": [
1017
+ {
1018
+ "include": "#byte-string-escape-hex"
1019
+ },
1020
+ {
1021
+ "include": "#byte-string-escape-control"
1022
+ },
1023
+ {
1024
+ "include": "#string-escape-quoted-delimiter"
1025
+ },
1026
+ {
1027
+ "include": "#byte-string-escape-invalid-hex"
1028
+ },
1029
+ {
1030
+ "include": "#byte-string-escape-invalid"
1031
+ }
1032
+ ]
1033
+ },
1034
+ "byte-string-escape-control": {
1035
+ "name": "constant.character.escape.control.baml",
1036
+ "match": "\\\\[ntr0]"
1037
+ },
1038
+ "byte-string-escape-hex": {
1039
+ "name": "constant.character.escape.hex.baml",
1040
+ "match": "\\\\x[0-9A-Fa-f]{2}"
1041
+ },
1042
+ "byte-string-escape-invalid": {
1043
+ "name": "invalid.illegal.escape.baml",
1044
+ "match": "\\\\."
1045
+ },
1046
+ "byte-string-escape-invalid-hex": {
1047
+ "name": "invalid.illegal.escape.hex.baml",
1048
+ "match": "\\\\x(?:[0-9A-Fa-f]{0,1}(?=[\"\\\\]|$)|[0-9A-Fa-f]?[^0-9A-Fa-f\"\\\\])"
1049
+ },
1050
+ "byte-string-literal": {
1051
+ "name": "string.quoted.binary.double.baml",
1052
+ "begin": "\\b(b)(\")",
1053
+ "beginCaptures": {
1054
+ "1": {
1055
+ "name": "storage.type.string.baml"
1056
+ },
1057
+ "2": {
1058
+ "name": "punctuation.definition.string.begin.baml"
1059
+ }
1060
+ },
1061
+ "end": "\"",
1062
+ "endCaptures": {
1063
+ "0": {
1064
+ "name": "punctuation.definition.string.end.baml"
1065
+ }
1066
+ },
1067
+ "patterns": [
1068
+ {
1069
+ "include": "#byte-string-escape"
1070
+ }
1071
+ ]
1072
+ },
1073
+ "call-arguments": {
1074
+ "name": "meta.function-call.arguments.baml",
1075
+ "begin": "\\(",
1076
+ "beginCaptures": {
1077
+ "0": {
1078
+ "name": "punctuation.definition.arguments.begin.baml"
1079
+ }
1080
+ },
1081
+ "end": "\\)",
1082
+ "endCaptures": {
1083
+ "0": {
1084
+ "name": "punctuation.definition.arguments.end.baml"
1085
+ }
1086
+ },
1087
+ "patterns": [
1088
+ {
1089
+ "include": "#comments"
1090
+ },
1091
+ {
1092
+ "include": "#expression"
1093
+ },
1094
+ {
1095
+ "include": "#comma"
1096
+ }
1097
+ ]
1098
+ },
1099
+ "catch-binding": {
1100
+ "name": "variable.parameter.catch.baml",
1101
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
1102
+ },
1103
+ "catch-binding-list": {
1104
+ "name": "meta.catch.binding-list.baml",
1105
+ "begin": "\\(",
1106
+ "beginCaptures": {
1107
+ "0": {
1108
+ "name": "punctuation.definition.catch-binding.begin.baml"
1109
+ }
1110
+ },
1111
+ "end": "\\)",
1112
+ "endCaptures": {
1113
+ "0": {
1114
+ "name": "punctuation.definition.catch-binding.end.baml"
1115
+ }
1116
+ },
1117
+ "patterns": [
1118
+ {
1119
+ "include": "#comments"
1120
+ },
1121
+ {
1122
+ "include": "#catch-binding"
1123
+ },
1124
+ {
1125
+ "include": "#comma"
1126
+ }
1127
+ ]
1128
+ },
1129
+ "catch-block": {
1130
+ "name": "meta.block.catch.baml",
1131
+ "begin": "\\{",
1132
+ "beginCaptures": {
1133
+ "0": {
1134
+ "name": "punctuation.definition.block.begin.baml"
1135
+ }
1136
+ },
1137
+ "end": "\\}",
1138
+ "endCaptures": {
1139
+ "0": {
1140
+ "name": "punctuation.definition.block.end.baml"
1141
+ }
1142
+ },
1143
+ "patterns": [
1144
+ {
1145
+ "include": "#comments"
1146
+ },
1147
+ {
1148
+ "include": "#match-arm"
1149
+ },
1150
+ {
1151
+ "include": "#comma"
1152
+ }
1153
+ ]
1154
+ },
1155
+ "catch-expression": {
1156
+ "name": "meta.expression.catch.baml",
1157
+ "begin": "\\b(catch|catch_all)\\b",
1158
+ "beginCaptures": {
1159
+ "1": {
1160
+ "name": "keyword.control.exception.catch.baml"
1161
+ }
1162
+ },
1163
+ "end": "(?<=\\})|(?=,|;|$)",
1164
+ "patterns": [
1165
+ {
1166
+ "include": "#comments"
1167
+ },
1168
+ {
1169
+ "include": "#catch-binding-list"
1170
+ },
1171
+ {
1172
+ "include": "#catch-block"
1173
+ }
1174
+ ]
1175
+ },
1176
+ "class": {
1177
+ "name": "meta.class.baml",
1178
+ "begin": "^\\s*(class)\\b",
1179
+ "beginCaptures": {
1180
+ "1": {
1181
+ "name": "keyword.declaration.class.baml"
1182
+ }
1183
+ },
1184
+ "end": "(?<=\\})|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
1185
+ "patterns": [
1186
+ {
1187
+ "include": "#comments"
1188
+ },
1189
+ {
1190
+ "include": "#class-header"
1191
+ },
1192
+ {
1193
+ "include": "#class-body"
1194
+ }
1195
+ ]
1196
+ },
1197
+ "class-body": {
1198
+ "name": "meta.class.body.baml",
1199
+ "begin": "\\{",
1200
+ "beginCaptures": {
1201
+ "0": {
1202
+ "name": "punctuation.definition.block.begin.baml"
1203
+ }
1204
+ },
1205
+ "end": "\\}",
1206
+ "endCaptures": {
1207
+ "0": {
1208
+ "name": "punctuation.definition.block.end.baml"
1209
+ }
1210
+ },
1211
+ "patterns": [
1212
+ {
1213
+ "include": "#comments"
1214
+ },
1215
+ {
1216
+ "include": "#block-attribute"
1217
+ },
1218
+ {
1219
+ "include": "#bare-attribute"
1220
+ },
1221
+ {
1222
+ "include": "#attribute"
1223
+ },
1224
+ {
1225
+ "include": "#implements-block"
1226
+ },
1227
+ {
1228
+ "include": "#function"
1229
+ },
1230
+ {
1231
+ "include": "#field"
1232
+ },
1233
+ {
1234
+ "include": "#semicolon"
1235
+ }
1236
+ ]
1237
+ },
1238
+ "class-destructure-body": {
1239
+ "name": "meta.pattern.destructure.class.body.baml",
1240
+ "begin": "\\{",
1241
+ "beginCaptures": {
1242
+ "0": {
1243
+ "name": "punctuation.definition.pattern.destructure.begin.baml"
1244
+ }
1245
+ },
1246
+ "end": "\\}",
1247
+ "endCaptures": {
1248
+ "0": {
1249
+ "name": "punctuation.definition.pattern.destructure.end.baml"
1250
+ }
1251
+ },
1252
+ "patterns": [
1253
+ {
1254
+ "include": "#comments"
1255
+ },
1256
+ {
1257
+ "include": "#class-destructure-field"
1258
+ },
1259
+ {
1260
+ "include": "#comma"
1261
+ }
1262
+ ]
1263
+ },
1264
+ "class-destructure-field": {
1265
+ "name": "meta.pattern.destructure.class.field.baml",
1266
+ "begin": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b\\s*(:)?",
1267
+ "beginCaptures": {
1268
+ "1": {
1269
+ "name": "variable.other.property.baml"
1270
+ },
1271
+ "2": {
1272
+ "name": "punctuation.separator.colon.baml"
1273
+ }
1274
+ },
1275
+ "end": "(?=,|\\})",
1276
+ "patterns": [
1277
+ {
1278
+ "include": "#comments"
1279
+ },
1280
+ {
1281
+ "include": "#pattern"
1282
+ }
1283
+ ]
1284
+ },
1285
+ "class-destructure-pattern": {
1286
+ "name": "meta.pattern.destructure.class.baml",
1287
+ "begin": "\\b(?:((?:let|const))\\s+)?(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b\\s*(?=(?:<[^{}=;\\r\\n]*>\\s*)?\\{)",
1288
+ "beginCaptures": {
1289
+ "1": {
1290
+ "name": "keyword.declaration.binding.baml"
1291
+ },
1292
+ "2": {
1293
+ "patterns": [
1294
+ {
1295
+ "include": "#type-reference"
1296
+ }
1297
+ ]
1298
+ }
1299
+ },
1300
+ "end": "(?<=\\})",
1301
+ "patterns": [
1302
+ {
1303
+ "include": "#comments"
1304
+ },
1305
+ {
1306
+ "include": "#type-expression"
1307
+ },
1308
+ {
1309
+ "include": "#class-destructure-body"
1310
+ }
1311
+ ]
1312
+ },
1313
+ "class-header": {
1314
+ "name": "meta.class.header.baml",
1315
+ "begin": "\\G\\s*",
1316
+ "end": "(?=\\{)|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
1317
+ "patterns": [
1318
+ {
1319
+ "include": "#comments"
1320
+ },
1321
+ {
1322
+ "include": "#declaration-type-parameters"
1323
+ },
1324
+ {
1325
+ "include": "#class-name"
1326
+ }
1327
+ ]
1328
+ },
1329
+ "class-name": {
1330
+ "name": "entity.name.type.class.baml",
1331
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
1332
+ },
1333
+ "client": {
1334
+ "name": "meta.client.baml",
1335
+ "begin": "^\\s*(client)\\b(?:\\s*(<)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(>)\\s*|\\s+)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*\\{)",
1336
+ "beginCaptures": {
1337
+ "1": {
1338
+ "name": "keyword.declaration.client.baml"
1339
+ },
1340
+ "2": {
1341
+ "name": "punctuation.definition.type-parameters.begin.baml"
1342
+ },
1343
+ "3": {
1344
+ "name": "support.type.client.baml"
1345
+ },
1346
+ "4": {
1347
+ "name": "punctuation.definition.type-parameters.end.baml"
1348
+ },
1349
+ "5": {
1350
+ "name": "entity.name.client.baml"
1351
+ }
1352
+ },
1353
+ "end": "(?<=\\})",
1354
+ "patterns": [
1355
+ {
1356
+ "include": "#comments"
1357
+ },
1358
+ {
1359
+ "include": "#config-block"
1360
+ }
1361
+ ]
1362
+ },
1363
+ "code-block": {
1364
+ "name": "meta.block.code.baml",
1365
+ "begin": "\\{",
1366
+ "beginCaptures": {
1367
+ "0": {
1368
+ "name": "punctuation.definition.block.begin.baml"
1369
+ }
1370
+ },
1371
+ "end": "\\}",
1372
+ "endCaptures": {
1373
+ "0": {
1374
+ "name": "punctuation.definition.block.end.baml"
1375
+ }
1376
+ },
1377
+ "patterns": [
1378
+ {
1379
+ "include": "#comments"
1380
+ },
1381
+ {
1382
+ "include": "#block-contents"
1383
+ }
1384
+ ]
1385
+ },
1386
+ "colon-separator": {
1387
+ "name": "punctuation.separator.colon.baml",
1388
+ "match": ":"
1389
+ },
1390
+ "comma": {
1391
+ "name": "punctuation.separator.comma.baml",
1392
+ "match": ","
1393
+ },
1394
+ "comments": {
1395
+ "patterns": [
1396
+ {
1397
+ "include": "#line-comment"
1398
+ },
1399
+ {
1400
+ "include": "#block-comment"
1401
+ }
1402
+ ]
1403
+ },
1404
+ "condition-expression": {
1405
+ "patterns": [
1406
+ {
1407
+ "include": "#literal"
1408
+ },
1409
+ {
1410
+ "include": "#array-expression"
1411
+ },
1412
+ {
1413
+ "include": "#lambda-expression"
1414
+ },
1415
+ {
1416
+ "include": "#parenthesized-expression"
1417
+ },
1418
+ {
1419
+ "include": "#if-expression"
1420
+ },
1421
+ {
1422
+ "include": "#match-expression"
1423
+ },
1424
+ {
1425
+ "include": "#spawn-expression"
1426
+ },
1427
+ {
1428
+ "include": "#map-expression"
1429
+ },
1430
+ {
1431
+ "include": "#code-block"
1432
+ },
1433
+ {
1434
+ "include": "#await-expression"
1435
+ },
1436
+ {
1437
+ "include": "#throw-expression"
1438
+ },
1439
+ {
1440
+ "include": "#catch-expression"
1441
+ },
1442
+ {
1443
+ "include": "#condition-is-pattern-expression"
1444
+ },
1445
+ {
1446
+ "include": "#optional-call-expression"
1447
+ },
1448
+ {
1449
+ "include": "#optional-index-expression"
1450
+ },
1451
+ {
1452
+ "include": "#optional-method-call-expression"
1453
+ },
1454
+ {
1455
+ "include": "#optional-field-access-expression"
1456
+ },
1457
+ {
1458
+ "include": "#upcast-expression"
1459
+ },
1460
+ {
1461
+ "include": "#postfix-method-call-expression"
1462
+ },
1463
+ {
1464
+ "include": "#field-access-expression"
1465
+ },
1466
+ {
1467
+ "include": "#expression-operator"
1468
+ },
1469
+ {
1470
+ "include": "#function-call-expression"
1471
+ },
1472
+ {
1473
+ "include": "#dotted-expression"
1474
+ }
1475
+ ]
1476
+ },
1477
+ "condition-is-pattern-expression": {
1478
+ "name": "meta.expression.is.baml",
1479
+ "begin": "\\b(is)\\b",
1480
+ "beginCaptures": {
1481
+ "1": {
1482
+ "name": "keyword.operator.is.baml"
1483
+ }
1484
+ },
1485
+ "end": "(?=\\s*(?:&&|\\|\\||=>|[,);\\]}{]|$))",
1486
+ "patterns": [
1487
+ {
1488
+ "include": "#comments"
1489
+ },
1490
+ {
1491
+ "include": "#condition-pattern"
1492
+ }
1493
+ ]
1494
+ },
1495
+ "condition-pattern": {
1496
+ "patterns": [
1497
+ {
1498
+ "include": "#comments"
1499
+ },
1500
+ {
1501
+ "include": "#wildcard-binding-pattern"
1502
+ },
1503
+ {
1504
+ "include": "#typed-binding-pattern"
1505
+ },
1506
+ {
1507
+ "include": "#array-destructure-pattern"
1508
+ },
1509
+ {
1510
+ "include": "#bare-binding-pattern"
1511
+ },
1512
+ {
1513
+ "include": "#wildcard-pattern"
1514
+ },
1515
+ {
1516
+ "include": "#type-expression"
1517
+ }
1518
+ ]
1519
+ },
1520
+ "config-array": {
1521
+ "patterns": [
1522
+ {
1523
+ "include": "#config-array-body"
1524
+ }
1525
+ ]
1526
+ },
1527
+ "config-array-body": {
1528
+ "name": "meta.config.array.baml",
1529
+ "begin": "\\[",
1530
+ "beginCaptures": {
1531
+ "0": {
1532
+ "name": "punctuation.definition.array.begin.baml"
1533
+ }
1534
+ },
1535
+ "end": "\\]",
1536
+ "endCaptures": {
1537
+ "0": {
1538
+ "name": "punctuation.definition.array.end.baml"
1539
+ }
1540
+ },
1541
+ "patterns": [
1542
+ {
1543
+ "include": "#comments"
1544
+ },
1545
+ {
1546
+ "include": "#config-block"
1547
+ },
1548
+ {
1549
+ "include": "#config-array"
1550
+ },
1551
+ {
1552
+ "include": "#expression"
1553
+ },
1554
+ {
1555
+ "include": "#comma"
1556
+ }
1557
+ ]
1558
+ },
1559
+ "config-block": {
1560
+ "patterns": [
1561
+ {
1562
+ "include": "#config-block-body"
1563
+ }
1564
+ ]
1565
+ },
1566
+ "config-block-body": {
1567
+ "name": "meta.config.block.baml",
1568
+ "begin": "\\{",
1569
+ "beginCaptures": {
1570
+ "0": {
1571
+ "name": "punctuation.definition.block.begin.baml"
1572
+ }
1573
+ },
1574
+ "end": "\\}",
1575
+ "endCaptures": {
1576
+ "0": {
1577
+ "name": "punctuation.definition.block.end.baml"
1578
+ }
1579
+ },
1580
+ "patterns": [
1581
+ {
1582
+ "include": "#comments"
1583
+ },
1584
+ {
1585
+ "include": "#config-field"
1586
+ },
1587
+ {
1588
+ "include": "#comma"
1589
+ }
1590
+ ]
1591
+ },
1592
+ "config-field": {
1593
+ "name": "meta.field.config.baml",
1594
+ "begin": "(?:^\\s*|(?<=[\\{,])\\s*)(?:(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b|(\"(?:\\\\.|[^\"\\\\])*\"))\\s*(:)?",
1595
+ "beginCaptures": {
1596
+ "1": {
1597
+ "name": "variable.other.property.baml"
1598
+ },
1599
+ "2": {
1600
+ "patterns": [
1601
+ {
1602
+ "include": "#string-literal"
1603
+ }
1604
+ ]
1605
+ },
1606
+ "3": {
1607
+ "name": "punctuation.separator.colon.baml"
1608
+ }
1609
+ },
1610
+ "end": "(?=,|\\r?\\n|\\})",
1611
+ "patterns": [
1612
+ {
1613
+ "include": "#comments"
1614
+ },
1615
+ {
1616
+ "include": "#config-block"
1617
+ },
1618
+ {
1619
+ "include": "#config-array"
1620
+ },
1621
+ {
1622
+ "include": "#expression"
1623
+ }
1624
+ ]
1625
+ },
1626
+ "constructor-body": {
1627
+ "name": "meta.constructor.body.baml",
1628
+ "begin": "\\{",
1629
+ "beginCaptures": {
1630
+ "0": {
1631
+ "name": "punctuation.definition.constructor.body.begin.baml"
1632
+ }
1633
+ },
1634
+ "end": "\\}",
1635
+ "endCaptures": {
1636
+ "0": {
1637
+ "name": "punctuation.definition.constructor.body.end.baml"
1638
+ }
1639
+ },
1640
+ "patterns": [
1641
+ {
1642
+ "include": "#comments"
1643
+ },
1644
+ {
1645
+ "include": "#constructor-field"
1646
+ },
1647
+ {
1648
+ "include": "#comma"
1649
+ }
1650
+ ]
1651
+ },
1652
+ "constructor-expression": {
1653
+ "name": "meta.constructor.expression.baml",
1654
+ "begin": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*\\b(?=\\s*(?:<[^{}=;\\r\\n]*>\\s*)?\\{)",
1655
+ "beginCaptures": {
1656
+ "0": {
1657
+ "patterns": [
1658
+ {
1659
+ "include": "#accessor-dot"
1660
+ },
1661
+ {
1662
+ "include": "#constructor-type"
1663
+ }
1664
+ ]
1665
+ }
1666
+ },
1667
+ "end": "(?<=\\})",
1668
+ "patterns": [
1669
+ {
1670
+ "include": "#comments"
1671
+ },
1672
+ {
1673
+ "include": "#constructor-type-arguments"
1674
+ },
1675
+ {
1676
+ "include": "#constructor-body"
1677
+ }
1678
+ ]
1679
+ },
1680
+ "constructor-field": {
1681
+ "name": "meta.constructor.field.baml",
1682
+ "begin": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(:)",
1683
+ "beginCaptures": {
1684
+ "1": {
1685
+ "name": "variable.other.property.baml"
1686
+ },
1687
+ "2": {
1688
+ "name": "punctuation.separator.colon.baml"
1689
+ }
1690
+ },
1691
+ "end": "(?=,|\\})",
1692
+ "patterns": [
1693
+ {
1694
+ "include": "#comments"
1695
+ },
1696
+ {
1697
+ "include": "#expression"
1698
+ }
1699
+ ]
1700
+ },
1701
+ "constructor-type": {
1702
+ "name": "entity.name.type.baml",
1703
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
1704
+ },
1705
+ "constructor-type-arguments": {
1706
+ "name": "meta.type-arguments.baml",
1707
+ "begin": "<",
1708
+ "beginCaptures": {
1709
+ "0": {
1710
+ "name": "punctuation.definition.type-arguments.begin.baml"
1711
+ }
1712
+ },
1713
+ "end": ">(?=\\s*\\{)",
1714
+ "endCaptures": {
1715
+ "0": {
1716
+ "name": "punctuation.definition.type-arguments.end.baml"
1717
+ }
1718
+ },
1719
+ "patterns": [
1720
+ {
1721
+ "include": "#comments"
1722
+ },
1723
+ {
1724
+ "include": "#type-expression"
1725
+ }
1726
+ ]
1727
+ },
1728
+ "continue-statement": {
1729
+ "name": "meta.statement.continue.baml",
1730
+ "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(continue)\\b",
1731
+ "beginCaptures": {
1732
+ "1": {
1733
+ "name": "keyword.control.flow.continue.baml"
1734
+ }
1735
+ },
1736
+ "end": "(?=[;}]|$)",
1737
+ "patterns": [
1738
+ {
1739
+ "include": "#comments"
1740
+ }
1741
+ ]
1742
+ },
1743
+ "declaration-type-parameter": {
1744
+ "name": "meta.type-parameter.baml",
1745
+ "begin": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
1746
+ "beginCaptures": {
1747
+ "1": {
1748
+ "name": "entity.name.type.parameter.baml"
1749
+ }
1750
+ },
1751
+ "end": "(?=,|>(?=\\s*(?:\\(|\\{|requires\\b|\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)))",
1752
+ "patterns": [
1753
+ {
1754
+ "include": "#comments"
1755
+ },
1756
+ {
1757
+ "include": "#declaration-type-parameter-extends"
1758
+ },
1759
+ {
1760
+ "include": "#declaration-type-parameter-intersection"
1761
+ },
1762
+ {
1763
+ "include": "#type-expression"
1764
+ }
1765
+ ]
1766
+ },
1767
+ "declaration-type-parameter-extends": {
1768
+ "name": "keyword.operator.extends.baml",
1769
+ "match": "\\bextends\\b"
1770
+ },
1771
+ "declaration-type-parameter-intersection": {
1772
+ "name": "keyword.operator.type.baml",
1773
+ "match": "&"
1774
+ },
1775
+ "declaration-type-parameters": {
1776
+ "name": "meta.type-parameters.baml",
1777
+ "begin": "<",
1778
+ "beginCaptures": {
1779
+ "0": {
1780
+ "name": "punctuation.definition.type-parameters.begin.baml"
1781
+ }
1782
+ },
1783
+ "end": ">(?=\\s*(?:\\(|\\{|requires\\b|\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*))",
1784
+ "endCaptures": {
1785
+ "0": {
1786
+ "name": "punctuation.definition.type-parameters.end.baml"
1787
+ }
1788
+ },
1789
+ "patterns": [
1790
+ {
1791
+ "include": "#comments"
1792
+ },
1793
+ {
1794
+ "include": "#declaration-type-parameter"
1795
+ },
1796
+ {
1797
+ "include": "#comma"
1798
+ }
1799
+ ]
1800
+ },
1801
+ "defer-statement": {
1802
+ "name": "meta.statement.defer.baml",
1803
+ "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(defer)\\b",
1804
+ "beginCaptures": {
1805
+ "1": {
1806
+ "name": "keyword.control.flow.defer.baml"
1807
+ }
1808
+ },
1809
+ "end": "(?<=\\})",
1810
+ "patterns": [
1811
+ {
1812
+ "include": "#comments"
1813
+ },
1814
+ {
1815
+ "include": "#code-block"
1816
+ }
1817
+ ]
1818
+ },
1819
+ "dotted-expression": {
1820
+ "name": "meta.dotted-expression.baml",
1821
+ "match": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)((?:\\s*\\.\\s*(?!as\\b\\s*<)\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b",
1822
+ "captures": {
1823
+ "1": {
1824
+ "patterns": [
1825
+ {
1826
+ "include": "#namespace-root"
1827
+ },
1828
+ {
1829
+ "include": "#environment-expression-root"
1830
+ },
1831
+ {
1832
+ "include": "#self-expression-root"
1833
+ },
1834
+ {
1835
+ "include": "#expression-identifier"
1836
+ }
1837
+ ]
1838
+ },
1839
+ "2": {
1840
+ "patterns": [
1841
+ {
1842
+ "include": "#accessor-dot"
1843
+ },
1844
+ {
1845
+ "include": "#expression-identifier"
1846
+ }
1847
+ ]
1848
+ }
1849
+ }
1850
+ },
1851
+ "enum": {
1852
+ "name": "meta.enum.baml",
1853
+ "begin": "^\\s*(enum)\\b",
1854
+ "beginCaptures": {
1855
+ "1": {
1856
+ "name": "keyword.declaration.enum.baml"
1857
+ }
1858
+ },
1859
+ "end": "(?<=\\})|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
1860
+ "patterns": [
1861
+ {
1862
+ "include": "#comments"
1863
+ },
1864
+ {
1865
+ "include": "#enum-header"
1866
+ },
1867
+ {
1868
+ "include": "#enum-body"
1869
+ }
1870
+ ]
1871
+ },
1872
+ "enum-body": {
1873
+ "name": "meta.enum.body.baml",
1874
+ "begin": "\\{",
1875
+ "beginCaptures": {
1876
+ "0": {
1877
+ "name": "punctuation.definition.block.begin.baml"
1878
+ }
1879
+ },
1880
+ "end": "\\}|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
1881
+ "endCaptures": {
1882
+ "0": {
1883
+ "name": "punctuation.definition.block.end.baml"
1884
+ }
1885
+ },
1886
+ "patterns": [
1887
+ {
1888
+ "include": "#comments"
1889
+ },
1890
+ {
1891
+ "include": "#block-attribute"
1892
+ },
1893
+ {
1894
+ "include": "#enum-variant"
1895
+ },
1896
+ {
1897
+ "include": "#comma"
1898
+ }
1899
+ ]
1900
+ },
1901
+ "enum-header": {
1902
+ "name": "meta.enum.header.baml",
1903
+ "begin": "\\G\\s*",
1904
+ "end": "(?=\\{)|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
1905
+ "patterns": [
1906
+ {
1907
+ "include": "#comments"
1908
+ },
1909
+ {
1910
+ "include": "#enum-name"
1911
+ }
1912
+ ]
1913
+ },
1914
+ "enum-name": {
1915
+ "name": "entity.name.type.enum.baml",
1916
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
1917
+ },
1918
+ "enum-variant": {
1919
+ "name": "meta.enum.variant.baml",
1920
+ "begin": "(?:^\\s*|(?<=[\\{,])\\s*|\\s+)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
1921
+ "beginCaptures": {
1922
+ "1": {
1923
+ "name": "variable.other.enummember.baml"
1924
+ }
1925
+ },
1926
+ "end": "(?=,|\\s+@@|\\s*\\}|\\s+\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|\\r?\\n\\s*(?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b|@@|\\}))",
1927
+ "patterns": [
1928
+ {
1929
+ "include": "#comments"
1930
+ },
1931
+ {
1932
+ "include": "#bare-attribute"
1933
+ },
1934
+ {
1935
+ "include": "#attribute"
1936
+ }
1937
+ ]
1938
+ },
1939
+ "environment-expression-root": {
1940
+ "name": "support.other.namespace.baml",
1941
+ "match": "\\benv\\b"
1942
+ },
1943
+ "expression": {
1944
+ "patterns": [
1945
+ {
1946
+ "include": "#literal"
1947
+ },
1948
+ {
1949
+ "include": "#array-expression"
1950
+ },
1951
+ {
1952
+ "include": "#lambda-expression"
1953
+ },
1954
+ {
1955
+ "include": "#parenthesized-expression"
1956
+ },
1957
+ {
1958
+ "include": "#if-expression"
1959
+ },
1960
+ {
1961
+ "include": "#match-expression"
1962
+ },
1963
+ {
1964
+ "include": "#spawn-expression"
1965
+ },
1966
+ {
1967
+ "include": "#constructor-expression"
1968
+ },
1969
+ {
1970
+ "include": "#map-expression"
1971
+ },
1972
+ {
1973
+ "include": "#code-block"
1974
+ },
1975
+ {
1976
+ "include": "#await-expression"
1977
+ },
1978
+ {
1979
+ "include": "#throw-expression"
1980
+ },
1981
+ {
1982
+ "include": "#catch-expression"
1983
+ },
1984
+ {
1985
+ "include": "#is-pattern-expression"
1986
+ },
1987
+ {
1988
+ "include": "#optional-call-expression"
1989
+ },
1990
+ {
1991
+ "include": "#optional-index-expression"
1992
+ },
1993
+ {
1994
+ "include": "#optional-method-call-expression"
1995
+ },
1996
+ {
1997
+ "include": "#optional-field-access-expression"
1998
+ },
1999
+ {
2000
+ "include": "#upcast-expression"
2001
+ },
2002
+ {
2003
+ "include": "#postfix-method-call-expression"
2004
+ },
2005
+ {
2006
+ "include": "#field-access-expression"
2007
+ },
2008
+ {
2009
+ "include": "#expression-operator"
2010
+ },
2011
+ {
2012
+ "include": "#function-call-expression"
2013
+ },
2014
+ {
2015
+ "include": "#dotted-expression"
2016
+ }
2017
+ ]
2018
+ },
2019
+ "expression-accessor-operator": {
2020
+ "name": "punctuation.accessor.baml",
2021
+ "match": "\\?\\.|\\.|\\$"
2022
+ },
2023
+ "expression-arithmetic-operator": {
2024
+ "name": "keyword.operator.arithmetic.baml",
2025
+ "match": "\\+\\+|--|\\+|-|\\*|/|%"
2026
+ },
2027
+ "expression-arrow-operator": {
2028
+ "name": "keyword.operator.arrow.baml",
2029
+ "match": "=>|->"
2030
+ },
2031
+ "expression-bitwise-operator": {
2032
+ "name": "keyword.operator.bitwise.baml",
2033
+ "match": "&|\\^|~|\\|"
2034
+ },
2035
+ "expression-comparison-operator": {
2036
+ "name": "keyword.operator.comparison.baml",
2037
+ "match": "<=|>=|<|>"
2038
+ },
2039
+ "expression-compound-assignment-operator": {
2040
+ "name": "keyword.operator.assignment.baml",
2041
+ "match": "<<=|>>=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^="
2042
+ },
2043
+ "expression-equality-operator": {
2044
+ "name": "keyword.operator.comparison.baml",
2045
+ "match": "==|!="
2046
+ },
2047
+ "expression-identifier": {
2048
+ "name": "variable.other.readwrite.baml",
2049
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
2050
+ },
2051
+ "expression-logical-operator": {
2052
+ "name": "keyword.operator.logical.baml",
2053
+ "match": "&&|\\|\\||!"
2054
+ },
2055
+ "expression-nullish-operator": {
2056
+ "name": "keyword.operator.nullish.baml",
2057
+ "match": "\\?\\?"
2058
+ },
2059
+ "expression-operator": {
2060
+ "patterns": [
2061
+ {
2062
+ "include": "#expression-arrow-operator"
2063
+ },
2064
+ {
2065
+ "include": "#expression-compound-assignment-operator"
2066
+ },
2067
+ {
2068
+ "include": "#expression-nullish-operator"
2069
+ },
2070
+ {
2071
+ "include": "#expression-logical-operator"
2072
+ },
2073
+ {
2074
+ "include": "#expression-equality-operator"
2075
+ },
2076
+ {
2077
+ "include": "#expression-shift-operator"
2078
+ },
2079
+ {
2080
+ "include": "#expression-comparison-operator"
2081
+ },
2082
+ {
2083
+ "include": "#expression-bitwise-operator"
2084
+ },
2085
+ {
2086
+ "include": "#expression-arithmetic-operator"
2087
+ },
2088
+ {
2089
+ "include": "#assignment-operator"
2090
+ },
2091
+ {
2092
+ "include": "#expression-spread-operator"
2093
+ },
2094
+ {
2095
+ "include": "#expression-accessor-operator"
2096
+ }
2097
+ ]
2098
+ },
2099
+ "expression-shift-operator": {
2100
+ "name": "keyword.operator.bitwise.shift.baml",
2101
+ "match": "<<|>>"
2102
+ },
2103
+ "expression-spread-operator": {
2104
+ "name": "keyword.operator.spread.baml",
2105
+ "match": "\\.\\.\\."
2106
+ },
2107
+ "field": {
2108
+ "name": "meta.field.baml",
2109
+ "begin": "(?:^\\s*|(?<=\\{)\\s*)(?!@)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(:)?",
2110
+ "beginCaptures": {
2111
+ "1": {
2112
+ "name": "variable.other.property.baml"
2113
+ },
2114
+ "2": {
2115
+ "name": "punctuation.separator.colon.baml"
2116
+ }
2117
+ },
2118
+ "end": "(?=\\})|$",
2119
+ "patterns": [
2120
+ {
2121
+ "include": "#comments"
2122
+ },
2123
+ {
2124
+ "include": "#type-expression"
2125
+ }
2126
+ ]
2127
+ },
2128
+ "field-access-expression": {
2129
+ "name": "meta.field-access.baml",
2130
+ "match": "([.$])\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
2131
+ "captures": {
2132
+ "1": {
2133
+ "name": "punctuation.accessor.baml"
2134
+ },
2135
+ "2": {
2136
+ "name": "variable.other.readwrite.baml"
2137
+ }
2138
+ }
2139
+ },
2140
+ "float-literal": {
2141
+ "name": "constant.numeric.float.baml",
2142
+ "match": "\\b[0-9]+(?:\\.[0-9]+[eE][+-]?[0-9]+|\\.[0-9]+|[eE][+-]?[0-9]+)"
2143
+ },
2144
+ "for-c-style-let-initializer": {
2145
+ "name": "meta.for.initializer.baml",
2146
+ "begin": "(?=(?:let|const)\\b)",
2147
+ "end": "(?=;)",
2148
+ "patterns": [
2149
+ {
2150
+ "include": "#comments"
2151
+ },
2152
+ {
2153
+ "include": "#pattern"
2154
+ },
2155
+ {
2156
+ "include": "#let-else-clause"
2157
+ },
2158
+ {
2159
+ "include": "#expression"
2160
+ }
2161
+ ]
2162
+ },
2163
+ "for-in-keyword": {
2164
+ "name": "keyword.operator.in.baml",
2165
+ "match": "\\bin\\b"
2166
+ },
2167
+ "for-in-pattern": {
2168
+ "name": "meta.pattern.for-in.baml",
2169
+ "begin": "(?=(?:let|const)\\b)",
2170
+ "end": "(?=\\s+in\\b)",
2171
+ "patterns": [
2172
+ {
2173
+ "include": "#comments"
2174
+ },
2175
+ {
2176
+ "include": "#pattern"
2177
+ }
2178
+ ]
2179
+ },
2180
+ "for-parenthesized-c-style-header": {
2181
+ "name": "meta.for.header.baml",
2182
+ "begin": "\\G\\s*(\\()",
2183
+ "beginCaptures": {
2184
+ "1": {
2185
+ "name": "punctuation.definition.for-header.begin.baml"
2186
+ }
2187
+ },
2188
+ "end": "\\)(?=\\s*\\{)",
2189
+ "endCaptures": {
2190
+ "0": {
2191
+ "name": "punctuation.definition.for-header.end.baml"
2192
+ }
2193
+ },
2194
+ "patterns": [
2195
+ {
2196
+ "include": "#comments"
2197
+ },
2198
+ {
2199
+ "include": "#for-c-style-let-initializer"
2200
+ },
2201
+ {
2202
+ "include": "#semicolon"
2203
+ },
2204
+ {
2205
+ "include": "#expression"
2206
+ }
2207
+ ]
2208
+ },
2209
+ "for-parenthesized-in-header": {
2210
+ "name": "meta.for.header.baml",
2211
+ "begin": "\\G\\s*(\\()(?=\\s*(?:let|const)\\b(?:(?![=;]).)*\\bin\\b)",
2212
+ "beginCaptures": {
2213
+ "1": {
2214
+ "name": "punctuation.definition.for-header.begin.baml"
2215
+ }
2216
+ },
2217
+ "end": "\\)(?=\\s*\\{)",
2218
+ "endCaptures": {
2219
+ "0": {
2220
+ "name": "punctuation.definition.for-header.end.baml"
2221
+ }
2222
+ },
2223
+ "patterns": [
2224
+ {
2225
+ "include": "#comments"
2226
+ },
2227
+ {
2228
+ "include": "#for-in-pattern"
2229
+ },
2230
+ {
2231
+ "include": "#for-in-keyword"
2232
+ },
2233
+ {
2234
+ "include": "#expression"
2235
+ }
2236
+ ]
2237
+ },
2238
+ "for-statement": {
2239
+ "name": "meta.statement.for.baml",
2240
+ "begin": "\\b(for)\\b",
2241
+ "beginCaptures": {
2242
+ "1": {
2243
+ "name": "keyword.control.loop.for.baml"
2244
+ }
2245
+ },
2246
+ "end": "(?<=\\})(?=\\s*(?:;|$))|(?=;|$)",
2247
+ "patterns": [
2248
+ {
2249
+ "include": "#comments"
2250
+ },
2251
+ {
2252
+ "include": "#for-parenthesized-in-header"
2253
+ },
2254
+ {
2255
+ "include": "#for-parenthesized-c-style-header"
2256
+ },
2257
+ {
2258
+ "include": "#for-unparenthesized-header"
2259
+ },
2260
+ {
2261
+ "include": "#code-block"
2262
+ }
2263
+ ]
2264
+ },
2265
+ "for-unparenthesized-header": {
2266
+ "name": "meta.for.header.baml",
2267
+ "begin": "\\G\\s*(?=(?:let|const)\\b)",
2268
+ "end": "(?=\\{)",
2269
+ "patterns": [
2270
+ {
2271
+ "include": "#comments"
2272
+ },
2273
+ {
2274
+ "include": "#for-in-pattern"
2275
+ },
2276
+ {
2277
+ "include": "#for-in-keyword"
2278
+ },
2279
+ {
2280
+ "include": "#condition-expression"
2281
+ }
2282
+ ]
2283
+ },
2284
+ "function": {
2285
+ "name": "meta.function.baml",
2286
+ "begin": "^\\s*(function)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
2287
+ "beginCaptures": {
2288
+ "1": {
2289
+ "name": "keyword.declaration.function.baml"
2290
+ },
2291
+ "2": {
2292
+ "name": "entity.name.function.baml"
2293
+ }
2294
+ },
2295
+ "end": "(?<=\\})",
2296
+ "patterns": [
2297
+ {
2298
+ "include": "#comments"
2299
+ },
2300
+ {
2301
+ "include": "#declaration-type-parameters"
2302
+ },
2303
+ {
2304
+ "include": "#function-parameters"
2305
+ },
2306
+ {
2307
+ "include": "#function-return-type"
2308
+ },
2309
+ {
2310
+ "include": "#function-block"
2311
+ }
2312
+ ]
2313
+ },
2314
+ "function-block": {
2315
+ "name": "meta.block.function.baml",
2316
+ "begin": "\\{",
2317
+ "beginCaptures": {
2318
+ "0": {
2319
+ "name": "punctuation.definition.block.begin.baml"
2320
+ }
2321
+ },
2322
+ "end": "\\}",
2323
+ "endCaptures": {
2324
+ "0": {
2325
+ "name": "punctuation.definition.block.end.baml"
2326
+ }
2327
+ },
2328
+ "patterns": [
2329
+ {
2330
+ "include": "#llm-client-field"
2331
+ },
2332
+ {
2333
+ "include": "#llm-prompt-field"
2334
+ },
2335
+ {
2336
+ "include": "#block-contents"
2337
+ }
2338
+ ]
2339
+ },
2340
+ "function-call-expression": {
2341
+ "name": "meta.function-call.baml",
2342
+ "begin": "\\b(?:(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(\\.)\\s*)?((?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\s*\\.\\s*)*)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*(?:<[^(){};]*>\\s*)?\\()",
2343
+ "beginCaptures": {
2344
+ "1": {
2345
+ "patterns": [
2346
+ {
2347
+ "include": "#namespace-root"
2348
+ },
2349
+ {
2350
+ "include": "#environment-expression-root"
2351
+ },
2352
+ {
2353
+ "include": "#self-expression-root"
2354
+ },
2355
+ {
2356
+ "include": "#expression-identifier"
2357
+ }
2358
+ ]
2359
+ },
2360
+ "2": {
2361
+ "name": "punctuation.accessor.baml"
2362
+ },
2363
+ "3": {
2364
+ "patterns": [
2365
+ {
2366
+ "include": "#accessor-dot"
2367
+ },
2368
+ {
2369
+ "include": "#expression-identifier"
2370
+ }
2371
+ ]
2372
+ },
2373
+ "4": {
2374
+ "name": "entity.name.function.baml"
2375
+ }
2376
+ },
2377
+ "end": "(?<=\\))",
2378
+ "patterns": [
2379
+ {
2380
+ "include": "#comments"
2381
+ },
2382
+ {
2383
+ "include": "#function-call-type-arguments"
2384
+ },
2385
+ {
2386
+ "include": "#call-arguments"
2387
+ }
2388
+ ]
2389
+ },
2390
+ "function-call-type-arguments": {
2391
+ "name": "meta.type-arguments.baml",
2392
+ "begin": "<",
2393
+ "beginCaptures": {
2394
+ "0": {
2395
+ "name": "punctuation.definition.type-arguments.begin.baml"
2396
+ }
2397
+ },
2398
+ "end": ">(?=\\s*\\()",
2399
+ "endCaptures": {
2400
+ "0": {
2401
+ "name": "punctuation.definition.type-arguments.end.baml"
2402
+ }
2403
+ },
2404
+ "patterns": [
2405
+ {
2406
+ "include": "#comments"
2407
+ },
2408
+ {
2409
+ "include": "#type-expression"
2410
+ }
2411
+ ]
2412
+ },
2413
+ "function-parameters": {
2414
+ "name": "meta.parameters.baml",
2415
+ "begin": "\\(",
2416
+ "beginCaptures": {
2417
+ "0": {
2418
+ "name": "punctuation.definition.parameters.begin.baml"
2419
+ }
2420
+ },
2421
+ "end": "\\)",
2422
+ "endCaptures": {
2423
+ "0": {
2424
+ "name": "punctuation.definition.parameters.end.baml"
2425
+ }
2426
+ },
2427
+ "patterns": [
2428
+ {
2429
+ "include": "#comments"
2430
+ },
2431
+ {
2432
+ "include": "#self-parameter"
2433
+ },
2434
+ {
2435
+ "include": "#parameter"
2436
+ },
2437
+ {
2438
+ "include": "#comma"
2439
+ }
2440
+ ]
2441
+ },
2442
+ "function-return-type": {
2443
+ "name": "meta.return-type.baml",
2444
+ "begin": "(->)",
2445
+ "beginCaptures": {
2446
+ "1": {
2447
+ "name": "keyword.operator.arrow.baml"
2448
+ }
2449
+ },
2450
+ "end": "(?=\\{)",
2451
+ "patterns": [
2452
+ {
2453
+ "include": "#comments"
2454
+ },
2455
+ {
2456
+ "include": "#type-expression"
2457
+ }
2458
+ ]
2459
+ },
2460
+ "generator": {
2461
+ "name": "meta.generator.baml",
2462
+ "begin": "^\\s*(generator)\\b(?:\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*))?\\s*(?=\\{)",
2463
+ "beginCaptures": {
2464
+ "1": {
2465
+ "name": "keyword.declaration.generator.baml"
2466
+ },
2467
+ "2": {
2468
+ "name": "entity.name.generator.baml"
2469
+ }
2470
+ },
2471
+ "end": "(?<=\\})",
2472
+ "patterns": [
2473
+ {
2474
+ "include": "#comments"
2475
+ },
2476
+ {
2477
+ "include": "#config-block"
2478
+ }
2479
+ ]
2480
+ },
2481
+ "if-condition": {
2482
+ "name": "meta.if.condition.baml",
2483
+ "begin": "\\G(?!\\s*else\\b)\\s*",
2484
+ "end": "(?=\\{)",
2485
+ "patterns": [
2486
+ {
2487
+ "include": "#comments"
2488
+ },
2489
+ {
2490
+ "include": "#condition-expression"
2491
+ }
2492
+ ]
2493
+ },
2494
+ "if-else-clause": {
2495
+ "name": "meta.else.baml",
2496
+ "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(else)\\b",
2497
+ "beginCaptures": {
2498
+ "1": {
2499
+ "name": "keyword.control.conditional.baml"
2500
+ }
2501
+ },
2502
+ "end": "(?!\\s*else\\b)(?:(?<=\\})(?=\\s*(?:[,);]|$))|(?=,|\\)|;|$))",
2503
+ "patterns": [
2504
+ {
2505
+ "include": "#comments"
2506
+ },
2507
+ {
2508
+ "include": "#if-expression"
2509
+ },
2510
+ {
2511
+ "include": "#code-block"
2512
+ }
2513
+ ]
2514
+ },
2515
+ "if-expression": {
2516
+ "name": "meta.expression.if.baml",
2517
+ "begin": "\\b(if)\\b",
2518
+ "beginCaptures": {
2519
+ "1": {
2520
+ "name": "keyword.control.conditional.baml"
2521
+ }
2522
+ },
2523
+ "end": "(?!\\s*else\\b)(?:(?<=\\})(?=\\s*(?:[,);]|$))|(?=,|\\)|;|$))",
2524
+ "patterns": [
2525
+ {
2526
+ "include": "#comments"
2527
+ },
2528
+ {
2529
+ "include": "#if-let-pattern"
2530
+ },
2531
+ {
2532
+ "include": "#assignment-operator"
2533
+ },
2534
+ {
2535
+ "include": "#if-condition"
2536
+ },
2537
+ {
2538
+ "include": "#code-block"
2539
+ },
2540
+ {
2541
+ "include": "#if-else-clause"
2542
+ }
2543
+ ]
2544
+ },
2545
+ "if-let-pattern": {
2546
+ "name": "meta.pattern.if-let.baml",
2547
+ "begin": "\\G\\s*(?=(?:let|const)\\b)",
2548
+ "end": "(?=\\s*=)",
2549
+ "patterns": [
2550
+ {
2551
+ "include": "#comments"
2552
+ },
2553
+ {
2554
+ "include": "#pattern"
2555
+ }
2556
+ ]
2557
+ },
2558
+ "implements-block": {
2559
+ "name": "meta.implements.baml",
2560
+ "begin": "^\\s*(implements|implement)\\b",
2561
+ "beginCaptures": {
2562
+ "1": {
2563
+ "name": "keyword.declaration.implements.baml"
2564
+ }
2565
+ },
2566
+ "end": "(?<=\\})",
2567
+ "patterns": [
2568
+ {
2569
+ "include": "#comments"
2570
+ },
2571
+ {
2572
+ "include": "#implements-target"
2573
+ },
2574
+ {
2575
+ "include": "#implements-body"
2576
+ }
2577
+ ]
2578
+ },
2579
+ "implements-body": {
2580
+ "name": "meta.implements.body.baml",
2581
+ "begin": "\\{",
2582
+ "beginCaptures": {
2583
+ "0": {
2584
+ "name": "punctuation.definition.block.begin.baml"
2585
+ }
2586
+ },
2587
+ "end": "\\}",
2588
+ "endCaptures": {
2589
+ "0": {
2590
+ "name": "punctuation.definition.block.end.baml"
2591
+ }
2592
+ },
2593
+ "patterns": [
2594
+ {
2595
+ "include": "#comments"
2596
+ },
2597
+ {
2598
+ "include": "#function"
2599
+ },
2600
+ {
2601
+ "include": "#associated-type"
2602
+ },
2603
+ {
2604
+ "include": "#interface-field-link"
2605
+ },
2606
+ {
2607
+ "include": "#field"
2608
+ },
2609
+ {
2610
+ "include": "#semicolon"
2611
+ },
2612
+ {
2613
+ "include": "#comma"
2614
+ }
2615
+ ]
2616
+ },
2617
+ "implements-for": {
2618
+ "name": "meta.implements-for.baml",
2619
+ "begin": "^\\s*(implements|implement)\\b",
2620
+ "beginCaptures": {
2621
+ "1": {
2622
+ "name": "keyword.declaration.implements.baml"
2623
+ }
2624
+ },
2625
+ "end": "(?<=\\})",
2626
+ "patterns": [
2627
+ {
2628
+ "include": "#comments"
2629
+ },
2630
+ {
2631
+ "include": "#declaration-type-parameters"
2632
+ },
2633
+ {
2634
+ "include": "#implements-for-interface-target"
2635
+ },
2636
+ {
2637
+ "include": "#implements-for-keyword"
2638
+ },
2639
+ {
2640
+ "include": "#implements-for-target"
2641
+ },
2642
+ {
2643
+ "include": "#implements-body"
2644
+ }
2645
+ ]
2646
+ },
2647
+ "implements-for-interface-target": {
2648
+ "name": "meta.implements.target.baml",
2649
+ "begin": "\\G\\s*",
2650
+ "end": "(?=\\s+\\bfor\\b)",
2651
+ "patterns": [
2652
+ {
2653
+ "include": "#comments"
2654
+ },
2655
+ {
2656
+ "include": "#type-expression"
2657
+ }
2658
+ ]
2659
+ },
2660
+ "implements-for-keyword": {
2661
+ "name": "keyword.declaration.for.baml",
2662
+ "match": "\\bfor\\b"
2663
+ },
2664
+ "implements-for-target": {
2665
+ "name": "meta.implements.for-target.baml",
2666
+ "begin": "\\G\\s*",
2667
+ "end": "(?=\\{)",
2668
+ "patterns": [
2669
+ {
2670
+ "include": "#comments"
2671
+ },
2672
+ {
2673
+ "include": "#type-expression"
2674
+ }
2675
+ ]
2676
+ },
2677
+ "implements-target": {
2678
+ "name": "meta.implements.target.baml",
2679
+ "begin": "\\G\\s*",
2680
+ "end": "(?=\\{)",
2681
+ "patterns": [
2682
+ {
2683
+ "include": "#comments"
2684
+ },
2685
+ {
2686
+ "include": "#type-expression"
2687
+ }
2688
+ ]
2689
+ },
2690
+ "integer-literal": {
2691
+ "name": "constant.numeric.integer.baml",
2692
+ "match": "\\b[0-9]+\\b"
2693
+ },
2694
+ "interface": {
2695
+ "name": "meta.interface.baml",
2696
+ "begin": "^\\s*(interface)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
2697
+ "beginCaptures": {
2698
+ "1": {
2699
+ "name": "keyword.declaration.interface.baml"
2700
+ },
2701
+ "2": {
2702
+ "name": "entity.name.type.interface.baml"
2703
+ }
2704
+ },
2705
+ "end": "(?<=\\})",
2706
+ "patterns": [
2707
+ {
2708
+ "include": "#comments"
2709
+ },
2710
+ {
2711
+ "include": "#declaration-type-parameters"
2712
+ },
2713
+ {
2714
+ "include": "#interface-requires-clause"
2715
+ },
2716
+ {
2717
+ "include": "#interface-body"
2718
+ }
2719
+ ]
2720
+ },
2721
+ "interface-body": {
2722
+ "name": "meta.interface.body.baml",
2723
+ "begin": "\\{",
2724
+ "beginCaptures": {
2725
+ "0": {
2726
+ "name": "punctuation.definition.block.begin.baml"
2727
+ }
2728
+ },
2729
+ "end": "\\}",
2730
+ "endCaptures": {
2731
+ "0": {
2732
+ "name": "punctuation.definition.block.end.baml"
2733
+ }
2734
+ },
2735
+ "patterns": [
2736
+ {
2737
+ "include": "#comments"
2738
+ },
2739
+ {
2740
+ "include": "#interface-method-signature"
2741
+ },
2742
+ {
2743
+ "include": "#function"
2744
+ },
2745
+ {
2746
+ "include": "#associated-type"
2747
+ },
2748
+ {
2749
+ "include": "#field"
2750
+ },
2751
+ {
2752
+ "include": "#semicolon"
2753
+ },
2754
+ {
2755
+ "include": "#comma"
2756
+ }
2757
+ ]
2758
+ },
2759
+ "interface-field-link": {
2760
+ "name": "meta.interface-field-link.baml",
2761
+ "begin": "(?:^\\s*|(?<=\\{)\\s*)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s+(as)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
2762
+ "beginCaptures": {
2763
+ "1": {
2764
+ "name": "variable.other.property.interface.baml"
2765
+ },
2766
+ "2": {
2767
+ "name": "keyword.operator.as.baml"
2768
+ },
2769
+ "3": {
2770
+ "name": "variable.other.property.baml"
2771
+ }
2772
+ },
2773
+ "end": "(?<=;)|(?=\\r?\\n|\\})",
2774
+ "patterns": [
2775
+ {
2776
+ "include": "#comments"
2777
+ },
2778
+ {
2779
+ "include": "#semicolon"
2780
+ }
2781
+ ]
2782
+ },
2783
+ "interface-method-return-type": {
2784
+ "name": "meta.return-type.baml",
2785
+ "begin": "(->)",
2786
+ "beginCaptures": {
2787
+ "1": {
2788
+ "name": "keyword.operator.arrow.baml"
2789
+ }
2790
+ },
2791
+ "end": "(?=;|\\r?\\n|\\})",
2792
+ "patterns": [
2793
+ {
2794
+ "include": "#comments"
2795
+ },
2796
+ {
2797
+ "include": "#type-expression"
2798
+ }
2799
+ ]
2800
+ },
2801
+ "interface-method-signature": {
2802
+ "name": "meta.function.signature.baml",
2803
+ "begin": "^\\s*(function)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=[^{\\r\\n]*(?:\\r?\\n|;|\\}))",
2804
+ "beginCaptures": {
2805
+ "1": {
2806
+ "name": "keyword.declaration.function.baml"
2807
+ },
2808
+ "2": {
2809
+ "name": "entity.name.function.baml"
2810
+ }
2811
+ },
2812
+ "end": "(?<=;)|(?=\\r?\\n|\\})",
2813
+ "patterns": [
2814
+ {
2815
+ "include": "#comments"
2816
+ },
2817
+ {
2818
+ "include": "#declaration-type-parameters"
2819
+ },
2820
+ {
2821
+ "include": "#function-parameters"
2822
+ },
2823
+ {
2824
+ "include": "#interface-method-return-type"
2825
+ },
2826
+ {
2827
+ "include": "#semicolon"
2828
+ }
2829
+ ]
2830
+ },
2831
+ "interface-requires-clause": {
2832
+ "name": "meta.interface.requires.baml",
2833
+ "begin": "\\b(requires)\\b",
2834
+ "beginCaptures": {
2835
+ "1": {
2836
+ "name": "keyword.declaration.requires.baml"
2837
+ }
2838
+ },
2839
+ "end": "(?=\\{)",
2840
+ "patterns": [
2841
+ {
2842
+ "include": "#comments"
2843
+ },
2844
+ {
2845
+ "include": "#type-expression"
2846
+ },
2847
+ {
2848
+ "include": "#comma"
2849
+ }
2850
+ ]
2851
+ },
2852
+ "is-pattern-expression": {
2853
+ "name": "meta.expression.is.baml",
2854
+ "begin": "\\b(is)\\b",
2855
+ "beginCaptures": {
2856
+ "1": {
2857
+ "name": "keyword.operator.is.baml"
2858
+ }
2859
+ },
2860
+ "end": "(?=\\s*(?:&&|\\|\\||=>|[,);\\]}]|$))",
2861
+ "patterns": [
2862
+ {
2863
+ "include": "#comments"
2864
+ },
2865
+ {
2866
+ "include": "#pattern"
2867
+ }
2868
+ ]
2869
+ },
2870
+ "lambda-arrow": {
2871
+ "name": "keyword.operator.arrow.baml",
2872
+ "match": "->|=>"
2873
+ },
2874
+ "lambda-expression": {
2875
+ "name": "meta.expression.lambda.baml",
2876
+ "begin": "(?=\\((?:[^()]|\\([^()]*\\))*\\)\\s*(?:->|=>))",
2877
+ "end": "(?<=\\})",
2878
+ "patterns": [
2879
+ {
2880
+ "include": "#comments"
2881
+ },
2882
+ {
2883
+ "include": "#function-parameters"
2884
+ },
2885
+ {
2886
+ "include": "#lambda-arrow"
2887
+ },
2888
+ {
2889
+ "include": "#lambda-return-type"
2890
+ },
2891
+ {
2892
+ "include": "#lambda-throws-clause"
2893
+ },
2894
+ {
2895
+ "include": "#code-block"
2896
+ }
2897
+ ]
2898
+ },
2899
+ "lambda-return-type": {
2900
+ "name": "meta.return-type.lambda.baml",
2901
+ "begin": "(?<=->|=>)\\s*(?!throws\\b)(?=[^\\s\\{])",
2902
+ "end": "(?=\\s*(?:throws\\b|\\{))",
2903
+ "patterns": [
2904
+ {
2905
+ "include": "#comments"
2906
+ },
2907
+ {
2908
+ "include": "#type-expression"
2909
+ }
2910
+ ]
2911
+ },
2912
+ "lambda-throws-clause": {
2913
+ "name": "meta.throws.lambda.baml",
2914
+ "begin": "\\b(throws)\\b",
2915
+ "beginCaptures": {
2916
+ "1": {
2917
+ "name": "keyword.operator.throws.baml"
2918
+ }
2919
+ },
2920
+ "end": "(?=\\{)",
2921
+ "patterns": [
2922
+ {
2923
+ "include": "#comments"
2924
+ },
2925
+ {
2926
+ "include": "#type-expression"
2927
+ }
2928
+ ]
2929
+ },
2930
+ "let-else-clause": {
2931
+ "name": "meta.statement.let.else.baml",
2932
+ "begin": "\\b(else)\\b(?=\\s*\\{)",
2933
+ "beginCaptures": {
2934
+ "1": {
2935
+ "name": "keyword.control.conditional.else.baml"
2936
+ }
2937
+ },
2938
+ "end": "(?<=\\})",
2939
+ "patterns": [
2940
+ {
2941
+ "include": "#comments"
2942
+ },
2943
+ {
2944
+ "include": "#code-block"
2945
+ }
2946
+ ]
2947
+ },
2948
+ "let-statement": {
2949
+ "name": "meta.statement.let.baml",
2950
+ "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(?=(?:let|const)\\b)",
2951
+ "end": "(?=[;}]|$)",
2952
+ "patterns": [
2953
+ {
2954
+ "include": "#comments"
2955
+ },
2956
+ {
2957
+ "include": "#let-statement-pattern"
2958
+ },
2959
+ {
2960
+ "include": "#assignment-operator"
2961
+ },
2962
+ {
2963
+ "include": "#let-else-clause"
2964
+ },
2965
+ {
2966
+ "include": "#expression"
2967
+ }
2968
+ ]
2969
+ },
2970
+ "let-statement-pattern": {
2971
+ "name": "meta.pattern.statement.baml",
2972
+ "begin": "\\G\\s*",
2973
+ "end": "(?=\\s*=)",
2974
+ "patterns": [
2975
+ {
2976
+ "include": "#comments"
2977
+ },
2978
+ {
2979
+ "include": "#pattern"
2980
+ }
2981
+ ]
2982
+ },
2983
+ "line-comment": {
2984
+ "name": "comment.line.double-slash.baml",
2985
+ "match": "//.*$"
2986
+ },
2987
+ "literal": {
2988
+ "patterns": [
2989
+ {
2990
+ "include": "#byte-string-literal"
2991
+ },
2992
+ {
2993
+ "include": "#type-literal"
2994
+ }
2995
+ ]
2996
+ },
2997
+ "llm-client-field": {
2998
+ "name": "meta.field.llm.client.baml",
2999
+ "begin": "^\\s*(client)\\b\\s*(:)?(?!\\s*\\.)",
3000
+ "beginCaptures": {
3001
+ "1": {
3002
+ "name": "keyword.other.llm.client.baml"
3003
+ },
3004
+ "2": {
3005
+ "name": "punctuation.separator.colon.baml"
3006
+ }
3007
+ },
3008
+ "end": "$",
3009
+ "patterns": [
3010
+ {
3011
+ "include": "#comments"
3012
+ },
3013
+ {
3014
+ "include": "#expression"
3015
+ }
3016
+ ]
3017
+ },
3018
+ "llm-prompt-field": {
3019
+ "name": "meta.field.llm.prompt.baml",
3020
+ "begin": "^\\s*(prompt)\\b\\s*(:)?",
3021
+ "beginCaptures": {
3022
+ "1": {
3023
+ "name": "keyword.other.llm.prompt.baml"
3024
+ },
3025
+ "2": {
3026
+ "name": "punctuation.separator.colon.baml"
3027
+ }
3028
+ },
3029
+ "end": "$",
3030
+ "patterns": [
3031
+ {
3032
+ "include": "#comments"
3033
+ },
3034
+ {
3035
+ "include": "#template-string-body"
3036
+ },
3037
+ {
3038
+ "include": "#backtick-string"
3039
+ },
3040
+ {
3041
+ "include": "#expression"
3042
+ }
3043
+ ]
3044
+ },
3045
+ "map-entry": {
3046
+ "name": "meta.map.entry.baml",
3047
+ "begin": "\\s*(?=(?:\"|#|\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*\\s*:))",
3048
+ "end": "(?=,|\\})",
3049
+ "patterns": [
3050
+ {
3051
+ "include": "#comments"
3052
+ },
3053
+ {
3054
+ "include": "#map-entry-key"
3055
+ },
3056
+ {
3057
+ "include": "#string-literal"
3058
+ },
3059
+ {
3060
+ "include": "#raw-string"
3061
+ },
3062
+ {
3063
+ "include": "#colon-separator"
3064
+ },
3065
+ {
3066
+ "include": "#expression"
3067
+ }
3068
+ ]
3069
+ },
3070
+ "map-entry-key": {
3071
+ "name": "meta.map-entry-key.baml",
3072
+ "match": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)((?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*)\\b(?=\\s*:)",
3073
+ "captures": {
3074
+ "1": {
3075
+ "name": "variable.other.property.baml"
3076
+ },
3077
+ "2": {
3078
+ "patterns": [
3079
+ {
3080
+ "include": "#accessor-dot"
3081
+ },
3082
+ {
3083
+ "include": "#map-entry-key-segment"
3084
+ }
3085
+ ]
3086
+ }
3087
+ }
3088
+ },
3089
+ "map-entry-key-segment": {
3090
+ "name": "variable.other.property.baml",
3091
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
3092
+ },
3093
+ "map-expression": {
3094
+ "name": "meta.expression.map.baml",
3095
+ "begin": "\\{(?=\\s*(?:\\}|[\"#]|\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*(?:\\s*\\.\\s*\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)*\\s*:))",
3096
+ "beginCaptures": {
3097
+ "0": {
3098
+ "name": "punctuation.definition.map.begin.baml"
3099
+ }
3100
+ },
3101
+ "end": "\\}",
3102
+ "endCaptures": {
3103
+ "0": {
3104
+ "name": "punctuation.definition.map.end.baml"
3105
+ }
3106
+ },
3107
+ "patterns": [
3108
+ {
3109
+ "include": "#comments"
3110
+ },
3111
+ {
3112
+ "include": "#map-entry"
3113
+ },
3114
+ {
3115
+ "include": "#comma"
3116
+ }
3117
+ ]
3118
+ },
3119
+ "match-arm": {
3120
+ "name": "meta.match.arm.baml",
3121
+ "begin": "(?=\\S)(?![,}])",
3122
+ "end": "(?=,|\\r?\\n|\\})",
3123
+ "patterns": [
3124
+ {
3125
+ "include": "#comments"
3126
+ },
3127
+ {
3128
+ "include": "#match-arm-pattern"
3129
+ },
3130
+ {
3131
+ "include": "#match-arm-guard"
3132
+ },
3133
+ {
3134
+ "include": "#match-arm-arrow"
3135
+ },
3136
+ {
3137
+ "include": "#expression"
3138
+ }
3139
+ ]
3140
+ },
3141
+ "match-arm-arrow": {
3142
+ "name": "keyword.operator.arrow.baml",
3143
+ "match": "=>"
3144
+ },
3145
+ "match-arm-guard": {
3146
+ "name": "meta.match.guard.baml",
3147
+ "begin": "\\b(if)\\b",
3148
+ "beginCaptures": {
3149
+ "1": {
3150
+ "name": "keyword.control.conditional.baml"
3151
+ }
3152
+ },
3153
+ "end": "(?=\\s*=>)",
3154
+ "patterns": [
3155
+ {
3156
+ "include": "#comments"
3157
+ },
3158
+ {
3159
+ "include": "#expression"
3160
+ }
3161
+ ]
3162
+ },
3163
+ "match-arm-pattern": {
3164
+ "name": "meta.pattern.match.baml",
3165
+ "begin": "\\G\\s*",
3166
+ "end": "(?=\\s*(?:if\\b|=>))",
3167
+ "patterns": [
3168
+ {
3169
+ "include": "#comments"
3170
+ },
3171
+ {
3172
+ "include": "#pattern"
3173
+ }
3174
+ ]
3175
+ },
3176
+ "match-block": {
3177
+ "name": "meta.block.match.baml",
3178
+ "begin": "\\{",
3179
+ "beginCaptures": {
3180
+ "0": {
3181
+ "name": "punctuation.definition.block.begin.baml"
3182
+ }
3183
+ },
3184
+ "end": "\\}",
3185
+ "endCaptures": {
3186
+ "0": {
3187
+ "name": "punctuation.definition.block.end.baml"
3188
+ }
3189
+ },
3190
+ "patterns": [
3191
+ {
3192
+ "include": "#comments"
3193
+ },
3194
+ {
3195
+ "include": "#match-arm"
3196
+ },
3197
+ {
3198
+ "include": "#comma"
3199
+ }
3200
+ ]
3201
+ },
3202
+ "match-expression": {
3203
+ "name": "meta.expression.match.baml",
3204
+ "begin": "\\b(match)\\b",
3205
+ "beginCaptures": {
3206
+ "1": {
3207
+ "name": "keyword.control.match.baml"
3208
+ }
3209
+ },
3210
+ "end": "(?<=\\})|(?=,|;|$)",
3211
+ "patterns": [
3212
+ {
3213
+ "include": "#comments"
3214
+ },
3215
+ {
3216
+ "include": "#match-scrutinee-group"
3217
+ },
3218
+ {
3219
+ "include": "#match-block"
3220
+ },
3221
+ {
3222
+ "include": "#match-scrutinee"
3223
+ }
3224
+ ]
3225
+ },
3226
+ "match-scrutinee": {
3227
+ "name": "meta.match.scrutinee.baml",
3228
+ "begin": "(?=[^\\s\\{])",
3229
+ "end": "(?=\\{)",
3230
+ "patterns": [
3231
+ {
3232
+ "include": "#comments"
3233
+ },
3234
+ {
3235
+ "include": "#literal"
3236
+ },
3237
+ {
3238
+ "include": "#array-expression"
3239
+ },
3240
+ {
3241
+ "include": "#spawn-expression"
3242
+ },
3243
+ {
3244
+ "include": "#await-expression"
3245
+ },
3246
+ {
3247
+ "include": "#throw-expression"
3248
+ },
3249
+ {
3250
+ "include": "#catch-expression"
3251
+ },
3252
+ {
3253
+ "include": "#expression-operator"
3254
+ },
3255
+ {
3256
+ "include": "#function-call-expression"
3257
+ },
3258
+ {
3259
+ "include": "#dotted-expression"
3260
+ }
3261
+ ]
3262
+ },
3263
+ "match-scrutinee-group": {
3264
+ "name": "meta.match.scrutinee.group.baml",
3265
+ "begin": "\\(",
3266
+ "beginCaptures": {
3267
+ "0": {
3268
+ "name": "punctuation.definition.group.begin.baml"
3269
+ }
3270
+ },
3271
+ "end": "\\)",
3272
+ "endCaptures": {
3273
+ "0": {
3274
+ "name": "punctuation.definition.group.end.baml"
3275
+ }
3276
+ },
3277
+ "patterns": [
3278
+ {
3279
+ "include": "#comments"
3280
+ },
3281
+ {
3282
+ "include": "#expression"
3283
+ },
3284
+ {
3285
+ "include": "#type-expression"
3286
+ }
3287
+ ]
3288
+ },
3289
+ "namespace-root": {
3290
+ "name": "support.other.namespace.baml",
3291
+ "match": "\\b(?:root|baml)\\b"
3292
+ },
3293
+ "namespace-segment": {
3294
+ "name": "entity.name.namespace.baml",
3295
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
3296
+ },
3297
+ "null-literal": {
3298
+ "name": "constant.language.null.baml",
3299
+ "match": "\\bnull\\b"
3300
+ },
3301
+ "numeric-literal": {
3302
+ "patterns": [
3303
+ {
3304
+ "include": "#bigint-literal"
3305
+ },
3306
+ {
3307
+ "include": "#float-literal"
3308
+ },
3309
+ {
3310
+ "include": "#integer-literal"
3311
+ }
3312
+ ]
3313
+ },
3314
+ "optional-call-expression": {
3315
+ "name": "meta.function-call.optional.baml",
3316
+ "begin": "(\\?\\.)\\s*(?=\\()",
3317
+ "beginCaptures": {
3318
+ "1": {
3319
+ "name": "punctuation.accessor.baml"
3320
+ }
3321
+ },
3322
+ "end": "(?<=\\))",
3323
+ "patterns": [
3324
+ {
3325
+ "include": "#comments"
3326
+ },
3327
+ {
3328
+ "include": "#call-arguments"
3329
+ }
3330
+ ]
3331
+ },
3332
+ "optional-field-access-expression": {
3333
+ "name": "meta.field-access.optional.baml",
3334
+ "match": "(\\?\\.)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
3335
+ "captures": {
3336
+ "1": {
3337
+ "name": "punctuation.accessor.baml"
3338
+ },
3339
+ "2": {
3340
+ "name": "variable.other.readwrite.baml"
3341
+ }
3342
+ }
3343
+ },
3344
+ "optional-index-arguments": {
3345
+ "name": "meta.index.arguments.baml",
3346
+ "begin": "\\[",
3347
+ "beginCaptures": {
3348
+ "0": {
3349
+ "name": "punctuation.definition.bracket.begin.baml"
3350
+ }
3351
+ },
3352
+ "end": "\\]",
3353
+ "endCaptures": {
3354
+ "0": {
3355
+ "name": "punctuation.definition.bracket.end.baml"
3356
+ }
3357
+ },
3358
+ "patterns": [
3359
+ {
3360
+ "include": "#comments"
3361
+ },
3362
+ {
3363
+ "include": "#expression"
3364
+ }
3365
+ ]
3366
+ },
3367
+ "optional-index-expression": {
3368
+ "name": "meta.index.optional.baml",
3369
+ "begin": "(\\?\\.)\\s*(?=\\[)",
3370
+ "beginCaptures": {
3371
+ "1": {
3372
+ "name": "punctuation.accessor.baml"
3373
+ }
3374
+ },
3375
+ "end": "(?<=\\])",
3376
+ "patterns": [
3377
+ {
3378
+ "include": "#comments"
3379
+ },
3380
+ {
3381
+ "include": "#optional-index-arguments"
3382
+ }
3383
+ ]
3384
+ },
3385
+ "optional-method-call-expression": {
3386
+ "name": "meta.function-call.optional.member.baml",
3387
+ "begin": "(\\?\\.)\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*(?:<[^(){};]*>\\s*)?\\()",
3388
+ "beginCaptures": {
3389
+ "1": {
3390
+ "name": "punctuation.accessor.baml"
3391
+ },
3392
+ "2": {
3393
+ "name": "entity.name.function.baml"
3394
+ }
3395
+ },
3396
+ "end": "(?<=\\))",
3397
+ "patterns": [
3398
+ {
3399
+ "include": "#comments"
3400
+ },
3401
+ {
3402
+ "include": "#optional-method-call-type-arguments"
3403
+ },
3404
+ {
3405
+ "include": "#call-arguments"
3406
+ }
3407
+ ]
3408
+ },
3409
+ "optional-method-call-type-arguments": {
3410
+ "name": "meta.type-arguments.baml",
3411
+ "begin": "<",
3412
+ "beginCaptures": {
3413
+ "0": {
3414
+ "name": "punctuation.definition.type-arguments.begin.baml"
3415
+ }
3416
+ },
3417
+ "end": ">(?=\\s*\\()",
3418
+ "endCaptures": {
3419
+ "0": {
3420
+ "name": "punctuation.definition.type-arguments.end.baml"
3421
+ }
3422
+ },
3423
+ "patterns": [
3424
+ {
3425
+ "include": "#comments"
3426
+ },
3427
+ {
3428
+ "include": "#type-expression"
3429
+ }
3430
+ ]
3431
+ },
3432
+ "optional-operator": {
3433
+ "name": "keyword.operator.optional.baml",
3434
+ "match": "\\?"
3435
+ },
3436
+ "parameter": {
3437
+ "name": "meta.parameter.baml",
3438
+ "begin": "\\b(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(:)?",
3439
+ "beginCaptures": {
3440
+ "1": {
3441
+ "name": "variable.parameter.baml"
3442
+ },
3443
+ "2": {
3444
+ "name": "punctuation.separator.colon.baml"
3445
+ }
3446
+ },
3447
+ "end": "(?=,|\\))",
3448
+ "patterns": [
3449
+ {
3450
+ "include": "#comments"
3451
+ },
3452
+ {
3453
+ "include": "#parameter-type-parens"
3454
+ },
3455
+ {
3456
+ "include": "#parameter-type-arguments"
3457
+ },
3458
+ {
3459
+ "include": "#parameter-default"
3460
+ },
3461
+ {
3462
+ "include": "#type-expression"
3463
+ }
3464
+ ]
3465
+ },
3466
+ "parameter-default": {
3467
+ "name": "meta.parameter.default.baml",
3468
+ "begin": "=",
3469
+ "beginCaptures": {
3470
+ "0": {
3471
+ "name": "keyword.operator.assignment.baml"
3472
+ }
3473
+ },
3474
+ "end": "(?=,|\\))",
3475
+ "patterns": [
3476
+ {
3477
+ "include": "#comments"
3478
+ },
3479
+ {
3480
+ "include": "#expression"
3481
+ }
3482
+ ]
3483
+ },
3484
+ "parameter-type-arguments": {
3485
+ "name": "meta.type-arguments.baml",
3486
+ "begin": "<",
3487
+ "beginCaptures": {
3488
+ "0": {
3489
+ "name": "punctuation.definition.type-arguments.begin.baml"
3490
+ }
3491
+ },
3492
+ "end": ">",
3493
+ "endCaptures": {
3494
+ "0": {
3495
+ "name": "punctuation.definition.type-arguments.end.baml"
3496
+ }
3497
+ },
3498
+ "patterns": [
3499
+ {
3500
+ "include": "#comments"
3501
+ },
3502
+ {
3503
+ "include": "#type-expression"
3504
+ }
3505
+ ]
3506
+ },
3507
+ "parameter-type-parens": {
3508
+ "name": "meta.group.type.baml",
3509
+ "begin": "\\(",
3510
+ "beginCaptures": {
3511
+ "0": {
3512
+ "name": "punctuation.definition.type.begin.baml"
3513
+ }
3514
+ },
3515
+ "end": "\\)",
3516
+ "endCaptures": {
3517
+ "0": {
3518
+ "name": "punctuation.definition.type.end.baml"
3519
+ }
3520
+ },
3521
+ "patterns": [
3522
+ {
3523
+ "include": "#comments"
3524
+ },
3525
+ {
3526
+ "include": "#type-expression"
3527
+ }
3528
+ ]
3529
+ },
3530
+ "parenthesized-expression": {
3531
+ "name": "meta.group.expression.baml",
3532
+ "begin": "\\(",
3533
+ "beginCaptures": {
3534
+ "0": {
3535
+ "name": "punctuation.definition.group.begin.baml"
3536
+ }
3537
+ },
3538
+ "end": "\\)",
3539
+ "endCaptures": {
3540
+ "0": {
3541
+ "name": "punctuation.definition.group.end.baml"
3542
+ }
3543
+ },
3544
+ "patterns": [
3545
+ {
3546
+ "include": "#comments"
3547
+ },
3548
+ {
3549
+ "include": "#expression"
3550
+ }
3551
+ ]
3552
+ },
3553
+ "pattern": {
3554
+ "patterns": [
3555
+ {
3556
+ "include": "#comments"
3557
+ },
3558
+ {
3559
+ "include": "#wildcard-binding-pattern"
3560
+ },
3561
+ {
3562
+ "include": "#typed-binding-pattern"
3563
+ },
3564
+ {
3565
+ "include": "#class-destructure-pattern"
3566
+ },
3567
+ {
3568
+ "include": "#array-destructure-pattern"
3569
+ },
3570
+ {
3571
+ "include": "#bare-binding-pattern"
3572
+ },
3573
+ {
3574
+ "include": "#wildcard-pattern"
3575
+ },
3576
+ {
3577
+ "include": "#type-expression"
3578
+ }
3579
+ ]
3580
+ },
3581
+ "postfix-method-call-expression": {
3582
+ "name": "meta.function-call.member.baml",
3583
+ "begin": "([.$])\\s*(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*(?:<[^(){};]*>\\s*)?\\()",
3584
+ "beginCaptures": {
3585
+ "1": {
3586
+ "name": "punctuation.accessor.baml"
3587
+ },
3588
+ "2": {
3589
+ "name": "entity.name.function.baml"
3590
+ }
3591
+ },
3592
+ "end": "(?<=\\))",
3593
+ "patterns": [
3594
+ {
3595
+ "include": "#comments"
3596
+ },
3597
+ {
3598
+ "include": "#postfix-method-call-type-arguments"
3599
+ },
3600
+ {
3601
+ "include": "#call-arguments"
3602
+ }
3603
+ ]
3604
+ },
3605
+ "postfix-method-call-type-arguments": {
3606
+ "name": "meta.type-arguments.baml",
3607
+ "begin": "<",
3608
+ "beginCaptures": {
3609
+ "0": {
3610
+ "name": "punctuation.definition.type-arguments.begin.baml"
3611
+ }
3612
+ },
3613
+ "end": ">(?=\\s*\\()",
3614
+ "endCaptures": {
3615
+ "0": {
3616
+ "name": "punctuation.definition.type-arguments.end.baml"
3617
+ }
3618
+ },
3619
+ "patterns": [
3620
+ {
3621
+ "include": "#comments"
3622
+ },
3623
+ {
3624
+ "include": "#type-expression"
3625
+ }
3626
+ ]
3627
+ },
3628
+ "primitive-type": {
3629
+ "name": "support.type.primitive.baml",
3630
+ "match": "\\b(?:int|float|bigint|string|bool|image|audio|map|json|unknown|never|Self)\\b"
3631
+ },
3632
+ "raw-string": {
3633
+ "patterns": [
3634
+ {
3635
+ "include": "#raw-string-8"
3636
+ },
3637
+ {
3638
+ "include": "#raw-string-7"
3639
+ },
3640
+ {
3641
+ "include": "#raw-string-6"
3642
+ },
3643
+ {
3644
+ "include": "#raw-string-5"
3645
+ },
3646
+ {
3647
+ "include": "#raw-string-4"
3648
+ },
3649
+ {
3650
+ "include": "#raw-string-3"
3651
+ },
3652
+ {
3653
+ "include": "#raw-string-2"
3654
+ },
3655
+ {
3656
+ "include": "#raw-string-1"
3657
+ }
3658
+ ]
3659
+ },
3660
+ "raw-string-1": {
3661
+ "name": "string.quoted.raw.baml",
3662
+ "begin": "(?<!#)(#{1})\"",
3663
+ "beginCaptures": {
3664
+ "1": {
3665
+ "name": "punctuation.definition.string.begin.baml"
3666
+ }
3667
+ },
3668
+ "end": "\"(#{1})",
3669
+ "endCaptures": {
3670
+ "1": {
3671
+ "name": "punctuation.definition.string.end.baml"
3672
+ }
3673
+ }
3674
+ },
3675
+ "raw-string-2": {
3676
+ "name": "string.quoted.raw.baml",
3677
+ "begin": "(?<!#)(#{2})\"",
3678
+ "beginCaptures": {
3679
+ "1": {
3680
+ "name": "punctuation.definition.string.begin.baml"
3681
+ }
3682
+ },
3683
+ "end": "\"(#{2})",
3684
+ "endCaptures": {
3685
+ "1": {
3686
+ "name": "punctuation.definition.string.end.baml"
3687
+ }
3688
+ }
3689
+ },
3690
+ "raw-string-3": {
3691
+ "name": "string.quoted.raw.baml",
3692
+ "begin": "(?<!#)(#{3})\"",
3693
+ "beginCaptures": {
3694
+ "1": {
3695
+ "name": "punctuation.definition.string.begin.baml"
3696
+ }
3697
+ },
3698
+ "end": "\"(#{3})",
3699
+ "endCaptures": {
3700
+ "1": {
3701
+ "name": "punctuation.definition.string.end.baml"
3702
+ }
3703
+ }
3704
+ },
3705
+ "raw-string-4": {
3706
+ "name": "string.quoted.raw.baml",
3707
+ "begin": "(?<!#)(#{4})\"",
3708
+ "beginCaptures": {
3709
+ "1": {
3710
+ "name": "punctuation.definition.string.begin.baml"
3711
+ }
3712
+ },
3713
+ "end": "\"(#{4})",
3714
+ "endCaptures": {
3715
+ "1": {
3716
+ "name": "punctuation.definition.string.end.baml"
3717
+ }
3718
+ }
3719
+ },
3720
+ "raw-string-5": {
3721
+ "name": "string.quoted.raw.baml",
3722
+ "begin": "(?<!#)(#{5})\"",
3723
+ "beginCaptures": {
3724
+ "1": {
3725
+ "name": "punctuation.definition.string.begin.baml"
3726
+ }
3727
+ },
3728
+ "end": "\"(#{5})",
3729
+ "endCaptures": {
3730
+ "1": {
3731
+ "name": "punctuation.definition.string.end.baml"
3732
+ }
3733
+ }
3734
+ },
3735
+ "raw-string-6": {
3736
+ "name": "string.quoted.raw.baml",
3737
+ "begin": "(?<!#)(#{6})\"",
3738
+ "beginCaptures": {
3739
+ "1": {
3740
+ "name": "punctuation.definition.string.begin.baml"
3741
+ }
3742
+ },
3743
+ "end": "\"(#{6})",
3744
+ "endCaptures": {
3745
+ "1": {
3746
+ "name": "punctuation.definition.string.end.baml"
3747
+ }
3748
+ }
3749
+ },
3750
+ "raw-string-7": {
3751
+ "name": "string.quoted.raw.baml",
3752
+ "begin": "(?<!#)(#{7})\"",
3753
+ "beginCaptures": {
3754
+ "1": {
3755
+ "name": "punctuation.definition.string.begin.baml"
3756
+ }
3757
+ },
3758
+ "end": "\"(#{7})",
3759
+ "endCaptures": {
3760
+ "1": {
3761
+ "name": "punctuation.definition.string.end.baml"
3762
+ }
3763
+ }
3764
+ },
3765
+ "raw-string-8": {
3766
+ "name": "string.quoted.raw.baml",
3767
+ "begin": "(?<!#)(#{8})\"",
3768
+ "beginCaptures": {
3769
+ "1": {
3770
+ "name": "punctuation.definition.string.begin.baml"
3771
+ }
3772
+ },
3773
+ "end": "\"(#{8})",
3774
+ "endCaptures": {
3775
+ "1": {
3776
+ "name": "punctuation.definition.string.end.baml"
3777
+ }
3778
+ }
3779
+ },
3780
+ "retry-policy": {
3781
+ "name": "meta.retry-policy.baml",
3782
+ "begin": "^\\s*(retry_policy)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b(?=\\s*\\{)",
3783
+ "beginCaptures": {
3784
+ "1": {
3785
+ "name": "keyword.declaration.retry-policy.baml"
3786
+ },
3787
+ "2": {
3788
+ "name": "entity.name.retry-policy.baml"
3789
+ }
3790
+ },
3791
+ "end": "(?<=\\})",
3792
+ "patterns": [
3793
+ {
3794
+ "include": "#comments"
3795
+ },
3796
+ {
3797
+ "include": "#config-block"
3798
+ }
3799
+ ]
3800
+ },
3801
+ "return-statement": {
3802
+ "name": "meta.statement.return.baml",
3803
+ "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(return)\\b",
3804
+ "beginCaptures": {
3805
+ "1": {
3806
+ "name": "keyword.control.flow.return.baml"
3807
+ }
3808
+ },
3809
+ "end": "(?=[;}]|$)",
3810
+ "patterns": [
3811
+ {
3812
+ "include": "#comments"
3813
+ },
3814
+ {
3815
+ "include": "#expression"
3816
+ }
3817
+ ]
3818
+ },
3819
+ "self-expression-root": {
3820
+ "name": "variable.language.self.baml",
3821
+ "match": "\\bself\\b"
3822
+ },
3823
+ "self-parameter": {
3824
+ "name": "meta.parameter.baml",
3825
+ "begin": "\\b(self)\\b(?=\\s*(?:,|\\)))",
3826
+ "beginCaptures": {
3827
+ "1": {
3828
+ "name": "variable.language.self.baml"
3829
+ }
3830
+ },
3831
+ "end": "(?=\\s*(?:,|\\)))",
3832
+ "patterns": [
3833
+ {
3834
+ "include": "#comments"
3835
+ }
3836
+ ]
3837
+ },
3838
+ "semicolon": {
3839
+ "name": "punctuation.terminator.statement.baml",
3840
+ "match": ";"
3841
+ },
3842
+ "spawn-expression": {
3843
+ "name": "meta.expression.spawn.baml",
3844
+ "begin": "\\b(spawn)\\b",
3845
+ "beginCaptures": {
3846
+ "1": {
3847
+ "name": "keyword.operator.spawn.baml"
3848
+ }
3849
+ },
3850
+ "end": "(?<=\\})|(?=,|;|$)",
3851
+ "patterns": [
3852
+ {
3853
+ "include": "#comments"
3854
+ },
3855
+ {
3856
+ "include": "#spawn-header"
3857
+ },
3858
+ {
3859
+ "include": "#code-block"
3860
+ }
3861
+ ]
3862
+ },
3863
+ "spawn-header": {
3864
+ "name": "meta.spawn.header.baml",
3865
+ "begin": "\\G\\s*",
3866
+ "end": "(?=\\{)",
3867
+ "patterns": [
3868
+ {
3869
+ "include": "#comments"
3870
+ },
3871
+ {
3872
+ "include": "#spawn-name"
3873
+ },
3874
+ {
3875
+ "include": "#spawn-with-clause"
3876
+ }
3877
+ ]
3878
+ },
3879
+ "spawn-name": {
3880
+ "name": "meta.spawn.name.baml",
3881
+ "begin": "\\G\\s*(?!with\\b)(?=[^\\{\\r\\n])",
3882
+ "end": "(?=\\s+with\\b|\\s*\\{)",
3883
+ "patterns": [
3884
+ {
3885
+ "include": "#comments"
3886
+ },
3887
+ {
3888
+ "include": "#condition-expression"
3889
+ }
3890
+ ]
3891
+ },
3892
+ "spawn-with-clause": {
3893
+ "name": "meta.spawn.options.baml",
3894
+ "begin": "\\b(with)\\b",
3895
+ "beginCaptures": {
3896
+ "1": {
3897
+ "name": "keyword.operator.with.baml"
3898
+ }
3899
+ },
3900
+ "end": "(?=\\{)",
3901
+ "patterns": [
3902
+ {
3903
+ "include": "#comments"
3904
+ },
3905
+ {
3906
+ "include": "#condition-expression"
3907
+ },
3908
+ {
3909
+ "include": "#comma"
3910
+ }
3911
+ ]
3912
+ },
3913
+ "string-escape": {
3914
+ "patterns": [
3915
+ {
3916
+ "include": "#string-escape-control"
3917
+ },
3918
+ {
3919
+ "include": "#string-escape-quoted-delimiter"
3920
+ },
3921
+ {
3922
+ "include": "#string-escape-unknown"
3923
+ }
3924
+ ]
3925
+ },
3926
+ "string-escape-control": {
3927
+ "name": "constant.character.escape.control.baml",
3928
+ "match": "\\\\[ntr0bvf]"
3929
+ },
3930
+ "string-escape-quoted-delimiter": {
3931
+ "name": "constant.character.escape.delimiter.baml",
3932
+ "match": "\\\\[\"\\\\]"
3933
+ },
3934
+ "string-escape-unknown": {
3935
+ "name": "constant.character.escape.unknown.baml",
3936
+ "match": "\\\\."
3937
+ },
3938
+ "string-literal": {
3939
+ "name": "string.quoted.double.baml",
3940
+ "begin": "\"",
3941
+ "beginCaptures": {
3942
+ "0": {
3943
+ "name": "punctuation.definition.string.begin.baml"
3944
+ }
3945
+ },
3946
+ "end": "\"",
3947
+ "endCaptures": {
3948
+ "0": {
3949
+ "name": "punctuation.definition.string.end.baml"
3950
+ }
3951
+ },
3952
+ "patterns": [
3953
+ {
3954
+ "include": "#string-escape"
3955
+ }
3956
+ ]
3957
+ },
3958
+ "template-comment": {
3959
+ "name": "comment.block.template.baml",
3960
+ "begin": "\\{#",
3961
+ "beginCaptures": {
3962
+ "0": {
3963
+ "name": "punctuation.definition.comment.begin.baml"
3964
+ }
3965
+ },
3966
+ "end": "#\\}",
3967
+ "endCaptures": {
3968
+ "0": {
3969
+ "name": "punctuation.definition.comment.end.baml"
3970
+ }
3971
+ }
3972
+ },
3973
+ "template-control": {
3974
+ "name": "meta.template.control.baml",
3975
+ "begin": "\\{%",
3976
+ "beginCaptures": {
3977
+ "0": {
3978
+ "name": "punctuation.section.template.begin.baml"
3979
+ }
3980
+ },
3981
+ "end": "%\\}",
3982
+ "endCaptures": {
3983
+ "0": {
3984
+ "name": "punctuation.section.template.end.baml"
3985
+ }
3986
+ },
3987
+ "patterns": [
3988
+ {
3989
+ "include": "#comments"
3990
+ },
3991
+ {
3992
+ "include": "#template-keyword"
3993
+ },
3994
+ {
3995
+ "include": "#expression"
3996
+ }
3997
+ ]
3998
+ },
3999
+ "template-interpolation": {
4000
+ "name": "meta.template.interpolation.baml",
4001
+ "begin": "\\{\\{",
4002
+ "beginCaptures": {
4003
+ "0": {
4004
+ "name": "punctuation.section.interpolation.begin.baml"
4005
+ }
4006
+ },
4007
+ "end": "\\}\\}",
4008
+ "endCaptures": {
4009
+ "0": {
4010
+ "name": "punctuation.section.interpolation.end.baml"
4011
+ }
4012
+ },
4013
+ "patterns": [
4014
+ {
4015
+ "include": "#comments"
4016
+ },
4017
+ {
4018
+ "include": "#template-keyword"
4019
+ },
4020
+ {
4021
+ "include": "#expression"
4022
+ }
4023
+ ]
4024
+ },
4025
+ "template-keyword": {
4026
+ "name": "keyword.control.template.baml",
4027
+ "match": "\\b(?:for|endfor|if|elif|else|endif|in|set|filter|endfilter|macro|endmacro|raw|endraw)\\b"
4028
+ },
4029
+ "template-quoted-string-body": {
4030
+ "name": "string.quoted.double.template.baml",
4031
+ "begin": "\"",
4032
+ "beginCaptures": {
4033
+ "0": {
4034
+ "name": "punctuation.definition.string.begin.baml"
4035
+ }
4036
+ },
4037
+ "end": "\"",
4038
+ "endCaptures": {
4039
+ "0": {
4040
+ "name": "punctuation.definition.string.end.baml"
4041
+ }
4042
+ },
4043
+ "patterns": [
4044
+ {
4045
+ "include": "#template-comment"
4046
+ },
4047
+ {
4048
+ "include": "#template-control"
4049
+ },
4050
+ {
4051
+ "include": "#template-interpolation"
4052
+ },
4053
+ {
4054
+ "include": "#string-escape"
4055
+ }
4056
+ ]
4057
+ },
4058
+ "template-raw-string-body-1": {
4059
+ "name": "string.quoted.raw.template.baml",
4060
+ "begin": "(?<!#)(#{1})(\")",
4061
+ "beginCaptures": {
4062
+ "1": {
4063
+ "name": "punctuation.definition.string.begin.baml"
4064
+ },
4065
+ "2": {
4066
+ "name": "punctuation.definition.string.begin.baml"
4067
+ }
4068
+ },
4069
+ "end": "(\")(#{1})",
4070
+ "endCaptures": {
4071
+ "1": {
4072
+ "name": "punctuation.definition.string.end.baml"
4073
+ },
4074
+ "2": {
4075
+ "name": "punctuation.definition.string.end.baml"
4076
+ }
4077
+ },
4078
+ "patterns": [
4079
+ {
4080
+ "include": "#template-comment"
4081
+ },
4082
+ {
4083
+ "include": "#template-control"
4084
+ },
4085
+ {
4086
+ "include": "#template-interpolation"
4087
+ }
4088
+ ]
4089
+ },
4090
+ "template-raw-string-body-2": {
4091
+ "name": "string.quoted.raw.template.baml",
4092
+ "begin": "(?<!#)(#{2})(\")",
4093
+ "beginCaptures": {
4094
+ "1": {
4095
+ "name": "punctuation.definition.string.begin.baml"
4096
+ },
4097
+ "2": {
4098
+ "name": "punctuation.definition.string.begin.baml"
4099
+ }
4100
+ },
4101
+ "end": "(\")(#{2})",
4102
+ "endCaptures": {
4103
+ "1": {
4104
+ "name": "punctuation.definition.string.end.baml"
4105
+ },
4106
+ "2": {
4107
+ "name": "punctuation.definition.string.end.baml"
4108
+ }
4109
+ },
4110
+ "patterns": [
4111
+ {
4112
+ "include": "#template-comment"
4113
+ },
4114
+ {
4115
+ "include": "#template-control"
4116
+ },
4117
+ {
4118
+ "include": "#template-interpolation"
4119
+ }
4120
+ ]
4121
+ },
4122
+ "template-raw-string-body-3": {
4123
+ "name": "string.quoted.raw.template.baml",
4124
+ "begin": "(?<!#)(#{3})(\")",
4125
+ "beginCaptures": {
4126
+ "1": {
4127
+ "name": "punctuation.definition.string.begin.baml"
4128
+ },
4129
+ "2": {
4130
+ "name": "punctuation.definition.string.begin.baml"
4131
+ }
4132
+ },
4133
+ "end": "(\")(#{3})",
4134
+ "endCaptures": {
4135
+ "1": {
4136
+ "name": "punctuation.definition.string.end.baml"
4137
+ },
4138
+ "2": {
4139
+ "name": "punctuation.definition.string.end.baml"
4140
+ }
4141
+ },
4142
+ "patterns": [
4143
+ {
4144
+ "include": "#template-comment"
4145
+ },
4146
+ {
4147
+ "include": "#template-control"
4148
+ },
4149
+ {
4150
+ "include": "#template-interpolation"
4151
+ }
4152
+ ]
4153
+ },
4154
+ "template-raw-string-body-4": {
4155
+ "name": "string.quoted.raw.template.baml",
4156
+ "begin": "(?<!#)(#{4})(\")",
4157
+ "beginCaptures": {
4158
+ "1": {
4159
+ "name": "punctuation.definition.string.begin.baml"
4160
+ },
4161
+ "2": {
4162
+ "name": "punctuation.definition.string.begin.baml"
4163
+ }
4164
+ },
4165
+ "end": "(\")(#{4})",
4166
+ "endCaptures": {
4167
+ "1": {
4168
+ "name": "punctuation.definition.string.end.baml"
4169
+ },
4170
+ "2": {
4171
+ "name": "punctuation.definition.string.end.baml"
4172
+ }
4173
+ },
4174
+ "patterns": [
4175
+ {
4176
+ "include": "#template-comment"
4177
+ },
4178
+ {
4179
+ "include": "#template-control"
4180
+ },
4181
+ {
4182
+ "include": "#template-interpolation"
4183
+ }
4184
+ ]
4185
+ },
4186
+ "template-raw-string-body-5": {
4187
+ "name": "string.quoted.raw.template.baml",
4188
+ "begin": "(?<!#)(#{5})(\")",
4189
+ "beginCaptures": {
4190
+ "1": {
4191
+ "name": "punctuation.definition.string.begin.baml"
4192
+ },
4193
+ "2": {
4194
+ "name": "punctuation.definition.string.begin.baml"
4195
+ }
4196
+ },
4197
+ "end": "(\")(#{5})",
4198
+ "endCaptures": {
4199
+ "1": {
4200
+ "name": "punctuation.definition.string.end.baml"
4201
+ },
4202
+ "2": {
4203
+ "name": "punctuation.definition.string.end.baml"
4204
+ }
4205
+ },
4206
+ "patterns": [
4207
+ {
4208
+ "include": "#template-comment"
4209
+ },
4210
+ {
4211
+ "include": "#template-control"
4212
+ },
4213
+ {
4214
+ "include": "#template-interpolation"
4215
+ }
4216
+ ]
4217
+ },
4218
+ "template-raw-string-body-6": {
4219
+ "name": "string.quoted.raw.template.baml",
4220
+ "begin": "(?<!#)(#{6})(\")",
4221
+ "beginCaptures": {
4222
+ "1": {
4223
+ "name": "punctuation.definition.string.begin.baml"
4224
+ },
4225
+ "2": {
4226
+ "name": "punctuation.definition.string.begin.baml"
4227
+ }
4228
+ },
4229
+ "end": "(\")(#{6})",
4230
+ "endCaptures": {
4231
+ "1": {
4232
+ "name": "punctuation.definition.string.end.baml"
4233
+ },
4234
+ "2": {
4235
+ "name": "punctuation.definition.string.end.baml"
4236
+ }
4237
+ },
4238
+ "patterns": [
4239
+ {
4240
+ "include": "#template-comment"
4241
+ },
4242
+ {
4243
+ "include": "#template-control"
4244
+ },
4245
+ {
4246
+ "include": "#template-interpolation"
4247
+ }
4248
+ ]
4249
+ },
4250
+ "template-raw-string-body-7": {
4251
+ "name": "string.quoted.raw.template.baml",
4252
+ "begin": "(?<!#)(#{7})(\")",
4253
+ "beginCaptures": {
4254
+ "1": {
4255
+ "name": "punctuation.definition.string.begin.baml"
4256
+ },
4257
+ "2": {
4258
+ "name": "punctuation.definition.string.begin.baml"
4259
+ }
4260
+ },
4261
+ "end": "(\")(#{7})",
4262
+ "endCaptures": {
4263
+ "1": {
4264
+ "name": "punctuation.definition.string.end.baml"
4265
+ },
4266
+ "2": {
4267
+ "name": "punctuation.definition.string.end.baml"
4268
+ }
4269
+ },
4270
+ "patterns": [
4271
+ {
4272
+ "include": "#template-comment"
4273
+ },
4274
+ {
4275
+ "include": "#template-control"
4276
+ },
4277
+ {
4278
+ "include": "#template-interpolation"
4279
+ }
4280
+ ]
4281
+ },
4282
+ "template-raw-string-body-8": {
4283
+ "name": "string.quoted.raw.template.baml",
4284
+ "begin": "(?<!#)(#{8})(\")",
4285
+ "beginCaptures": {
4286
+ "1": {
4287
+ "name": "punctuation.definition.string.begin.baml"
4288
+ },
4289
+ "2": {
4290
+ "name": "punctuation.definition.string.begin.baml"
4291
+ }
4292
+ },
4293
+ "end": "(\")(#{8})",
4294
+ "endCaptures": {
4295
+ "1": {
4296
+ "name": "punctuation.definition.string.end.baml"
4297
+ },
4298
+ "2": {
4299
+ "name": "punctuation.definition.string.end.baml"
4300
+ }
4301
+ },
4302
+ "patterns": [
4303
+ {
4304
+ "include": "#template-comment"
4305
+ },
4306
+ {
4307
+ "include": "#template-control"
4308
+ },
4309
+ {
4310
+ "include": "#template-interpolation"
4311
+ }
4312
+ ]
4313
+ },
4314
+ "template-string": {
4315
+ "name": "meta.template-string.baml",
4316
+ "begin": "^\\s*(template_string)\\b",
4317
+ "beginCaptures": {
4318
+ "1": {
4319
+ "name": "keyword.declaration.template-string.baml"
4320
+ }
4321
+ },
4322
+ "end": "(?:(?<=#)|(?<=\"))(?=\\s*(?:\\r?\\n|$))|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
4323
+ "patterns": [
4324
+ {
4325
+ "include": "#comments"
4326
+ },
4327
+ {
4328
+ "include": "#template-string-name"
4329
+ },
4330
+ {
4331
+ "include": "#function-parameters"
4332
+ },
4333
+ {
4334
+ "include": "#template-string-body"
4335
+ }
4336
+ ]
4337
+ },
4338
+ "template-string-body": {
4339
+ "patterns": [
4340
+ {
4341
+ "include": "#template-raw-string-body-8"
4342
+ },
4343
+ {
4344
+ "include": "#template-raw-string-body-7"
4345
+ },
4346
+ {
4347
+ "include": "#template-raw-string-body-6"
4348
+ },
4349
+ {
4350
+ "include": "#template-raw-string-body-5"
4351
+ },
4352
+ {
4353
+ "include": "#template-raw-string-body-4"
4354
+ },
4355
+ {
4356
+ "include": "#template-raw-string-body-3"
4357
+ },
4358
+ {
4359
+ "include": "#template-raw-string-body-2"
4360
+ },
4361
+ {
4362
+ "include": "#template-raw-string-body-1"
4363
+ },
4364
+ {
4365
+ "include": "#template-quoted-string-body"
4366
+ }
4367
+ ]
4368
+ },
4369
+ "template-string-name": {
4370
+ "name": "entity.name.function.template-string.baml",
4371
+ "match": "\\b\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\b"
4372
+ },
4373
+ "test": {
4374
+ "name": "meta.test.baml",
4375
+ "begin": "^\\s*(test)\\b(?!(?:[^\\S\\r\\n]+\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*[^\\S\\r\\n]*\\{[^\\S\\r\\n]*(?:functions|type_builder)\\b))",
4376
+ "beginCaptures": {
4377
+ "1": {
4378
+ "name": "keyword.declaration.test.baml"
4379
+ }
4380
+ },
4381
+ "end": "(?<=\\})",
4382
+ "patterns": [
4383
+ {
4384
+ "include": "#comments"
4385
+ },
4386
+ {
4387
+ "include": "#test-header"
4388
+ },
4389
+ {
4390
+ "include": "#code-block"
4391
+ }
4392
+ ]
4393
+ },
4394
+ "test-header": {
4395
+ "name": "meta.test.header.baml",
4396
+ "begin": "\\G\\s*",
4397
+ "end": "(?=\\{)",
4398
+ "patterns": [
4399
+ {
4400
+ "include": "#comments"
4401
+ },
4402
+ {
4403
+ "include": "#test-with-keyword"
4404
+ },
4405
+ {
4406
+ "include": "#condition-expression"
4407
+ }
4408
+ ]
4409
+ },
4410
+ "test-with-keyword": {
4411
+ "name": "keyword.operator.with.baml",
4412
+ "match": "\\bwith\\b"
4413
+ },
4414
+ "testset": {
4415
+ "name": "meta.testset.baml",
4416
+ "begin": "^\\s*(testset)\\b",
4417
+ "beginCaptures": {
4418
+ "1": {
4419
+ "name": "keyword.declaration.testset.baml"
4420
+ }
4421
+ },
4422
+ "end": "(?<=\\})",
4423
+ "patterns": [
4424
+ {
4425
+ "include": "#comments"
4426
+ },
4427
+ {
4428
+ "include": "#test-header"
4429
+ },
4430
+ {
4431
+ "include": "#testset-body"
4432
+ }
4433
+ ]
4434
+ },
4435
+ "testset-body": {
4436
+ "name": "meta.testset.body.baml",
4437
+ "begin": "\\{",
4438
+ "beginCaptures": {
4439
+ "0": {
4440
+ "name": "punctuation.definition.block.begin.baml"
4441
+ }
4442
+ },
4443
+ "end": "\\}",
4444
+ "endCaptures": {
4445
+ "0": {
4446
+ "name": "punctuation.definition.block.end.baml"
4447
+ }
4448
+ },
4449
+ "patterns": [
4450
+ {
4451
+ "include": "#comments"
4452
+ },
4453
+ {
4454
+ "include": "#block-contents"
4455
+ }
4456
+ ]
4457
+ },
4458
+ "throw-expression": {
4459
+ "name": "keyword.control.flow.throw.baml",
4460
+ "match": "\\bthrow\\b"
4461
+ },
4462
+ "type-alias": {
4463
+ "name": "meta.type-alias.baml",
4464
+ "begin": "^\\s*(type)\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(=)",
4465
+ "beginCaptures": {
4466
+ "1": {
4467
+ "name": "keyword.declaration.type-alias.baml"
4468
+ },
4469
+ "2": {
4470
+ "name": "entity.name.type.alias.baml"
4471
+ },
4472
+ "3": {
4473
+ "name": "keyword.operator.assignment.baml"
4474
+ }
4475
+ },
4476
+ "end": "(?<=;)|(?=^\\s*(?:client|retry_policy|generator|template_string|class|enum|interface|implements|implement|function|testset|test|type)\\b)",
4477
+ "patterns": [
4478
+ {
4479
+ "include": "#comments"
4480
+ },
4481
+ {
4482
+ "include": "#type-expression"
4483
+ },
4484
+ {
4485
+ "include": "#semicolon"
4486
+ }
4487
+ ]
4488
+ },
4489
+ "type-arrow-operator": {
4490
+ "name": "keyword.operator.arrow.baml",
4491
+ "match": "->"
4492
+ },
4493
+ "type-as-operator": {
4494
+ "name": "keyword.operator.as.baml",
4495
+ "match": "\\bas\\b"
4496
+ },
4497
+ "type-expression": {
4498
+ "patterns": [
4499
+ {
4500
+ "include": "#comments"
4501
+ },
4502
+ {
4503
+ "include": "#primitive-type"
4504
+ },
4505
+ {
4506
+ "include": "#type-literal"
4507
+ },
4508
+ {
4509
+ "include": "#type-arrow-operator"
4510
+ },
4511
+ {
4512
+ "include": "#type-throws-operator"
4513
+ },
4514
+ {
4515
+ "include": "#associated-type-projection"
4516
+ },
4517
+ {
4518
+ "include": "#type-reference"
4519
+ },
4520
+ {
4521
+ "include": "#bare-attribute"
4522
+ },
4523
+ {
4524
+ "include": "#attribute"
4525
+ },
4526
+ {
4527
+ "include": "#type-as-operator"
4528
+ },
4529
+ {
4530
+ "include": "#assignment-operator"
4531
+ },
4532
+ {
4533
+ "include": "#optional-operator"
4534
+ },
4535
+ {
4536
+ "include": "#union-operator"
4537
+ },
4538
+ {
4539
+ "include": "#type-punctuation"
4540
+ },
4541
+ {
4542
+ "include": "#colon-separator"
4543
+ }
4544
+ ]
4545
+ },
4546
+ "type-literal": {
4547
+ "patterns": [
4548
+ {
4549
+ "include": "#boolean-literal"
4550
+ },
4551
+ {
4552
+ "include": "#null-literal"
4553
+ },
4554
+ {
4555
+ "include": "#numeric-literal"
4556
+ },
4557
+ {
4558
+ "include": "#string-literal"
4559
+ },
4560
+ {
4561
+ "include": "#raw-string"
4562
+ },
4563
+ {
4564
+ "include": "#backtick-string"
4565
+ }
4566
+ ]
4567
+ },
4568
+ "type-punctuation": {
4569
+ "name": "punctuation.definition.type.baml",
4570
+ "match": "[\\[\\]<>,()]"
4571
+ },
4572
+ "type-reference": {
4573
+ "name": "meta.type-reference.baml",
4574
+ "match": "\\b(?:(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\s*(\\.)\\s*)?((?:\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*\\s*\\.\\s*)*)(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b",
4575
+ "captures": {
4576
+ "1": {
4577
+ "patterns": [
4578
+ {
4579
+ "include": "#namespace-root"
4580
+ },
4581
+ {
4582
+ "include": "#namespace-segment"
4583
+ }
4584
+ ]
4585
+ },
4586
+ "2": {
4587
+ "name": "punctuation.accessor.baml"
4588
+ },
4589
+ "3": {
4590
+ "patterns": [
4591
+ {
4592
+ "include": "#namespace-segment"
4593
+ },
4594
+ {
4595
+ "include": "#accessor-dot"
4596
+ }
4597
+ ]
4598
+ },
4599
+ "4": {
4600
+ "name": "entity.name.type.baml"
4601
+ }
4602
+ }
4603
+ },
4604
+ "type-throws-operator": {
4605
+ "name": "keyword.operator.throws.baml",
4606
+ "match": "\\bthrows\\b"
4607
+ },
4608
+ "typed-binding-pattern": {
4609
+ "name": "meta.pattern.binding.baml",
4610
+ "match": "\\b((?:let|const))\\s+(\\$?[A-Za-z_][A-Za-z0-9_-]*(?:\\$[A-Za-z_][A-Za-z0-9_-]*)*)\\b\\s*(:)",
4611
+ "captures": {
4612
+ "1": {
4613
+ "name": "keyword.declaration.binding.baml"
4614
+ },
4615
+ "2": {
4616
+ "name": "variable.other.binding.baml"
4617
+ },
4618
+ "3": {
4619
+ "name": "punctuation.separator.colon.baml"
4620
+ }
4621
+ }
4622
+ },
4623
+ "union-operator": {
4624
+ "name": "keyword.operator.type.baml",
4625
+ "match": "\\|"
4626
+ },
4627
+ "upcast-expression": {
4628
+ "name": "meta.expression.upcast.baml",
4629
+ "begin": "(\\.)\\s*(as)\\b(?=\\s*<)",
4630
+ "beginCaptures": {
4631
+ "1": {
4632
+ "name": "punctuation.accessor.baml"
4633
+ },
4634
+ "2": {
4635
+ "name": "keyword.operator.as.baml"
4636
+ }
4637
+ },
4638
+ "end": "(?<=>)",
4639
+ "patterns": [
4640
+ {
4641
+ "include": "#comments"
4642
+ },
4643
+ {
4644
+ "include": "#upcast-type-arguments"
4645
+ }
4646
+ ]
4647
+ },
4648
+ "upcast-type-arguments": {
4649
+ "name": "meta.type-arguments.baml",
4650
+ "begin": "<",
4651
+ "beginCaptures": {
4652
+ "0": {
4653
+ "name": "punctuation.definition.type-arguments.begin.baml"
4654
+ }
4655
+ },
4656
+ "end": ">",
4657
+ "endCaptures": {
4658
+ "0": {
4659
+ "name": "punctuation.definition.type-arguments.end.baml"
4660
+ }
4661
+ },
4662
+ "patterns": [
4663
+ {
4664
+ "include": "#comments"
4665
+ },
4666
+ {
4667
+ "include": "#type-expression"
4668
+ }
4669
+ ]
4670
+ },
4671
+ "watch-statement": {
4672
+ "name": "meta.statement.watch.baml",
4673
+ "begin": "(?:^\\s*|\\G\\s*|(?<=[{;}])\\s*)(watch)\\b",
4674
+ "beginCaptures": {
4675
+ "1": {
4676
+ "name": "keyword.control.watch.baml"
4677
+ }
4678
+ },
4679
+ "end": "(?=[;}]|$)",
4680
+ "patterns": [
4681
+ {
4682
+ "include": "#comments"
4683
+ },
4684
+ {
4685
+ "include": "#watch-statement-pattern"
4686
+ },
4687
+ {
4688
+ "include": "#assignment-operator"
4689
+ },
4690
+ {
4691
+ "include": "#expression"
4692
+ }
4693
+ ]
4694
+ },
4695
+ "watch-statement-pattern": {
4696
+ "name": "meta.pattern.watch.baml",
4697
+ "begin": "\\G\\s*(?=(?:let|const)\\b)",
4698
+ "end": "(?=\\s*=)",
4699
+ "patterns": [
4700
+ {
4701
+ "include": "#comments"
4702
+ },
4703
+ {
4704
+ "include": "#pattern"
4705
+ }
4706
+ ]
4707
+ },
4708
+ "while-condition": {
4709
+ "name": "meta.while.condition.baml",
4710
+ "begin": "\\G\\s*",
4711
+ "end": "(?=\\{)",
4712
+ "patterns": [
4713
+ {
4714
+ "include": "#comments"
4715
+ },
4716
+ {
4717
+ "include": "#condition-expression"
4718
+ }
4719
+ ]
4720
+ },
4721
+ "while-let-pattern": {
4722
+ "name": "meta.pattern.while-let.baml",
4723
+ "begin": "\\G\\s*(?=(?:let|const)\\b)",
4724
+ "end": "(?=\\s*=)",
4725
+ "patterns": [
4726
+ {
4727
+ "include": "#comments"
4728
+ },
4729
+ {
4730
+ "include": "#pattern"
4731
+ }
4732
+ ]
4733
+ },
4734
+ "while-statement": {
4735
+ "name": "meta.statement.while.baml",
4736
+ "begin": "\\b(while)\\b",
4737
+ "beginCaptures": {
4738
+ "1": {
4739
+ "name": "keyword.control.loop.while.baml"
4740
+ }
4741
+ },
4742
+ "end": "(?<=\\})(?=\\s*(?:;|$))|(?=;|$)",
4743
+ "patterns": [
4744
+ {
4745
+ "include": "#comments"
4746
+ },
4747
+ {
4748
+ "include": "#while-let-pattern"
4749
+ },
4750
+ {
4751
+ "include": "#assignment-operator"
4752
+ },
4753
+ {
4754
+ "include": "#while-condition"
4755
+ },
4756
+ {
4757
+ "include": "#code-block"
4758
+ }
4759
+ ]
4760
+ },
4761
+ "wildcard-binding-pattern": {
4762
+ "name": "meta.pattern.wildcard.baml",
4763
+ "match": "\\b((?:let|const))\\s+(_)\\b",
4764
+ "captures": {
4765
+ "1": {
4766
+ "name": "keyword.declaration.binding.baml"
4767
+ },
4768
+ "2": {
4769
+ "name": "variable.language.wildcard.baml"
4770
+ }
4771
+ }
4772
+ },
4773
+ "wildcard-pattern": {
4774
+ "name": "variable.language.wildcard.baml",
4775
+ "match": "\\b_\\b"
4776
+ }
4777
+ }
4778
+ };
4779
+
4780
+ export const bamlLanguage = grammar;
4781
+ export default bamlLanguage;