@salesforcedevs/dx-components 1.18.8-layoutfix-alpha → 1.18.9-rnb-scroll

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2165 @@
1
+ const dataweaveGrammar = {
2
+ name: "dataweave",
3
+ scopeName: "source.data-weave",
4
+ fileTypes: ["dwl"],
5
+ uuid: "ba6390ae-c50f-4dce-97f1-951dab8fc607",
6
+ patterns: [
7
+ { include: "#comments" },
8
+ { include: "#directives" },
9
+ {
10
+ match: "(---)",
11
+ name: "keyword.operator.body-marker.dw"
12
+ },
13
+ { include: "#expressions" },
14
+ {
15
+ match: "([^\\s]+)",
16
+ name: "invalid"
17
+ }
18
+ ],
19
+ repository: {
20
+ directives: {
21
+ patterns: [
22
+ { include: "#dw-directive" },
23
+ { include: "#import-directive" },
24
+ { include: "#type-directive" },
25
+ { include: "#fun-directive" },
26
+ { include: "#var-directive" },
27
+ { include: "#ns-directive" },
28
+ { include: "#input-directive" },
29
+ { include: "#output-directive" },
30
+ { include: "#annotation-usage" },
31
+ { include: "#annotation-directive" }
32
+ ]
33
+ },
34
+ type_parameters: {
35
+ begin: "<",
36
+ end: ">",
37
+ patterns: [
38
+ { include: "#types" },
39
+ { include: "#punctuation-comma" },
40
+ { include: "#comments" }
41
+ ]
42
+ },
43
+ "variable-reference": {
44
+ patterns: [
45
+ {
46
+ name: "variable.other.dw",
47
+ match: "\\b(?!(fun|input|output|type|var|ns|import|%dw|private|---)\\b)((\\+\\+|\\-\\-|[A-Za-z])[a-zA-Z0-9_]*)"
48
+ },
49
+ {
50
+ name: "invalid",
51
+ match: "\\b(fun|input|output|type|var|ns|import|private)\\b"
52
+ },
53
+ {
54
+ name: "variable.parameter.dw",
55
+ match: "(\\$+)"
56
+ }
57
+ ]
58
+ },
59
+ cast: {
60
+ begin: "(?<!\\.|\\$)\\b(as|is)\\s+",
61
+ beginCaptures: { "1": { name: "keyword.control.as.dw" } },
62
+ end: "(?=$|^|[;,:})\\]\\s])",
63
+ patterns: [{ include: "#types" }]
64
+ },
65
+ "case-clause": {
66
+ name: "case-clause.expr.dw",
67
+ begin: "(?<!\\.|\\$)\\b(case|else(?=\\s*->))\\b(?!\\$|\\.)",
68
+ beginCaptures: { "1": { name: "keyword.control.switch.dw" } },
69
+ end: "\\-\\>",
70
+ endCaptures: { "0": { name: "keyword.control.switch.dw" } },
71
+ patterns: [
72
+ {
73
+ begin: "(?<!\\.|\\$)\\b(is)\\s+",
74
+ beginCaptures: {
75
+ "1": { name: "keyword.control.is.dw" }
76
+ },
77
+ end: "(?=\\-\\>)",
78
+ patterns: [{ include: "#types" }]
79
+ },
80
+ {
81
+ begin: "(?<!\\.|\\$)\\b(matches)\\b",
82
+ beginCaptures: {
83
+ "1": { name: "keyword.control.matches.dw" }
84
+ },
85
+ end: "(?=\\-\\>)",
86
+ patterns: [{ include: "#expressions" }]
87
+ },
88
+ {
89
+ begin: "(?<!\\.|\\$)\\b([A-Za-z][a-zA-Z0-9_]*)\\s*:\\s+",
90
+ beginCaptures: {
91
+ "1": { name: "entity.name.variable.dw" }
92
+ },
93
+ end: "(?=\\-\\>)",
94
+ patterns: [{ include: "#expressions" }]
95
+ },
96
+ {
97
+ begin: "(?<!\\.|\\$)\\b([A-Za-z][a-zA-Z0-9_]*)\\s*(if|matches)\\s+",
98
+ beginCaptures: {
99
+ "1": { name: "entity.name.variable.dw" },
100
+ "2": { name: "keyword.control.if.dw" }
101
+ },
102
+ end: "(?=\\-\\>)",
103
+ patterns: [{ include: "#expressions" }]
104
+ },
105
+ { include: "#expressions" }
106
+ ]
107
+ },
108
+ comments: {
109
+ patterns: [
110
+ {
111
+ name: "comment.block.dw",
112
+ begin: "/\\*",
113
+ end: "\\*/",
114
+ captures: {
115
+ "0": { name: "punctuation.definition.comment.dw" }
116
+ }
117
+ },
118
+ {
119
+ match: "\\s*((//).*$\\n?)",
120
+ captures: {
121
+ "1": { name: "comment.line.double-slash.dw" },
122
+ "2": { name: "punctuation.definition.comment.dw" }
123
+ }
124
+ }
125
+ ]
126
+ },
127
+ constants: {
128
+ patterns: [
129
+ {
130
+ name: "constant.language.dw",
131
+ match: "\\b(true|false|null)\\b"
132
+ },
133
+ {
134
+ name: "constant.numeric.dw",
135
+ match: "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\\b"
136
+ },
137
+ {
138
+ begin: "\\|",
139
+ beginCaptures: { "0": { name: "constant.numeric.dw" } },
140
+ end: "\\|",
141
+ endCaptures: { "0": { name: "constant.numeric.dw" } },
142
+ patterns: [
143
+ {
144
+ name: "constant.numeric.dw",
145
+ match: "([0-9]+)"
146
+ },
147
+ {
148
+ name: "constant.character.escape.dw",
149
+ match: "([+:\\-WYMDTHSPZ\\.])"
150
+ },
151
+ {
152
+ name: "invalid",
153
+ match: "([^\\|])"
154
+ }
155
+ ]
156
+ }
157
+ ]
158
+ },
159
+ "dw-directive": {
160
+ name: "meta.directive.version.dw",
161
+ begin: "(?<!\\.|\\$)(%dw)\\s+([0-9]\\.[0-9])(?!\\$|\\.)",
162
+ beginCaptures: {
163
+ "1": { name: "comment.dw" },
164
+ "2": { name: "comment.dw" }
165
+ },
166
+ end: "(?=\\n)"
167
+ },
168
+ infix: {
169
+ name: "support.function.dw",
170
+ match: "(?<!^|,|\\[|\\(|=|\\+|>|<|\\-|\\*|:|\\{|case|is|else|not|as|and|or)(?<=[a-zA-Z0-9_$\\}\\])\"'`|/])\\s*(?!(var|match|case|else|fun|input|output|is|as|default|ns|import|null|false|true|using|do|not|and|or)\\s)(\\+\\+|\\-\\-|[a-zA-Z][a-zA-Z_0-9]*)(\\s+|\\s*(?=[\"'/|{]))"
171
+ },
172
+ expressions: {
173
+ name: "expression",
174
+ patterns: [
175
+ {
176
+ name: "keyword.other.dw",
177
+ match: "\\b(not)\\s+"
178
+ },
179
+ { include: "#undefined-fun-character" },
180
+ { include: "#paren-expression" },
181
+ { include: "#strings" },
182
+ { include: "#constants" },
183
+ { include: "#comments" },
184
+ { include: "#match-statement" },
185
+ { include: "#using-statement" },
186
+ { include: "#do-statement" },
187
+ { include: "#if-statement" },
188
+ { include: "#regex" },
189
+ { include: "#type_parameters" },
190
+ { include: "#keywords" },
191
+ { include: "#object-literal" },
192
+ { include: "#array-literal" },
193
+ { include: "#cast" },
194
+ { include: "#object-member" },
195
+ { include: "#variable-reference" },
196
+ { include: "#selectors" },
197
+ { include: "#directives" },
198
+ { include: "#infix" }
199
+ ]
200
+ },
201
+ generics: {
202
+ patterns: [
203
+ {
204
+ begin: "(:)",
205
+ beginCaptures: {
206
+ "1": { name: "keyword.operator.declaration.dw" }
207
+ },
208
+ end: "(?=,|>)",
209
+ patterns: [{ include: "#types" }]
210
+ },
211
+ {
212
+ name: "keyword.operator.extends.dw",
213
+ match: "<:"
214
+ },
215
+ { include: "#keywords" },
216
+ {
217
+ name: "entity.name.type.parameter.dw",
218
+ match: "\\w+"
219
+ }
220
+ ]
221
+ },
222
+ "input-directive": {
223
+ name: "meta.directive.ns.dw",
224
+ begin: "(?<!\\.|\\$)\\b(input)\\s+([[:alpha:]][[:alnum:]]*)\\s*",
225
+ end: "(?=\\n)",
226
+ beginCaptures: {
227
+ "1": { name: "storage.type.dw" },
228
+ "2": { name: "entity.name.variable.dw" }
229
+ },
230
+ patterns: [
231
+ {
232
+ begin: "(\\:\\s*)",
233
+ beginCaptures: { "1": { name: "keyword.other.dw" } },
234
+ end: "(\\s|\\n)",
235
+ patterns: [{ include: "#types" }]
236
+ },
237
+ {
238
+ match: "([^{\\n\\s])",
239
+ name: "string.mime.dw"
240
+ }
241
+ ]
242
+ },
243
+ keywords: {
244
+ patterns: [
245
+ {
246
+ name: "keyword.reserved.dw",
247
+ match: "\\b(throw|for|yield|enum|private|async)\\b"
248
+ },
249
+ {
250
+ name: "invalid",
251
+ match: "\\b(not)\\b"
252
+ },
253
+ {
254
+ name: "keyword.control.dw",
255
+ match: "\\b(if|else|while|for|do|using|unless|default)\\b"
256
+ },
257
+ {
258
+ name: "keyword.operator.comparison.dw",
259
+ match: "(~=|==|!=|!=|<=|>=|<|>)"
260
+ },
261
+ {
262
+ name: "keyword.operator.assignment.dw",
263
+ match: "(=)"
264
+ },
265
+ {
266
+ name: "keyword.operator.declaration.dw",
267
+ match: "(:)"
268
+ },
269
+ {
270
+ name: "keyword.operator.arithmetic.dw",
271
+ match: "(\\-|\\+|\\*|\\/)"
272
+ },
273
+ {
274
+ name: "keyword.other.dw",
275
+ match: "\\b(and|or)\\b"
276
+ }
277
+ ]
278
+ },
279
+ "match-block": {
280
+ name: "match-block.expr.dw",
281
+ begin: "\\{",
282
+ beginCaptures: {
283
+ "0": { name: "punctuation.definition.block.dw" }
284
+ },
285
+ end: "(?=\\})",
286
+ patterns: [{ include: "#case-clause" }, { include: "#expressions" }]
287
+ },
288
+ "match-statement": {
289
+ name: "match-statement.expr.dw",
290
+ begin: "(?<!\\.|\\$)\\b(match)\\s*(?=\\{)",
291
+ beginCaptures: { "1": { name: "keyword.control.switch.dw" } },
292
+ end: "\\}",
293
+ endCaptures: {
294
+ "1": { name: "punctuation.definition.block.dw" }
295
+ },
296
+ patterns: [{ include: "#match-block" }]
297
+ },
298
+ "using-statement": {
299
+ name: "using-statement.expr.dw",
300
+ begin: "(?<!\\.|\\$)\\b(using)\\s*(\\()",
301
+ beginCaptures: {
302
+ "1": { name: "keyword.control.using.dw" },
303
+ "2": { name: "punctuation.definitions.begin.dw" }
304
+ },
305
+ end: "(\\))",
306
+ endCaptures: {
307
+ "1": { name: "punctuation.definitions.end.dw" }
308
+ },
309
+ patterns: [
310
+ {
311
+ match: "((?:\\+\\+|\\-\\-|[A-Za-z])(?:[a-zA-Z0-9_]*))(\\s*=)",
312
+ captures: {
313
+ "1": { name: "entity.name.variable.dw" },
314
+ "2": { name: "keyword.operator.dw" }
315
+ }
316
+ },
317
+ { include: "#expressions" }
318
+ ]
319
+ },
320
+ "do-statement": {
321
+ name: "do-statement.expr.dw",
322
+ begin: "(?<!\\.|\\$)\\b(do)\\s*(\\{)",
323
+ beginCaptures: {
324
+ "1": { name: "keyword.control.do.dw" },
325
+ "2": { name: "punctuation.definitions.begin.dw" }
326
+ },
327
+ end: "(\\})",
328
+ endCaptures: {
329
+ "1": { name: "punctuation.definitions.end.dw" }
330
+ },
331
+ patterns: [
332
+ { include: "#comments" },
333
+ { include: "#directives" },
334
+ {
335
+ match: "(---)",
336
+ name: "keyword.operator.body-marker.dw"
337
+ },
338
+ { include: "#expressions" },
339
+ {
340
+ match: "([^\\s]+)",
341
+ name: "invalid"
342
+ }
343
+ ]
344
+ },
345
+ "if-statement": {
346
+ name: "meta.if.dw",
347
+ begin: "(?<!\\.|\\$)\\b(if\\s*)\\(",
348
+ beginCaptures: { "1": { name: "keyword.control.if.dw" } },
349
+ end: "\\)",
350
+ patterns: [{ include: "#expressions" }]
351
+ },
352
+ "ns-directive": {
353
+ name: "meta.directive.ns.dw",
354
+ begin: "(?<!\\.|\\$)\\b(ns)\\s+([A-Za-z][a-zA-Z0-9_]*)\\s+([^\\n]*)(?!\\$|\\.)",
355
+ beginCaptures: {
356
+ "1": { name: "storage.type.dw" },
357
+ "2": { name: "entity.name.namespace.dw" },
358
+ "3": { name: "meta.definition.ns.dw string.url.dw" }
359
+ },
360
+ end: "(?=\\n)"
361
+ },
362
+ "object-literal": {
363
+ name: "meta.objectliteral.dw",
364
+ begin: "\\{",
365
+ beginCaptures: {
366
+ "0": { name: "punctuation.definition.block.dw" }
367
+ },
368
+ end: "\\}",
369
+ endCaptures: {
370
+ "0": { name: "punctuation.definition.block.dw" }
371
+ },
372
+ patterns: [{ include: "#object-member" }]
373
+ },
374
+ "attr-literal": {
375
+ name: "meta.attributes.dw",
376
+ begin: "\\@\\(",
377
+ beginCaptures: {
378
+ "0": { name: "keyword.operator.attributes.dw" }
379
+ },
380
+ end: "\\)",
381
+ endCaptures: {
382
+ "0": { name: "keyword.operator.attributes.dw" }
383
+ },
384
+ patterns: [{ include: "#object-member" }]
385
+ },
386
+ selectors: {
387
+ name: "meta.selector.data-weave",
388
+ begin: "(?<![\\[\\(:+*/\\-])(\\s*\\.\\.\\*|\\s*\\.\\.|\\s*\\.\\*|\\s*\\.\\@|\\s*\\.#|\\s*\\.&|\\s*\\.|(?=\\[)|\\:\\:)",
389
+ end: "(?=\\s|,|\\}|\\)|\\n|\\]|\\(|-|$)",
390
+ patterns: [
391
+ {
392
+ name: "variable.object.member.dw",
393
+ match: "\\b([[:alpha:]][_[:alnum:]]+#)",
394
+ captures: { "0": { name: "variable.language.dw" } }
395
+ },
396
+ {
397
+ match: "((?:[A-Za-z])([a-zA-Z0-9_]*)[?!]?|(\\$)+)",
398
+ name: "variable.object.member.dw"
399
+ },
400
+ { include: "#strings" },
401
+ {
402
+ begin: "(\\[(@|\\^)?)",
403
+ end: "(\\])",
404
+ patterns: [
405
+ { include: "#expressions" },
406
+ {
407
+ match: "([\\)])",
408
+ name: "invalid"
409
+ }
410
+ ]
411
+ },
412
+ { include: "#selectors" }
413
+ ]
414
+ },
415
+ "object-key": {
416
+ patterns: [
417
+ {
418
+ name: "variable.object.member.dw meta.object-literal.namespace.dw",
419
+ match: "\\b([[:alpha:]][_[:alnum:]]+#)",
420
+ captures: { "0": { name: "variable.language.dw" } }
421
+ },
422
+ {
423
+ name: "variable.object.member.dw meta.object-literal.key.dw",
424
+ begin: "(?=[\\'\\\"\\`])",
425
+ end: "(?=@\\(|:)",
426
+ patterns: [{ include: "#strings" }]
427
+ },
428
+ {
429
+ name: "variable.object.member.dw",
430
+ end: "(?=,|\\}|\\))",
431
+ match: "(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:|@\\()",
432
+ captures: {
433
+ "1": { name: "meta.object-literal.key.dw" }
434
+ }
435
+ }
436
+ ]
437
+ },
438
+ "object-member": {
439
+ name: "meta.object.member.first.dw",
440
+ patterns: [
441
+ { include: "#comments" },
442
+ { include: "#paren-expression" },
443
+ { include: "#object-key" },
444
+ { include: "#attr-literal" },
445
+ { include: "#object-member-body" },
446
+ { include: "#punctuation-comma" }
447
+ ]
448
+ },
449
+ "object-member-body": {
450
+ name: "variable.object.member.dw",
451
+ begin: ":",
452
+ beginCaptures: {
453
+ "0": {
454
+ name: "meta.object-literal.key.dw punctuation.separator.key-value.dw"
455
+ }
456
+ },
457
+ end: "(?=,|\\}|\\))",
458
+ patterns: [{ include: "#expressions" }]
459
+ },
460
+ "output-directive": {
461
+ name: "meta.directive.ns.dw",
462
+ begin: "(?<!\\.|\\$)\\b(output)\\s+([^\\n{\\s]*)(?!\\$|\\.)",
463
+ beginCaptures: {
464
+ "1": { name: "storage.type.dw" },
465
+ "2": { name: "string.other.dw" }
466
+ },
467
+ end: "(?=\\n)"
468
+ },
469
+ parameters: {
470
+ patterns: [
471
+ {
472
+ begin: "(:)",
473
+ beginCaptures: {
474
+ "1": { name: "keyword.operator.declaration.dw" }
475
+ },
476
+ end: "(?=,|\\)|=)",
477
+ patterns: [{ include: "#types" }]
478
+ },
479
+ {
480
+ begin: "(=)",
481
+ beginCaptures: {
482
+ "1": { name: "keyword.operator.declaration.dw" }
483
+ },
484
+ end: "(?=,|\\))",
485
+ patterns: [{ include: "#expressions" }]
486
+ },
487
+ {
488
+ name: "variable.parameter.dw",
489
+ match: "\\w+"
490
+ }
491
+ ]
492
+ },
493
+ "paren-expression": {
494
+ begin: "(\\()",
495
+ beginCaptures: {
496
+ "1": { name: "punctuation.expression.begin.dw" }
497
+ },
498
+ end: "(\\))",
499
+ endCaptures: { "1": { name: "punctuation.expression.end.dw" } },
500
+ patterns: [{ include: "#expressions" }]
501
+ },
502
+ "punctuation-comma": {
503
+ name: "punctuation.separator.comma.dw",
504
+ match: ","
505
+ },
506
+ strings: {
507
+ patterns: [
508
+ { include: "#qstring-single" },
509
+ { include: "#qstring-double" },
510
+ { include: "#qstring-backtick" },
511
+ { include: "#template" }
512
+ ]
513
+ },
514
+ "qstring-backtick": {
515
+ begin: "`",
516
+ beginCaptures: {
517
+ "0": {
518
+ name: "string.quoted.double.dw punctuation.definition.string.begin.dw"
519
+ }
520
+ },
521
+ end: "`",
522
+ endCaptures: {
523
+ "0": {
524
+ name: "string.quoted.double.dw punctuation.definition.string.end.dw"
525
+ }
526
+ },
527
+ patterns: [
528
+ { include: "#template-substitution-element" },
529
+ { include: "#template-dollar" },
530
+ { include: "#string-character-escape" },
531
+ {
532
+ match: "([^`])",
533
+ name: "string.template.dw"
534
+ }
535
+ ]
536
+ },
537
+ template: {
538
+ begin: "([$[:alpha:]][_$[:alnum:]]*)\\s*(`)",
539
+ beginCaptures: {
540
+ "1": { name: "support.function.dw" },
541
+ "2": {
542
+ name: "string.template.dw punctuation.definition.string.template.begin.dw"
543
+ }
544
+ },
545
+ end: "`",
546
+ endCaptures: {
547
+ "0": {
548
+ name: "string.template.dw punctuation.definition.string.template.end.dw"
549
+ }
550
+ },
551
+ patterns: [
552
+ { include: "#template-substitution-element" },
553
+ { include: "#template-dollar" },
554
+ { include: "#string-character-escape" },
555
+ {
556
+ match: "([^`])",
557
+ name: "string.template.dw"
558
+ }
559
+ ]
560
+ },
561
+ "string-character-escape": {
562
+ name: "constant.character.escape.dw",
563
+ match: "\\\\(u\\h{4}|$|.)"
564
+ },
565
+ "undefined-fun-character": {
566
+ name: "constant.language.undefined.dw",
567
+ match: "\\?\\?\\?"
568
+ },
569
+ "qstring-double": {
570
+ begin: '"',
571
+ beginCaptures: {
572
+ "0": {
573
+ name: "string.quoted.double.dw punctuation.definition.string.begin.dw"
574
+ }
575
+ },
576
+ end: '"',
577
+ endCaptures: {
578
+ "0": {
579
+ name: "string.quoted.double.dw punctuation.definition.string.end.dw"
580
+ }
581
+ },
582
+ patterns: [
583
+ { include: "#template-substitution-element" },
584
+ { include: "#template-dollar" },
585
+ { include: "#string-character-escape" },
586
+ {
587
+ match: '([^"])',
588
+ name: "string.quoted.double.dw"
589
+ }
590
+ ]
591
+ },
592
+ "qstring-single": {
593
+ begin: "'",
594
+ beginCaptures: {
595
+ "0": {
596
+ name: "string.quoted.single.dw punctuation.definition.string.begin.dw"
597
+ }
598
+ },
599
+ end: "(\\')|((?:[^\\\\\\n])$)",
600
+ endCaptures: {
601
+ "1": {
602
+ name: "string.quoted.single.dw punctuation.definition.string.end.dw"
603
+ },
604
+ "2": { name: "invalid.illegal.newline.dw" }
605
+ },
606
+ patterns: [
607
+ { include: "#template-substitution-element" },
608
+ { include: "#template-dollar" },
609
+ { include: "#string-character-escape" },
610
+ {
611
+ match: "([^'])",
612
+ name: "string.quoted.single.dw"
613
+ }
614
+ ]
615
+ },
616
+ "template-dollar": {
617
+ patterns: [
618
+ {
619
+ match: "(\\$(\\$)+)",
620
+ name: "variable.parameter.dw"
621
+ },
622
+ {
623
+ match: "(\\$)(?![a-zA-Z(])",
624
+ name: "variable.parameter.dw"
625
+ },
626
+ {
627
+ match: "(\\$)([a-zA-Z][a-zA-Z0-9_]*)",
628
+ captures: {
629
+ "1": { name: "keyword.other.dw" },
630
+ "2": { name: "variable.other.dw" }
631
+ },
632
+ name: "variable.parameter.dw"
633
+ }
634
+ ]
635
+ },
636
+ "template-substitution-element": {
637
+ name: "meta.template.expression.dw",
638
+ begin: "\\$\\(",
639
+ beginCaptures: { "0": { name: "keyword.other.dw" } },
640
+ end: "\\)",
641
+ endCaptures: { "0": { name: "keyword.other.dw" } },
642
+ patterns: [{ include: "#expressions" }]
643
+ },
644
+ types: {
645
+ patterns: [
646
+ { include: "#comments" },
647
+ {
648
+ name: "constant.language.dw",
649
+ match: "\\b(true|false|null)\\b"
650
+ },
651
+ {
652
+ name: "constant.numeric.dw",
653
+ match: "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\\b"
654
+ },
655
+ { include: "#strings" },
656
+ {
657
+ begin: "<",
658
+ end: ">",
659
+ patterns: [
660
+ { include: "#types" },
661
+ { include: "#punctuation-comma" },
662
+ { include: "#comments" }
663
+ ]
664
+ },
665
+ {
666
+ begin: "\\{\\-\\|",
667
+ end: "\\|\\-\\}",
668
+ patterns: [
669
+ { include: "#punctuation-comma" },
670
+ { include: "#object-member-type" }
671
+ ]
672
+ },
673
+ {
674
+ begin: "\\{\\|",
675
+ end: "\\|\\}",
676
+ patterns: [
677
+ { include: "#punctuation-comma" },
678
+ { include: "#object-member-type" }
679
+ ]
680
+ },
681
+ {
682
+ begin: "\\{\\-",
683
+ end: "\\-\\}",
684
+ patterns: [
685
+ { include: "#punctuation-comma" },
686
+ { include: "#object-member-type" }
687
+ ]
688
+ },
689
+ {
690
+ begin: "\\{",
691
+ end: "\\}",
692
+ patterns: [
693
+ { include: "#punctuation-comma" },
694
+ { include: "#object-member-type" }
695
+ ]
696
+ },
697
+ {
698
+ begin: "(\\()",
699
+ beginCaptures: {
700
+ "0": { name: "keyword.operator.grouping.dw" }
701
+ },
702
+ end: "(\\)\\s*->|\\))",
703
+ endCaptures: {
704
+ "0": { name: "keyword.operator.grouping.dw" }
705
+ },
706
+ patterns: [
707
+ { include: "#types" },
708
+ { include: "#parameters" }
709
+ ]
710
+ },
711
+ {
712
+ name: "support.class.dw",
713
+ match: "(String|Boolean|Number|Range|Namespace|Uri|DateTime|LocalDateTime|Date|LocalTime|TimeZone|Time|Period|Binary|Null|Regex|Nothing|Any|Object|Key)"
714
+ },
715
+ {
716
+ begin: "(Array|Type)\\s*<",
717
+ beginCaptures: { "1": { name: "support.type.dw" } },
718
+ end: ">",
719
+ patterns: [
720
+ {
721
+ match: ",",
722
+ name: "invalid"
723
+ },
724
+ { include: "#types" }
725
+ ]
726
+ },
727
+ {
728
+ name: "keyword.operator.declaration.dw",
729
+ match: "(&|\\|)"
730
+ },
731
+ {
732
+ name: "keyword.operator.declaration.dw",
733
+ match: "<:"
734
+ },
735
+ {
736
+ name: "support.class.dw",
737
+ match: "\\b([A-Z][a-zA-Z0-9_]*)"
738
+ },
739
+ { include: "#undefined-fun-character" },
740
+ { match: "\\b(var|fun|ns)\\b" },
741
+ {
742
+ name: "invalid",
743
+ match: "\\b(input|output|var|ns|import|try|catch|throw|do|for|yield|enum|private|async)\\b"
744
+ },
745
+ {
746
+ name: "invalid",
747
+ match: "\\b(if|else|while|for|do|using|unless|default|match)\\b"
748
+ },
749
+ {
750
+ name: "invalid",
751
+ match: "(~=|==|!=|===|!==|<=|>=|<|>|\\$+)"
752
+ }
753
+ ]
754
+ },
755
+ "object-member-type": {
756
+ patterns: [
757
+ { include: "#comments" },
758
+ {
759
+ match: "_",
760
+ name: "variable.language.dw"
761
+ },
762
+ {
763
+ match: "([a-zA-Z0-9]+#)",
764
+ name: "variable.language.dw"
765
+ },
766
+ {
767
+ match: "\\(\\s*([a-zA-Z][a-zA-Z0-9]*)\\s*\\)",
768
+ name: "entity.name.type.dw"
769
+ },
770
+ {
771
+ match: "([a-zA-Z][a-zA-Z0-9]*)",
772
+ name: "variable.object.member.dw"
773
+ },
774
+ { include: "#strings" },
775
+ {
776
+ match: "\\?",
777
+ name: "keyword.operator.optional.dw"
778
+ },
779
+ {
780
+ match: "\\*",
781
+ name: "keyword.operator.optional.dw"
782
+ },
783
+ {
784
+ begin: "(\\@\\()",
785
+ beginCaptures: {
786
+ "1": { name: "keyword.operator.attributes.dw" }
787
+ },
788
+ end: "(\\))",
789
+ endCaptures: {
790
+ "1": { name: "keyword.operator.attributes.dw" }
791
+ },
792
+ patterns: [
793
+ { include: "#punctuation-comma" },
794
+ { include: "#object-member-type" }
795
+ ]
796
+ },
797
+ {
798
+ begin: "(:)",
799
+ beginCaptures: {
800
+ "1": { name: "keyword.operator.declaration.dw" }
801
+ },
802
+ end: "(?=,|}|\\)|\\|}|\\-}|\\|\\-})",
803
+ patterns: [{ include: "#types" }]
804
+ },
805
+ {
806
+ match: "([^\\s])",
807
+ name: "invalid"
808
+ }
809
+ ]
810
+ },
811
+ "type-directive": {
812
+ name: "meta.directive.type.dw",
813
+ begin: "(\\s*(type)\\s+([a-zA-Z][a-zA-Z0-9]*))",
814
+ end: "(?=(fun|input|output|type|var|ns|import|%dw|private|---)\\s|(\\@[a-zA-Z][a-zA-Z0-9]*))",
815
+ beginCaptures: {
816
+ "2": { name: "storage.type.dw" },
817
+ "3": { name: "entity.name.type.dw" }
818
+ },
819
+ patterns: [
820
+ {
821
+ begin: "<",
822
+ end: ">",
823
+ patterns: [{ include: "#generics" }]
824
+ },
825
+ {
826
+ name: "keyword.other.dw",
827
+ match: "\\="
828
+ },
829
+ { include: "#types" }
830
+ ]
831
+ },
832
+ "import-directive": {
833
+ name: "meta.directive.import.dw",
834
+ begin: "(\\s*(import)\\s+)",
835
+ end: "(?=(fun|input|output|type|var|ns|import|%dw|private|annotation|\\@|---)\\s|$)",
836
+ beginCaptures: { "2": { name: "keyword.control.import" } },
837
+ patterns: [
838
+ { include: "#comments" },
839
+ { match: "(,)" },
840
+ {
841
+ match: "(\\*)",
842
+ name: "entity.name.type.dw"
843
+ },
844
+ {
845
+ match: "\\s+(from)\\s+",
846
+ captures: { "1": { name: "keyword.control.from" } }
847
+ },
848
+ {
849
+ match: "(?:[a-zA-Z][a-zA-Z0-9]*(?:::[a-zA-Z][a-zA-Z0-9]*)+)\n",
850
+ name: "entity.name.type.dw"
851
+ },
852
+ {
853
+ match: "(?:[a-zA-Z][a-zA-Z0-9]*)\n",
854
+ name: "entity.name.function.dw"
855
+ },
856
+ {
857
+ match: "\\s+(as)\\s+([a-zA-Z][a-zA-Z0-9]*)",
858
+ captures: {
859
+ "1": { name: "keyword.control.as" },
860
+ "2": { name: "entity.name.function.dw" }
861
+ }
862
+ }
863
+ ]
864
+ },
865
+ "var-directive": {
866
+ name: "meta.directive.var.dw",
867
+ begin: "(\\s*(var)\\s+([a-zA-Z][a-zA-Z0-9]*))",
868
+ end: "(=)",
869
+ beginCaptures: {
870
+ "2": { name: "storage.type.dw" },
871
+ "3": { name: "entity.name.variable.dw" }
872
+ },
873
+ endCaptures: {
874
+ "0": { name: "keyword.operator.assignment.dw" }
875
+ },
876
+ patterns: [
877
+ {
878
+ begin: "<",
879
+ end: ">",
880
+ patterns: [{ include: "#generics" }]
881
+ },
882
+ {
883
+ begin: "(:)",
884
+ beginCaptures: {
885
+ "1": { name: "keyword.operator.declaration.dw" }
886
+ },
887
+ end: "(?==|$)",
888
+ patterns: [{ include: "#comments" }, { include: "#types" }]
889
+ }
890
+ ]
891
+ },
892
+ "fun-directive": {
893
+ name: "meta.directive.fun.dw",
894
+ begin: "(\\s*(fun)\\s+([a-zA-Z][a-zA-Z0-9_]*|--|\\+\\+))",
895
+ end: "(=)",
896
+ beginCaptures: {
897
+ "2": { name: "storage.type.dw" },
898
+ "3": { name: "entity.name.function.dw" }
899
+ },
900
+ endCaptures: {
901
+ "0": { name: "keyword.operator.assignment.dw" }
902
+ },
903
+ patterns: [
904
+ {
905
+ begin: "<",
906
+ end: ">",
907
+ patterns: [{ include: "#generics" }]
908
+ },
909
+ {
910
+ begin: "\\(",
911
+ end: "\\)",
912
+ patterns: [{ include: "#parameters" }]
913
+ },
914
+ {
915
+ begin: "(:)",
916
+ beginCaptures: {
917
+ "1": { name: "keyword.operator.declaration.dw" }
918
+ },
919
+ end: "(?==)",
920
+ patterns: [{ include: "#types" }]
921
+ }
922
+ ]
923
+ },
924
+ "annotation-directive": {
925
+ name: "meta.directive.annot.dw",
926
+ begin: "(\\s*(annotation)\\s+([a-zA-Z][a-zA-Z0-9]*))",
927
+ end: "(?=\\n)",
928
+ beginCaptures: {
929
+ "2": { name: "storage.type.annotation.dw" },
930
+ "3": { name: "entity.name.function.dw" }
931
+ },
932
+ endCaptures: {
933
+ "0": { name: "keyword.operator.assignment.dw" }
934
+ },
935
+ patterns: [
936
+ {
937
+ begin: "\\(",
938
+ end: "\\)",
939
+ patterns: [{ include: "#parameters" }]
940
+ }
941
+ ]
942
+ },
943
+ "annotation-usage": {
944
+ name: "meta.annot.usage.dw",
945
+ begin: "(\\s*(\\@)([a-zA-Z][a-zA-Z0-9]*))",
946
+ end: "(?=\\n)",
947
+ beginCaptures: {
948
+ "2": { name: "storage.type.annotation.dw" },
949
+ "3": { name: "entity.name.function.dw" }
950
+ },
951
+ endCaptures: {
952
+ "0": { name: "keyword.operator.assignment.dw" }
953
+ },
954
+ patterns: [
955
+ {
956
+ begin: "\\(",
957
+ end: "\\)",
958
+ patterns: [{ include: "#parameters" }]
959
+ }
960
+ ]
961
+ },
962
+ "array-literal": {
963
+ name: "meta.array.literal.dw",
964
+ begin: "(?<!\\w|}|])(\\[)",
965
+ beginCaptures: { "0": { name: "meta.brace.square.dw" } },
966
+ end: "\\]",
967
+ endCaptures: { "0": { name: "meta.brace.square.dw" } },
968
+ patterns: [
969
+ { include: "#expressions" },
970
+ { include: "#punctuation-comma" }
971
+ ]
972
+ },
973
+ regex: {
974
+ patterns: [
975
+ {
976
+ name: "string.regexp.dw",
977
+ begin: "(?<=[=(:,\\[?+!]|replace|match|scan|matches|contains|---|case|->|and|or|\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])(?!\\s*[a-zA-Z0-9_$]))",
978
+ beginCaptures: {
979
+ "1": {
980
+ name: "punctuation.definition.string.begin.dw"
981
+ }
982
+ },
983
+ end: "(/)",
984
+ endCaptures: {
985
+ "1": { name: "punctuation.definition.string.end.dw" }
986
+ },
987
+ patterns: [{ include: "#regexp" }]
988
+ },
989
+ {
990
+ name: "string.regexp.dw",
991
+ begin: "(?<![_$[:alnum:])])\\/(?![\\/*])(?=(?:[^\\/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+\\/(?![\\/*])(?!\\s*[a-zA-Z0-9_$]))",
992
+ beginCaptures: {
993
+ "0": {
994
+ name: "punctuation.definition.string.begin.dw"
995
+ }
996
+ },
997
+ end: "(/)",
998
+ endCaptures: {
999
+ "1": { name: "punctuation.definition.string.end.dw" }
1000
+ },
1001
+ patterns: [{ include: "#regexp" }]
1002
+ }
1003
+ ]
1004
+ },
1005
+ regexp: {
1006
+ patterns: [
1007
+ {
1008
+ name: "keyword.control.anchor.regexp",
1009
+ match: "\\\\[bB]|\\^|\\$"
1010
+ },
1011
+ {
1012
+ name: "keyword.other.back-reference.regexp",
1013
+ match: "\\\\[1-9]\\d*"
1014
+ },
1015
+ {
1016
+ name: "keyword.operator.quantifier.regexp",
1017
+ match: "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??"
1018
+ },
1019
+ {
1020
+ name: "keyword.operator.or.regexp",
1021
+ match: "\\|"
1022
+ },
1023
+ {
1024
+ name: "meta.group.assertion.regexp",
1025
+ begin: "(\\()((\\?=)|(\\?!))",
1026
+ beginCaptures: {
1027
+ "1": { name: "punctuation.definition.group.regexp" },
1028
+ "2": {
1029
+ name: "punctuation.definition.group.assertion.regexp"
1030
+ },
1031
+ "3": { name: "meta.assertion.look-ahead.regexp" },
1032
+ "4": {
1033
+ name: "meta.assertion.negative-look-ahead.regexp"
1034
+ }
1035
+ },
1036
+ end: "(\\))",
1037
+ endCaptures: {
1038
+ "1": { name: "punctuation.definition.group.regexp" }
1039
+ },
1040
+ patterns: [{ include: "#regexp" }]
1041
+ },
1042
+ {
1043
+ name: "meta.group.regexp",
1044
+ begin: "\\((\\?:)?",
1045
+ beginCaptures: {
1046
+ "0": { name: "punctuation.definition.group.regexp" },
1047
+ "1": {
1048
+ name: "punctuation.definition.group.capture.regexp"
1049
+ }
1050
+ },
1051
+ end: "\\)",
1052
+ endCaptures: {
1053
+ "0": { name: "punctuation.definition.group.regexp" }
1054
+ },
1055
+ patterns: [{ include: "#regexp" }]
1056
+ },
1057
+ {
1058
+ name: "constant.other.character-class.set.regexp",
1059
+ begin: "(\\[)(\\^)?",
1060
+ beginCaptures: {
1061
+ "1": {
1062
+ name: "punctuation.definition.character-class.regexp"
1063
+ },
1064
+ "2": { name: "keyword.operator.negation.regexp" }
1065
+ },
1066
+ end: "(\\])",
1067
+ endCaptures: {
1068
+ "1": {
1069
+ name: "punctuation.definition.character-class.regexp"
1070
+ }
1071
+ },
1072
+ patterns: [
1073
+ {
1074
+ name: "constant.other.character-class.range.regexp",
1075
+ match: "(?:.|(\\\\(?:[0-7]{3}|x\\h\\h|u\\h\\h\\h\\h))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x\\h\\h|u\\h\\h\\h\\h))|(\\\\c[A-Z])|(\\\\.))",
1076
+ captures: {
1077
+ "1": {
1078
+ name: "constant.character.numeric.regexp"
1079
+ },
1080
+ "2": {
1081
+ name: "constant.character.control.regexp"
1082
+ },
1083
+ "3": {
1084
+ name: "constant.character.escape.backslash.regexp"
1085
+ },
1086
+ "4": {
1087
+ name: "constant.character.numeric.regexp"
1088
+ },
1089
+ "5": {
1090
+ name: "constant.character.control.regexp"
1091
+ },
1092
+ "6": {
1093
+ name: "constant.character.escape.backslash.regexp"
1094
+ }
1095
+ }
1096
+ },
1097
+ { include: "#regex-character-class" }
1098
+ ]
1099
+ },
1100
+ { include: "#regex-character-class" }
1101
+ ]
1102
+ },
1103
+ "regex-character-class": {
1104
+ patterns: [
1105
+ {
1106
+ name: "constant.other.character-class.regexp",
1107
+ match: "\\\\[wWsSdDtrnvf]|\\."
1108
+ },
1109
+ {
1110
+ name: "constant.character.numeric.regexp",
1111
+ match: "\\\\([0-7]{3}|x\\h\\h|u\\h\\h\\h\\h)"
1112
+ },
1113
+ {
1114
+ name: "constant.character.control.regexp",
1115
+ match: "\\\\c[A-Z]"
1116
+ },
1117
+ {
1118
+ name: "constant.character.escape.backslash.regexp",
1119
+ match: "\\\\."
1120
+ }
1121
+ ]
1122
+ }
1123
+ }
1124
+ };
1125
+
1126
+ const ampscriptGrammar = {
1127
+ version: "2.0",
1128
+ name: "ampscript",
1129
+ scopeName: "text.html.amp",
1130
+ foldingStartMarker: "%%\\[\\s*$",
1131
+ foldingStopMarker: "^\\s*\\]%%$",
1132
+ injections: {
1133
+ "R:comment.block,comment.block.html,meta.attribute": {
1134
+ patterns: [
1135
+ {
1136
+ include: "#ampscript"
1137
+ },
1138
+ {
1139
+ include: "#ampscript-substitutions"
1140
+ }
1141
+ ]
1142
+ }
1143
+ },
1144
+ patterns: [
1145
+ {
1146
+ include: "#ampscript"
1147
+ },
1148
+ {
1149
+ include: "text.html.basic"
1150
+ }
1151
+ ],
1152
+ repository: {
1153
+ ampscript: {
1154
+ name: "meta.embedded.amp",
1155
+ begin: "(%%[=\\[])",
1156
+ end: "([\\]=]%%)",
1157
+ beginCaptures: {
1158
+ "1": {
1159
+ name: "keyword.other.namespace.amp"
1160
+ }
1161
+ },
1162
+ endCaptures: {
1163
+ "1": {
1164
+ name: "keyword.other.namespace.amp"
1165
+ }
1166
+ },
1167
+ patterns: [
1168
+ {
1169
+ include: "#ampscript-comments"
1170
+ },
1171
+ {
1172
+ include: "#ampscript-functions"
1173
+ },
1174
+ {
1175
+ include: "#ampscript-numeric"
1176
+ },
1177
+ {
1178
+ include: "#ampscript-contstants"
1179
+ },
1180
+ {
1181
+ include: "#ampscript-language-elements"
1182
+ },
1183
+ {
1184
+ include: "#ampscript-strings"
1185
+ }
1186
+ ]
1187
+ },
1188
+ "ampscript-comments": {
1189
+ patterns: [
1190
+ {
1191
+ name: "comment.block.amp",
1192
+ begin: "/\\*",
1193
+ captures: {
1194
+ "0": {
1195
+ name: "punctuation.definition.comment.amp"
1196
+ }
1197
+ },
1198
+ end: "\\*/"
1199
+ }
1200
+ ]
1201
+ },
1202
+ "ampscript-functions": {
1203
+ name: "support.function.amp",
1204
+ match: "((?i:beginimpressionregion|endimpressionregion|beginassetblock|endassetblock|contentarea|contentareabyname|contentblockbyname|contentblockbyid|contentblockbykey|treatascontent|treatascontentarea|lookup|lookuprows|lookuprowscs|rowcount|row|field|now|datediff|dateparse|redirectto|random|add|subtract|multiply|divide|mod|concat|indexof|char|empty|propercase|substring|length|lowercase|uppercase|trim|regexmatch|replace|replacelist|format|iif|isnull|output|outputline|v|attributevalue)\\b)(?=\\()"
1205
+ },
1206
+ "ampscript-numeric": {
1207
+ name: "constant.numeric.amp",
1208
+ match: "\\b((0(x|X)[0-9a-fA-F]+)|([0-9]+(\\.[0-9]+)?))\\b"
1209
+ },
1210
+ "ampscript-contstants": {
1211
+ patterns: [
1212
+ {
1213
+ name: "constant.language.boolean.true.amp",
1214
+ match: "((?i:true)\\b)"
1215
+ },
1216
+ {
1217
+ name: "constant.language.boolean.false.amp",
1218
+ match: "((?i:false)\\b)"
1219
+ },
1220
+ {
1221
+ name: "constant.language.boolean.null.amp",
1222
+ match: "((?i:null)\\b)"
1223
+ }
1224
+ ]
1225
+ },
1226
+ "ampscript-language-elements": {
1227
+ patterns: [
1228
+ {
1229
+ name: "keyword.control.amp",
1230
+ match: "((?i:do|else|elseif|for|if|endif|next|then|to|downto)\\b)"
1231
+ },
1232
+ {
1233
+ name: "storage.type.amp",
1234
+ match: "((?i:var|set)\\b)"
1235
+ },
1236
+ {
1237
+ name: "variable.parameter.amp",
1238
+ match: "\\@[a-zA-Z0-9_]+"
1239
+ },
1240
+ {
1241
+ name: "variable.parameter.amp",
1242
+ match: "\\[[a-zA-Z0-9_]+\\]"
1243
+ },
1244
+ {
1245
+ name: "support.class.amp",
1246
+ match: "((?i:and|or|not)\\b)"
1247
+ },
1248
+ {
1249
+ name: "variable.operator.amp",
1250
+ match: "==|!=|>|<|>=|<=|="
1251
+ }
1252
+ ]
1253
+ },
1254
+ "ampscript-strings": {
1255
+ patterns: [
1256
+ {
1257
+ name: "string.quoted.double.amp",
1258
+ begin: '"',
1259
+ end: '"',
1260
+ beginCaptures: {
1261
+ "0": {
1262
+ name: "punctuation.definition.string.begin.amp"
1263
+ }
1264
+ },
1265
+ endCaptures: {
1266
+ "0": {
1267
+ name: "punctuation.definition.string.end.amp"
1268
+ }
1269
+ },
1270
+ patterns: [
1271
+ {
1272
+ name: "constant.character.escape.amp",
1273
+ match: '""'
1274
+ }
1275
+ ]
1276
+ },
1277
+ {
1278
+ name: "string.quoted.single.amp",
1279
+ begin: "'",
1280
+ end: "'",
1281
+ beginCaptures: {
1282
+ "0": {
1283
+ name: "punctuation.definition.string.begin.amp"
1284
+ }
1285
+ },
1286
+ endCaptures: {
1287
+ "0": {
1288
+ name: "punctuation.definition.string.end.amp"
1289
+ }
1290
+ },
1291
+ patterns: [
1292
+ {
1293
+ name: "constant.character.escape.amp",
1294
+ match: "''"
1295
+ }
1296
+ ]
1297
+ }
1298
+ ]
1299
+ }
1300
+ }
1301
+ };
1302
+
1303
+ const afscriptGrammar = {
1304
+ name: "afscript",
1305
+ scopeName: "source.afscript",
1306
+ fileTypes: ["afscript"],
1307
+ patterns: [
1308
+ {
1309
+ name: "comment.line.afscript",
1310
+ match: "#.*$"
1311
+ },
1312
+ {
1313
+ name: "meta.config.afscript",
1314
+ begin: "^(config):",
1315
+ beginCaptures: {
1316
+ "1": { name: "keyword.control.block.afscript" }
1317
+ },
1318
+ end: "^(?=topic|variables|start_agent|system|$)",
1319
+ patterns: [
1320
+ {
1321
+ name: "keyword.config.key.afscript",
1322
+ match: "^\\s+(model_provider|user_locale|locale|agent_id|agent_name|agent_version|agent_type|default_agent_user|language|developer_name|description)(?=:)"
1323
+ },
1324
+ {
1325
+ name: "entity.name.config.afscript",
1326
+ match: "^\\s+([a-zA-Z_][a-zA-Z0-9_]*)(?=:)"
1327
+ },
1328
+ { include: "#values" }
1329
+ ]
1330
+ },
1331
+ {
1332
+ name: "meta.variables.afscript",
1333
+ begin: "^(variables):",
1334
+ beginCaptures: {
1335
+ "1": { name: "keyword.control.block.afscript" }
1336
+ },
1337
+ end: "^(?=topic|config|start_agent|system|$)",
1338
+ patterns: [
1339
+ {
1340
+ name: "keyword.variable.metadata.afscript",
1341
+ match: "^\\s{8}(description|source)(?=:)"
1342
+ },
1343
+ {
1344
+ name: "variable.definition.afscript",
1345
+ match: "^\\s+([a-zA-Z_][a-zA-Z0-9_]*)(?=:)"
1346
+ },
1347
+ {
1348
+ name: "keyword.variable.source.afscript",
1349
+ match: "\\b(custom|context)\\b"
1350
+ },
1351
+ {
1352
+ name: "storage.type.afscript",
1353
+ match: "\\b(string|number|boolean|object|date|timestamp|currency|id|list)\\b"
1354
+ },
1355
+ { include: "#json-structures" },
1356
+ { include: "#values" }
1357
+ ]
1358
+ },
1359
+ {
1360
+ name: "meta.system.afscript",
1361
+ begin: "^(system):",
1362
+ beginCaptures: {
1363
+ "1": { name: "keyword.control.block.afscript" }
1364
+ },
1365
+ end: "^(?=topic|config|variables|start_agent|$)",
1366
+ patterns: [
1367
+ {
1368
+ name: "keyword.system.afscript",
1369
+ match: "\\b(instructions|messages|prompt)(?=:)"
1370
+ },
1371
+ {
1372
+ name: "keyword.system.message-type.afscript",
1373
+ match: "\\b(error|welcome)(?=:)"
1374
+ },
1375
+ { include: "#multiline-instructions" },
1376
+ { include: "#values" }
1377
+ ]
1378
+ },
1379
+ {
1380
+ name: "meta.topic.afscript",
1381
+ begin: "^(topic)\\s+([a-zA-Z_][a-zA-Z0-9_]*):",
1382
+ beginCaptures: {
1383
+ "1": { name: "keyword.control.block.afscript" },
1384
+ "2": { name: "entity.name.topic.afscript" }
1385
+ },
1386
+ end: "^(?=topic|config|variables|start_agent|system|$)",
1387
+ patterns: [
1388
+ { include: "#action-definitions" },
1389
+ { include: "#agent-task" },
1390
+ { include: "#task-content" },
1391
+ { include: "#override-instructions" },
1392
+ { include: "#reasoning-instructions" },
1393
+ { include: "#reasoning-actions" },
1394
+ { include: "#directives" },
1395
+ {
1396
+ name: "keyword.topic.section.afscript",
1397
+ match: "\\b(actions|action_definitions|before_reasoning|after_reasoning|reasoning_actions|override|variables|instructions)(?=:)"
1398
+ },
1399
+ {
1400
+ name: "keyword.topic.section.afscript",
1401
+ match: "^\\s{4}(description)(?=:)"
1402
+ },
1403
+ {
1404
+ name: "keyword.override.path.afscript",
1405
+ match: "\\b(system\\.instructions)\\b"
1406
+ },
1407
+ {
1408
+ name: "storage.type.afscript",
1409
+ match: "\\b(string|number|boolean|object|date|timestamp|currency|id|list)\\b"
1410
+ },
1411
+ { include: "#operators" },
1412
+ { include: "#punctuation" },
1413
+ { include: "#values" }
1414
+ ]
1415
+ },
1416
+ {
1417
+ name: "meta.start-agent.afscript",
1418
+ begin: "^(start_agent)(?:\\s+([a-zA-Z_][a-zA-Z0-9_]*))?",
1419
+ beginCaptures: {
1420
+ "1": { name: "keyword.control.block.afscript" },
1421
+ "2": { name: "entity.name.agent.afscript" }
1422
+ },
1423
+ end: "^(?=topic|config|variables|start_agent|system|$)",
1424
+ patterns: [
1425
+ { include: "#action-definitions" },
1426
+ { include: "#agent-task" },
1427
+ { include: "#task-content" },
1428
+ { include: "#override-instructions" },
1429
+ { include: "#reasoning-instructions" },
1430
+ { include: "#reasoning-actions" },
1431
+ { include: "#directives" },
1432
+ {
1433
+ name: "keyword.topic.section.afscript",
1434
+ match: "\\b(actions|action_definitions|before_reasoning|after_reasoning|reasoning_actions|override|variables|instructions)(?=:)"
1435
+ },
1436
+ {
1437
+ name: "keyword.topic.section.afscript",
1438
+ match: "^\\s{4}(description)(?=:)"
1439
+ },
1440
+ {
1441
+ name: "storage.type.afscript",
1442
+ match: "\\b(string|number|boolean|object|date|timestamp|currency|id|list)\\b"
1443
+ },
1444
+ { include: "#operators" },
1445
+ { include: "#punctuation" },
1446
+ { include: "#values" }
1447
+ ]
1448
+ },
1449
+ {
1450
+ name: "keyword.control.conditional.available.afscript",
1451
+ match: "\\bavailable when\\b"
1452
+ },
1453
+ {
1454
+ name: "meta.alias.assignment.afscript",
1455
+ match: "\\b(as)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b",
1456
+ captures: {
1457
+ "1": { name: "keyword.control.afscript" },
1458
+ "2": { name: "entity.name.alias.afscript" }
1459
+ }
1460
+ },
1461
+ {
1462
+ name: "keyword.control.afscript",
1463
+ match: "\\b(if|else|run|set|with|and|or|implementation)\\b|\\btransition to\\b"
1464
+ },
1465
+ {
1466
+ name: "constant.language.afscript",
1467
+ match: "\\b(True|False)\\b"
1468
+ },
1469
+ {
1470
+ name: "constant.other.timestamp.afscript",
1471
+ match: "(?<=\\s|=|,|\\[)\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z?\\b"
1472
+ },
1473
+ {
1474
+ name: "constant.other.date.afscript",
1475
+ match: "(?<=\\s|=|,|\\[)\\d{4}-\\d{2}-\\d{2}(?!T)\\b"
1476
+ },
1477
+ {
1478
+ name: "constant.numeric.afscript",
1479
+ match: "\\b\\d+(\\.\\d+)?\\b"
1480
+ },
1481
+ {
1482
+ name: "string.quoted.double.afscript",
1483
+ begin: '"',
1484
+ end: '"',
1485
+ patterns: [
1486
+ { include: "#template-expression" },
1487
+ {
1488
+ name: "constant.character.escape.afscript",
1489
+ match: "\\\\."
1490
+ }
1491
+ ]
1492
+ },
1493
+ {
1494
+ name: "meta.utils.call.afscript",
1495
+ match: "(@utils)(\\.)([a-zA-Z_][a-zA-Z0-9_]*)\\b",
1496
+ captures: {
1497
+ "1": { name: "support.class.afscript" },
1498
+ "2": { name: "punctuation.accessor.dot.afscript" },
1499
+ "3": { name: "entity.name.function.afscript" }
1500
+ }
1501
+ },
1502
+ {
1503
+ name: "keyword.control.transition.afscript",
1504
+ match: "\\s+to\\s+"
1505
+ },
1506
+ {
1507
+ name: "meta.variable.reference.afscript",
1508
+ match: "(@)(variable|result|input|topic|action)(\\.)([a-zA-Z_][a-zA-Z0-9_]*)",
1509
+ captures: {
1510
+ "1": { name: "support.class.afscript" },
1511
+ "2": { name: "support.class.afscript" },
1512
+ "3": { name: "punctuation.accessor.dot.afscript" },
1513
+ "4": { name: "variable.other.member.afscript" }
1514
+ }
1515
+ },
1516
+ {
1517
+ name: "support.class.afscript",
1518
+ match: "@[a-zA-Z_][a-zA-Z0-9_]*"
1519
+ },
1520
+ {
1521
+ name: "variable.other.member.afscript",
1522
+ match: "(?<=@(?:variable|topic|input|action|result)\\.)\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
1523
+ },
1524
+ {
1525
+ name: "operator.arithmetic.afscript",
1526
+ match: "[+\\-\\*/%]"
1527
+ },
1528
+ {
1529
+ name: "operator.comparison.afscript",
1530
+ match: "==|!=|<=|>=|<|>"
1531
+ },
1532
+ {
1533
+ name: "operator.assignment.afscript",
1534
+ match: "(?<![=!<>])=(?!=)"
1535
+ },
1536
+ {
1537
+ name: "punctuation.definition.afscript",
1538
+ match: "[{}\\[\\]()]"
1539
+ },
1540
+ { include: "#punctuation" },
1541
+ { include: "#template-expression" }
1542
+ ],
1543
+ repository: {
1544
+ values: {
1545
+ patterns: [
1546
+ { include: "#operators" },
1547
+ { include: "#template-expression" },
1548
+ { include: "#punctuation" },
1549
+ {
1550
+ name: "string.quoted.double.afscript",
1551
+ begin: '"',
1552
+ end: '"',
1553
+ patterns: [
1554
+ { include: "#template-expression" },
1555
+ {
1556
+ name: "constant.character.escape.afscript",
1557
+ match: "\\\\."
1558
+ }
1559
+ ]
1560
+ },
1561
+ {
1562
+ name: "constant.language.afscript",
1563
+ match: "\\b(True|False)\\b"
1564
+ },
1565
+ {
1566
+ name: "constant.other.timestamp.afscript",
1567
+ match: "(?<=\\s|=|,|\\[)\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?Z?\\b"
1568
+ },
1569
+ {
1570
+ name: "constant.other.date.afscript",
1571
+ match: "(?<=\\s|=|,|\\[)\\d{4}-\\d{2}-\\d{2}(?!T)\\b"
1572
+ },
1573
+ {
1574
+ name: "constant.numeric.afscript",
1575
+ match: "\\b\\d+(\\.\\d+)?\\b"
1576
+ },
1577
+ {
1578
+ name: "variable.other.member.afscript",
1579
+ match: "(?<=@(?:variable|topic|input|action|result)\\.)\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
1580
+ }
1581
+ ]
1582
+ },
1583
+ "json-structures": {
1584
+ patterns: [
1585
+ {
1586
+ name: "constant.language.json.afscript",
1587
+ match: "=\\s*\\{\\}"
1588
+ },
1589
+ {
1590
+ name: "meta.structure.dictionary.json.afscript",
1591
+ begin: "=\\s*(\\{)",
1592
+ beginCaptures: {
1593
+ "1": {
1594
+ name: "punctuation.definition.dictionary.begin.json.afscript"
1595
+ }
1596
+ },
1597
+ end: "(\\})",
1598
+ endCaptures: {
1599
+ "1": {
1600
+ name: "punctuation.definition.dictionary.end.json.afscript"
1601
+ }
1602
+ },
1603
+ patterns: [{ include: "#json-value" }]
1604
+ },
1605
+ {
1606
+ name: "meta.structure.array.json.afscript",
1607
+ begin: "=\\s*(\\[)",
1608
+ beginCaptures: {
1609
+ "1": {
1610
+ name: "punctuation.definition.array.begin.json.afscript"
1611
+ }
1612
+ },
1613
+ end: "(\\])",
1614
+ endCaptures: {
1615
+ "1": {
1616
+ name: "punctuation.definition.array.end.json.afscript"
1617
+ }
1618
+ },
1619
+ patterns: [{ include: "#json-value" }]
1620
+ }
1621
+ ]
1622
+ },
1623
+ "multiline-instructions": {
1624
+ name: "meta.multiline.instructions.afscript",
1625
+ begin: "^(\\s+)(instructions:)\\s*$",
1626
+ beginCaptures: {
1627
+ "2": { name: "keyword.system.afscript" }
1628
+ },
1629
+ end: "^(?=\\s{4}(messages|prompt)\\b)|^(?=\\S)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1630
+ patterns: [
1631
+ {
1632
+ name: "string.heredoc.afscript",
1633
+ begin: "(>>)\\s*$",
1634
+ beginCaptures: {
1635
+ "1": { name: "keyword.operator.heredoc.afscript" }
1636
+ },
1637
+ end: "^(?=\\s{4}(messages|prompt)\\b)|^(?=\\S)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1638
+ patterns: [
1639
+ { include: "#template-expression" },
1640
+ {
1641
+ name: "string.unquoted.heredoc.afscript",
1642
+ match: "."
1643
+ }
1644
+ ]
1645
+ },
1646
+ {
1647
+ name: "string.unquoted.multiline.afscript",
1648
+ begin: "^\\s+",
1649
+ end: "^(?=\\s{4}(messages|prompt)\\b)|^(?=\\S)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1650
+ patterns: [
1651
+ { include: "#template-expression" },
1652
+ {
1653
+ name: "string.unquoted.instructions.afscript",
1654
+ match: ".*"
1655
+ }
1656
+ ]
1657
+ }
1658
+ ]
1659
+ },
1660
+ "agent-task": {
1661
+ patterns: [
1662
+ {
1663
+ name: "string.heredoc.afscript",
1664
+ begin: "(>>)\\s*$",
1665
+ beginCaptures: {
1666
+ "1": { name: "keyword.operator.heredoc.afscript" }
1667
+ },
1668
+ end: "^(?=\\S)",
1669
+ patterns: [
1670
+ { include: "#template-expression" },
1671
+ {
1672
+ name: "string.unquoted.heredoc.afscript",
1673
+ match: ".*"
1674
+ }
1675
+ ]
1676
+ },
1677
+ {
1678
+ name: "string.heredoc.quoted.afscript",
1679
+ begin: '(>>)\\s*"',
1680
+ beginCaptures: {
1681
+ "1": { name: "keyword.operator.heredoc.afscript" }
1682
+ },
1683
+ end: '"',
1684
+ patterns: [
1685
+ { include: "#template-expression" },
1686
+ {
1687
+ name: "constant.character.escape.afscript",
1688
+ match: "\\\\."
1689
+ }
1690
+ ]
1691
+ }
1692
+ ]
1693
+ },
1694
+ "task-content": {
1695
+ name: "meta.task.content.afscript",
1696
+ begin: "\\b(task):\\s*$",
1697
+ beginCaptures: {
1698
+ "1": { name: "keyword.topic.section.afscript" }
1699
+ },
1700
+ end: "^(?=\\S)",
1701
+ patterns: [
1702
+ { include: "#template-expression" },
1703
+ {
1704
+ name: "string.unquoted.task.afscript",
1705
+ match: ".*"
1706
+ }
1707
+ ]
1708
+ },
1709
+ "override-instructions": {
1710
+ name: "meta.override.instructions.afscript",
1711
+ begin: "^(\\s+)(override system\\.instructions):\\s*$",
1712
+ beginCaptures: {
1713
+ "2": { name: "keyword.override.path.afscript" }
1714
+ },
1715
+ end: "^(?=\\s{4}(reasoning_actions|actions|before_reasoning|after_reasoning|description|variables|instructions|override)\\b)|^(?=\\s*$)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1716
+ patterns: [
1717
+ {
1718
+ name: "string.heredoc.afscript",
1719
+ begin: "(>>)\\s*$",
1720
+ beginCaptures: {
1721
+ "1": { name: "keyword.operator.heredoc.afscript" }
1722
+ },
1723
+ end: "^(?=\\s{4}(reasoning_actions|actions|before_reasoning|after_reasoning|description|variables|instructions|override)\\b)|^(?=\\s*$)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1724
+ patterns: [
1725
+ { include: "#template-expression" },
1726
+ {
1727
+ name: "string.unquoted.heredoc.afscript",
1728
+ match: "."
1729
+ }
1730
+ ]
1731
+ },
1732
+ {
1733
+ name: "string.heredoc.quoted.afscript",
1734
+ begin: '(>>)\\s*"',
1735
+ beginCaptures: {
1736
+ "1": { name: "keyword.operator.heredoc.afscript" }
1737
+ },
1738
+ end: '"',
1739
+ patterns: [
1740
+ { include: "#template-expression" },
1741
+ {
1742
+ name: "string.unquoted.heredoc.afscript",
1743
+ match: "."
1744
+ }
1745
+ ]
1746
+ },
1747
+ {
1748
+ name: "string.unquoted.multiline.afscript",
1749
+ begin: "^\\s+",
1750
+ end: "^(?=\\s{4}(reasoning_actions|actions|before_reasoning|after_reasoning|description|variables|instructions|override)\\b)|^(?=\\s*$)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1751
+ patterns: [
1752
+ { include: "#template-expression" },
1753
+ {
1754
+ name: "string.unquoted.instructions.afscript",
1755
+ match: ".*"
1756
+ }
1757
+ ]
1758
+ }
1759
+ ]
1760
+ },
1761
+ "reasoning-instructions": {
1762
+ name: "meta.reasoning.instructions.afscript",
1763
+ begin: "^(\\s+)(reasoning_instructions):\\s*$",
1764
+ beginCaptures: {
1765
+ "2": { name: "keyword.topic.section.afscript" }
1766
+ },
1767
+ end: "^(?=\\s{4}(reasoning_actions|actions|before_reasoning|after_reasoning|description|variables|instructions|override)\\b)|^(?=\\s*$)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1768
+ patterns: [
1769
+ {
1770
+ name: "string.heredoc.afscript",
1771
+ begin: "(>>)\\s*$",
1772
+ beginCaptures: {
1773
+ "1": { name: "keyword.operator.heredoc.afscript" }
1774
+ },
1775
+ end: "^(?=\\s{4}(reasoning_actions|actions|before_reasoning|after_reasoning|description|variables|instructions|override)\\b)|^(?=\\s*$)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1776
+ patterns: [
1777
+ { include: "#template-expression" },
1778
+ {
1779
+ name: "string.unquoted.heredoc.afscript",
1780
+ match: "."
1781
+ }
1782
+ ]
1783
+ },
1784
+ {
1785
+ name: "string.heredoc.quoted.afscript",
1786
+ begin: '(>>)\\s*"',
1787
+ beginCaptures: {
1788
+ "1": { name: "keyword.operator.heredoc.afscript" }
1789
+ },
1790
+ end: '"',
1791
+ patterns: [
1792
+ { include: "#template-expression" },
1793
+ {
1794
+ name: "string.unquoted.heredoc.afscript",
1795
+ match: "."
1796
+ }
1797
+ ]
1798
+ },
1799
+ {
1800
+ name: "string.heredoc.afscript",
1801
+ begin: '"',
1802
+ end: '"',
1803
+ patterns: [
1804
+ { include: "#template-expression" },
1805
+ {
1806
+ name: "string.unquoted.heredoc.afscript",
1807
+ match: "."
1808
+ }
1809
+ ]
1810
+ }
1811
+ ]
1812
+ },
1813
+ "action-definitions": {
1814
+ name: "meta.actions.afscript",
1815
+ begin: "^(\\s+)(actions|action_definitions):",
1816
+ beginCaptures: {
1817
+ "2": { name: "keyword.topic.section.afscript" }
1818
+ },
1819
+ end: "^(?=\\s{4}(reasoning_instructions|reasoning_actions|before_reasoning|after_reasoning|description|variables|instructions|override)\\b)|^(?=\\s*$)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1820
+ patterns: [
1821
+ {
1822
+ name: "entity.name.action.afscript",
1823
+ match: "^\\s{4,8}([a-zA-Z_][a-zA-Z0-9_]*)(?=:)"
1824
+ },
1825
+ {
1826
+ name: "keyword.action.property.afscript",
1827
+ match: "^\\s{12}(description|target|inputs|outputs|parameters|returns|implementation|label|require_user_confirmation|include_in_progress_indicator|progress_indicator_message|is_required|is_user_input|developer_name|complex_data_type_name|is_used_by_planner|is_displayable)(?=:)"
1828
+ },
1829
+ {
1830
+ name: "storage.type.afscript",
1831
+ match: "\\b(string|number|boolean|object|date|timestamp|currency|id|list)\\b"
1832
+ },
1833
+ { include: "#operators" },
1834
+ { include: "#punctuation" },
1835
+ { include: "#values" }
1836
+ ]
1837
+ },
1838
+ "reasoning-actions": {
1839
+ name: "meta.reasoning-actions.afscript",
1840
+ begin: "^(\\s+)(reasoning_actions):",
1841
+ beginCaptures: {
1842
+ "2": { name: "keyword.topic.section.afscript" }
1843
+ },
1844
+ end: "^(?=\\s{4}(reasoning_instructions|actions|before_reasoning|after_reasoning|description|variables|instructions|override)\\b)|^(?=\\s*$)|^(?=topic\\b|config\\b|variables\\b|start_agent\\b|system\\b)",
1845
+ patterns: [
1846
+ { include: "#directives" },
1847
+ {
1848
+ name: "meta.utils.call.afscript",
1849
+ match: "(@utils)(\\.)([a-zA-Z_][a-zA-Z0-9_]*)\\b",
1850
+ captures: {
1851
+ "1": { name: "support.class.afscript" },
1852
+ "2": { name: "punctuation.accessor.dot.afscript" },
1853
+ "3": { name: "entity.name.function.afscript" }
1854
+ }
1855
+ },
1856
+ {
1857
+ name: "meta.variable.reference.afscript",
1858
+ match: "(@)(action|topic|variable|result|input)(\\.)([a-zA-Z_][a-zA-Z0-9_]*)",
1859
+ captures: {
1860
+ "1": { name: "support.class.afscript" },
1861
+ "2": { name: "support.class.afscript" },
1862
+ "3": { name: "punctuation.accessor.dot.afscript" },
1863
+ "4": { name: "variable.other.member.afscript" }
1864
+ }
1865
+ },
1866
+ {
1867
+ name: "meta.alias.assignment.afscript",
1868
+ match: "\\b(as)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b",
1869
+ captures: {
1870
+ "1": { name: "keyword.control.afscript" },
1871
+ "2": { name: "entity.name.alias.afscript" }
1872
+ }
1873
+ },
1874
+ {
1875
+ name: "keyword.control.transition.reasoning.afscript",
1876
+ match: "\\s+to\\s+"
1877
+ },
1878
+ {
1879
+ name: "keyword.reasoning.description.afscript",
1880
+ match: "^\\s{12}(description)(?=:)"
1881
+ },
1882
+ {
1883
+ name: "keyword.control.afscript",
1884
+ match: "\\b(setVariables)\\b"
1885
+ },
1886
+ {
1887
+ name: "entity.name.action.afscript",
1888
+ match: "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
1889
+ },
1890
+ { include: "#values" }
1891
+ ]
1892
+ },
1893
+ directives: {
1894
+ patterns: [
1895
+ {
1896
+ name: "keyword.control.conditional.available.afscript",
1897
+ match: "\\bavailable when\\b"
1898
+ },
1899
+ {
1900
+ name: "meta.alias.assignment.afscript",
1901
+ match: "\\b(as)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b",
1902
+ captures: {
1903
+ "1": { name: "keyword.control.afscript" },
1904
+ "2": { name: "entity.name.alias.afscript" }
1905
+ }
1906
+ },
1907
+ {
1908
+ name: "keyword.control.directive.afscript",
1909
+ match: "\\b(run|set|if|else|after|with|and|or)\\b|\\btransition to\\b"
1910
+ },
1911
+ {
1912
+ name: "keyword.action-call.afscript",
1913
+ match: "(@action)(\\.)",
1914
+ captures: {
1915
+ "1": { name: "support.class.afscript" },
1916
+ "2": { name: "punctuation.accessor.dot.afscript" }
1917
+ }
1918
+ },
1919
+ {
1920
+ name: "keyword.variable-set.afscript",
1921
+ match: "(@variable)(\\.)",
1922
+ captures: {
1923
+ "1": { name: "support.class.afscript" },
1924
+ "2": { name: "punctuation.accessor.dot.afscript" }
1925
+ }
1926
+ },
1927
+ {
1928
+ name: "keyword.topic-ref.afscript",
1929
+ match: "(@topic)(\\.)",
1930
+ captures: {
1931
+ "1": { name: "support.class.afscript" },
1932
+ "2": { name: "punctuation.accessor.dot.afscript" }
1933
+ }
1934
+ },
1935
+ {
1936
+ name: "keyword.result-ref.afscript",
1937
+ match: "(@result)(\\.)",
1938
+ captures: {
1939
+ "1": { name: "support.class.afscript" },
1940
+ "2": { name: "punctuation.accessor.dot.afscript" }
1941
+ }
1942
+ },
1943
+ {
1944
+ name: "keyword.input-ref.afscript",
1945
+ match: "(@input)(\\.)",
1946
+ captures: {
1947
+ "1": { name: "support.class.afscript" },
1948
+ "2": { name: "punctuation.accessor.dot.afscript" }
1949
+ }
1950
+ },
1951
+ {
1952
+ name: "variable.other.member.afscript",
1953
+ match: "(?<=@(?:variable|topic|input|action|result)\\.)\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
1954
+ },
1955
+ { include: "#operators" },
1956
+ { include: "#values" }
1957
+ ]
1958
+ },
1959
+ "template-expression": {
1960
+ name: "meta.template.expression.afscript",
1961
+ begin: "\\{\\{",
1962
+ beginCaptures: {
1963
+ "0": {
1964
+ name: "punctuation.definition.template.begin.afscript"
1965
+ }
1966
+ },
1967
+ end: "\\}\\}",
1968
+ endCaptures: {
1969
+ "0": { name: "punctuation.definition.template.end.afscript" }
1970
+ },
1971
+ patterns: [
1972
+ {
1973
+ name: "string.quoted.single.expression.afscript",
1974
+ begin: "'",
1975
+ end: "'",
1976
+ patterns: [
1977
+ {
1978
+ name: "constant.character.escape.afscript",
1979
+ match: "\\\\."
1980
+ }
1981
+ ]
1982
+ },
1983
+ {
1984
+ name: "string.quoted.double.expression.afscript",
1985
+ begin: '"',
1986
+ end: '"',
1987
+ patterns: [
1988
+ {
1989
+ name: "constant.character.escape.afscript",
1990
+ match: "\\\\."
1991
+ }
1992
+ ]
1993
+ },
1994
+ {
1995
+ name: "constant.numeric.expression.afscript",
1996
+ match: "\\b\\d+(\\.\\d+)?\\b"
1997
+ },
1998
+ {
1999
+ name: "constant.language.expression.afscript",
2000
+ match: "\\b(True|False)\\b"
2001
+ },
2002
+ {
2003
+ name: "keyword.operator.expression.afscript",
2004
+ match: "\\b(and|or|if|else)\\b"
2005
+ },
2006
+ {
2007
+ name: "operator.comparison.expression.afscript",
2008
+ match: "==|!=|<=|>=|<|>"
2009
+ },
2010
+ {
2011
+ name: "operator.arithmetic.expression.afscript",
2012
+ match: "[+\\-\\*/%]"
2013
+ },
2014
+ {
2015
+ name: "meta.variable.reference.expression.afscript",
2016
+ match: "(@)([a-zA-Z_][a-zA-Z0-9_]*)(\\.)([a-zA-Z_][a-zA-Z0-9_]*)\\b",
2017
+ captures: {
2018
+ "1": { name: "support.class.afscript" },
2019
+ "2": { name: "support.class.afscript" },
2020
+ "3": { name: "punctuation.accessor.dot.afscript" },
2021
+ "4": { name: "variable.other.member.afscript" }
2022
+ }
2023
+ },
2024
+ {
2025
+ name: "variable.other.expression.afscript",
2026
+ match: "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
2027
+ },
2028
+ {
2029
+ name: "punctuation.definition.expression.afscript",
2030
+ match: "[()\\[\\]@.,]"
2031
+ }
2032
+ ]
2033
+ },
2034
+ "json-value": {
2035
+ patterns: [
2036
+ {
2037
+ name: "constant.language.json.afscript",
2038
+ match: "\\b(true|false|null)\\b"
2039
+ },
2040
+ {
2041
+ name: "constant.numeric.json.afscript",
2042
+ match: "-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?"
2043
+ },
2044
+ {
2045
+ name: "string.quoted.double.json.afscript",
2046
+ begin: '"',
2047
+ end: '"',
2048
+ patterns: [
2049
+ {
2050
+ name: "constant.character.escape.json.afscript",
2051
+ match: "\\\\."
2052
+ }
2053
+ ]
2054
+ },
2055
+ {
2056
+ name: "meta.structure.dictionary.json.afscript",
2057
+ begin: "\\{",
2058
+ beginCaptures: {
2059
+ "0": {
2060
+ name: "punctuation.definition.dictionary.begin.json.afscript"
2061
+ }
2062
+ },
2063
+ end: "\\}",
2064
+ endCaptures: {
2065
+ "0": {
2066
+ name: "punctuation.definition.dictionary.end.json.afscript"
2067
+ }
2068
+ },
2069
+ patterns: [
2070
+ {
2071
+ name: "meta.structure.dictionary.key.json.afscript",
2072
+ begin: '"',
2073
+ end: '"',
2074
+ patterns: [
2075
+ {
2076
+ name: "constant.character.escape.json.afscript",
2077
+ match: "\\\\."
2078
+ }
2079
+ ]
2080
+ },
2081
+ {
2082
+ name: "punctuation.separator.dictionary.key-value.json.afscript",
2083
+ match: ":"
2084
+ },
2085
+ {
2086
+ name: "punctuation.separator.dictionary.pair.json.afscript",
2087
+ match: ","
2088
+ },
2089
+ { include: "#json-value" }
2090
+ ]
2091
+ },
2092
+ {
2093
+ name: "meta.structure.array.json.afscript",
2094
+ begin: "\\[",
2095
+ beginCaptures: {
2096
+ "0": {
2097
+ name: "punctuation.definition.array.begin.json.afscript"
2098
+ }
2099
+ },
2100
+ end: "\\]",
2101
+ endCaptures: {
2102
+ "0": {
2103
+ name: "punctuation.definition.array.end.json.afscript"
2104
+ }
2105
+ },
2106
+ patterns: [
2107
+ {
2108
+ name: "punctuation.separator.array.json.afscript",
2109
+ match: ","
2110
+ },
2111
+ { include: "#json-value" }
2112
+ ]
2113
+ }
2114
+ ]
2115
+ },
2116
+ punctuation: {
2117
+ patterns: [
2118
+ {
2119
+ name: "punctuation.separator.key-value.afscript",
2120
+ match: ":"
2121
+ },
2122
+ {
2123
+ name: "punctuation.separator.list.afscript",
2124
+ match: ","
2125
+ },
2126
+ {
2127
+ name: "punctuation.definition.brackets.afscript",
2128
+ match: "[{}\\[\\]()]"
2129
+ },
2130
+ {
2131
+ name: "punctuation.accessor.dot.afscript",
2132
+ match: "\\."
2133
+ }
2134
+ ]
2135
+ },
2136
+ operators: {
2137
+ patterns: [
2138
+ {
2139
+ name: "operator.comparison.afscript",
2140
+ match: "==|!=|<=|>=|<|>"
2141
+ },
2142
+ {
2143
+ name: "operator.assignment.afscript",
2144
+ match: '\\s=\\s|\\s=(?=[\\{\\["\\d])|(?<=[a-zA-Z_])\\s*=\\s*'
2145
+ },
2146
+ {
2147
+ name: "operator.arithmetic.afscript",
2148
+ match: "[+\\-\\*%]"
2149
+ },
2150
+ {
2151
+ name: "punctuation.separator.path.afscript",
2152
+ match: "/"
2153
+ }
2154
+ ]
2155
+ }
2156
+ }
2157
+ };
2158
+
2159
+ export function getCustomLanguageGrammars() {
2160
+ return {
2161
+ dataweave: dataweaveGrammar,
2162
+ ampscript: ampscriptGrammar,
2163
+ afscript: afscriptGrammar
2164
+ };
2165
+ }