@malloydata/syntax-highlight 0.0.406 → 0.0.408

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.
@@ -1,59 +1,127 @@
1
1
  {
2
2
  "scopeName": "source.malloy",
3
- "patterns": [{ "include": "#malloy-language" }],
3
+ "patterns": [
4
+ {
5
+ "include": "#malloy-language"
6
+ }
7
+ ],
4
8
  "repository": {
5
9
  "malloy-language": {
6
10
  "patterns": [
7
- { "include": "#sql-string" },
8
- { "include": "#comments" },
9
- { "include": "#tags" },
10
- { "include": "#strings" },
11
- { "include": "#numbers" },
12
- { "include": "#keywords" },
13
- { "include": "#properties" },
14
- { "include": "#functions" },
15
- { "include": "#datetimes" },
16
- { "include": "#identifiers-quoted" },
17
- { "include": "#types" },
18
- { "include": "#constants" },
19
- { "include": "#timeframes" },
20
- { "include": "#identifiers-unquoted" }
11
+ {
12
+ "include": "#sql-string"
13
+ },
14
+ {
15
+ "include": "#comments"
16
+ },
17
+ {
18
+ "include": "#tags"
19
+ },
20
+ {
21
+ "include": "#strings"
22
+ },
23
+ {
24
+ "include": "#given"
25
+ },
26
+ {
27
+ "include": "#percent"
28
+ },
29
+ {
30
+ "include": "#numbers"
31
+ },
32
+ {
33
+ "include": "#keywords"
34
+ },
35
+ {
36
+ "include": "#properties"
37
+ },
38
+ {
39
+ "include": "#functions"
40
+ },
41
+ {
42
+ "include": "#datetimes"
43
+ },
44
+ {
45
+ "include": "#identifiers-quoted"
46
+ },
47
+ {
48
+ "include": "#types"
49
+ },
50
+ {
51
+ "include": "#constants"
52
+ },
53
+ {
54
+ "include": "#timeframes"
55
+ },
56
+ {
57
+ "include": "#identifiers-unquoted"
58
+ }
21
59
  ]
22
60
  },
23
61
  "malloy-matched": {
24
62
  "begin": "{",
25
63
  "end": "}",
26
64
  "patterns": [
27
- { "include": "#malloy-matched" },
28
- { "include": "#malloy-language" }
65
+ {
66
+ "include": "#malloy-matched"
67
+ },
68
+ {
69
+ "include": "#malloy-language"
70
+ }
29
71
  ]
30
72
  },
31
73
  "malloy-in-sql": {
32
- "begin": "%{",
33
- "name": "source.malloy-in-sql",
34
- "end": "}%?",
74
+ "begin": "%\\{",
75
+ "end": "\\}",
76
+ "beginCaptures": {
77
+ "0": {
78
+ "name": "punctuation.section.embedded.begin.malloy"
79
+ }
80
+ },
81
+ "endCaptures": {
82
+ "0": {
83
+ "name": "punctuation.section.embedded.end.malloy"
84
+ }
85
+ },
35
86
  "patterns": [
36
- { "include": "#malloy-matched" },
37
- { "include": "#malloy-language" }
87
+ {
88
+ "include": "#malloy-matched"
89
+ },
90
+ {
91
+ "include": "#malloy-language"
92
+ }
38
93
  ]
39
94
  },
40
95
  "sql-string": {
96
+ "comment": "SQL-ness is the .sql() context, not the delimiter — any string argument to connection.sql(...) is SQL. ONE combined rule, not three per-quote siblings: vscode-textmate's begin scanner drops shorter begins that share a prefix with a longer one, so separate \"\"\"/\"/' rules leave only \"\"\" working. The opening quote is captured (group 5) and the end back-references it (\\5), so all three close correctly. #malloy-in-sql gives \"\"\" blocks their %{ } interpolation; it also (harmlessly) applies inside short SQL strings, where %{ } is not real interpolation but is vanishingly rare.",
41
97
  "patterns": [
42
98
  {
43
- "begin": "(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(\"\"\")",
44
- "end": "\"\"\"",
99
+ "begin": "(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)((?i:sql))(\\s*\\(\\s*)(\"\"\"|\"|')",
100
+ "end": "\\5",
45
101
  "beginCaptures": {
46
- "1": { "name": "variable.other" },
47
- "3": { "name": "keyword.control.sql" },
48
- "5": { "name": "punctuation.sql-block.open" }
102
+ "1": {
103
+ "name": "variable.other.malloy"
104
+ },
105
+ "3": {
106
+ "name": "keyword.control.sql.malloy"
107
+ },
108
+ "5": {
109
+ "name": "punctuation.definition.string.begin.sql.malloy"
110
+ }
49
111
  },
50
112
  "endCaptures": {
51
- "0": { "name": "punctuation.sql-block.close" }
113
+ "0": {
114
+ "name": "punctuation.definition.string.end.sql.malloy"
115
+ }
52
116
  },
53
- "name": "source.sql",
117
+ "name": "meta.embedded.block.sql.malloy",
54
118
  "patterns": [
55
- { "include": "#malloy-in-sql" },
56
- { "include": "source.sql" }
119
+ {
120
+ "include": "#malloy-in-sql"
121
+ },
122
+ {
123
+ "include": "source.sql"
124
+ }
57
125
  ]
58
126
  }
59
127
  ]
@@ -61,29 +129,30 @@
61
129
  "functions": {
62
130
  "patterns": [
63
131
  {
64
- "match": "(?i)\\b(count)(\\s*\\()(distinct)",
132
+ "match": "(?i)\\b(all|avg|cast|compose|count|exclude|max|min|sum)(\\s*\\()",
65
133
  "captures": {
66
- "1": { "name": "entity.name.function" },
67
- "3": { "name": "entity.name.function.modifier" }
134
+ "1": {
135
+ "name": "support.function.malloy"
136
+ }
68
137
  }
69
138
  },
70
139
  {
71
- "match": "(?i)\\b(ALL|AVG|CAST|COMPOSE|COUNT|EXCLUDE|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",
140
+ "match": "(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date|json)?(\\s*\\()",
72
141
  "captures": {
73
- "1": { "name": "entity.name.function" }
142
+ "1": {
143
+ "name": "entity.name.function.malloy"
144
+ },
145
+ "3": {
146
+ "name": "storage.type.malloy"
147
+ }
74
148
  }
75
149
  },
76
150
  {
77
151
  "match": "(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",
78
152
  "captures": {
79
- "1": { "name": "entity.name.function" }
80
- }
81
- },
82
- {
83
- "match": "(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",
84
- "captures": {
85
- "1": { "name": "entity.name.function" },
86
- "3": { "name": "entity.name.type" }
153
+ "1": {
154
+ "name": "entity.name.function.malloy"
155
+ }
87
156
  }
88
157
  }
89
158
  ]
@@ -112,19 +181,27 @@
112
181
  "patterns": [
113
182
  {
114
183
  "match": "(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",
115
- "name": "variable.other"
184
+ "name": "variable.other.malloy"
116
185
  }
117
186
  ]
118
187
  },
188
+ "given": {
189
+ "match": "\\$[A-Za-z_][A-Za-z0-9_]*",
190
+ "name": "variable.parameter.malloy"
191
+ },
192
+ "percent": {
193
+ "match": "[0-9]+%",
194
+ "name": "constant.numeric.percentage.malloy"
195
+ },
119
196
  "timeframes": {
120
197
  "patterns": [
121
198
  {
122
199
  "match": "(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",
123
- "name": "keyword.other.timeframe"
200
+ "name": "keyword.other.timeframe.malloy"
124
201
  },
125
202
  {
126
203
  "match": "(?i)\\b(day_of_year|day_of_month)\\b",
127
- "name": "keyword.other.timeframe"
204
+ "name": "keyword.other.timeframe.malloy"
128
205
  }
129
206
  ]
130
207
  },
@@ -134,10 +211,14 @@
134
211
  "begin": "/\\*",
135
212
  "end": "\\*/",
136
213
  "beginCaptures": {
137
- "0": { "name": "punctuation.definition.comment.begin" }
214
+ "0": {
215
+ "name": "punctuation.definition.comment.begin"
216
+ }
138
217
  },
139
218
  "endCaptures": {
140
- "0": { "name": "punctuation.definition.comment.end" }
219
+ "0": {
220
+ "name": "punctuation.definition.comment.end"
221
+ }
141
222
  },
142
223
  "name": "comment.block"
143
224
  },
@@ -145,7 +226,9 @@
145
226
  "begin": "//",
146
227
  "end": "\\n",
147
228
  "beginCaptures": {
148
- "0": { "name": "punctuation.definition.comment" }
229
+ "0": {
230
+ "name": "punctuation.definition.comment"
231
+ }
149
232
  },
150
233
  "name": "comment.line.double-slash"
151
234
  },
@@ -153,142 +236,242 @@
153
236
  "begin": "--",
154
237
  "end": "\\n",
155
238
  "beginCaptures": {
156
- "0": { "name": "punctuation.definition.comment" }
239
+ "0": {
240
+ "name": "punctuation.definition.comment"
241
+ }
157
242
  },
158
243
  "name": "comment.line.double-hyphen"
159
244
  }
160
245
  ]
161
246
  },
162
247
  "tags": {
248
+ "comment": "Malloy annotations are ROUTED (annotation-prefix.ts parsePrefix; docs.malloydata.dev/documentation/language/tags). The sigil is ##? then an optional block '|'; the route follows it (up to first whitespace) and decides how the content reads. Tag routes — empty (MOTLY) and the claimed sigils ! @ : — carry tag property-language → tag styling. The documentation route (\") and app-defined bracketed routes ( () <> [] {} ) carry prose/markdown/JSON → documentation styling. Routes apply identically to single-line (#/##) and block (#|/##|) forms. The doc-route fragment is repeated per rule because TextMate has no regex variables; (?!docroute) on the tag rules both implements the split and keeps the prefix-sharing begin scanner from dropping the shorter tag begins. v1: bare tag values share the tag-name scope; tag-route block bodies get tag-content treatment.",
163
249
  "patterns": [
164
250
  {
165
- "begin": "^([ \\t]*)##\\|",
166
- "end": "^\\1\\|##",
251
+ "begin": "^([ \\t]*)(##\\|(?:\"|\\([^\\s)]*\\)|<[^\\s>]*>|\\[[^\\s\\]]*\\]|\\{[^\\s}]*\\}))",
252
+ "end": "^\\1(\\|##)",
167
253
  "beginCaptures": {
168
- "0": { "name": "support.type.property-name.json" }
254
+ "2": {
255
+ "name": "punctuation.definition.annotation.begin.malloy"
256
+ }
169
257
  },
170
258
  "endCaptures": {
171
- "0": { "name": "support.type.property-name.json" }
259
+ "1": {
260
+ "name": "punctuation.definition.annotation.end.malloy"
261
+ }
172
262
  },
173
- "name": "comment.line.double-slash",
174
- "patterns": [{ "include": "#tag-values" }]
263
+ "name": "comment.block.documentation.malloy"
175
264
  },
176
265
  {
177
- "begin": "^([ \\t]*)#\\|",
178
- "end": "^\\1\\|#(?!#)",
266
+ "begin": "^([ \\t]*)(##\\|)(?!(?:\"|\\([^\\s)]*\\)|<[^\\s>]*>|\\[[^\\s\\]]*\\]|\\{[^\\s}]*\\}))",
267
+ "end": "^\\1(\\|##)",
179
268
  "beginCaptures": {
180
- "0": { "name": "support.type.property-name.json" }
269
+ "2": {
270
+ "name": "punctuation.definition.annotation.begin.malloy"
271
+ }
181
272
  },
182
273
  "endCaptures": {
183
- "0": { "name": "support.type.property-name.json" }
274
+ "1": {
275
+ "name": "punctuation.definition.annotation.end.malloy"
276
+ }
184
277
  },
185
- "name": "comment.line.double-slash",
186
- "patterns": [{ "include": "#tag-values" }]
187
- },
188
- {
189
- "match": "##\\n",
190
- "name": "string.quoted",
191
- "captures": {
192
- "0": { "name": "string.quoted" }
193
- }
278
+ "name": "meta.annotation.block.malloy",
279
+ "patterns": [
280
+ {
281
+ "include": "#tag-content"
282
+ }
283
+ ]
194
284
  },
195
285
  {
196
- "begin": "#\"",
197
- "end": "\\n",
286
+ "begin": "^([ \\t]*)(#\\|(?:\"|\\([^\\s)]*\\)|<[^\\s>]*>|\\[[^\\s\\]]*\\]|\\{[^\\s}]*\\}))",
287
+ "end": "^\\1(\\|#)(?!#)",
198
288
  "beginCaptures": {
199
- "0": { "name": "punctuation.definition.comment" }
289
+ "2": {
290
+ "name": "punctuation.definition.annotation.begin.malloy"
291
+ }
200
292
  },
201
- "name": "comment.line.double-slash"
202
- },
203
- {
204
- "match": "#\\n",
205
- "name": "string.quoted",
206
- "captures": {
207
- "0": { "name": "string.quoted" }
208
- }
293
+ "endCaptures": {
294
+ "1": {
295
+ "name": "punctuation.definition.annotation.end.malloy"
296
+ }
297
+ },
298
+ "name": "comment.block.documentation.malloy"
209
299
  },
210
300
  {
211
- "begin": "#\\s",
212
- "end": "\\n",
301
+ "begin": "^([ \\t]*)(#\\|)(?!(?:\"|\\([^\\s)]*\\)|<[^\\s>]*>|\\[[^\\s\\]]*\\]|\\{[^\\s}]*\\}))",
302
+ "end": "^\\1(\\|#)(?!#)",
213
303
  "beginCaptures": {
214
- "0": { "name": "support.type.property-name.json" }
304
+ "2": {
305
+ "name": "punctuation.definition.annotation.begin.malloy"
306
+ }
215
307
  },
216
- "name": "comment.line.double-slash",
217
- "patterns": [{ "include": "#tag-values" }]
308
+ "endCaptures": {
309
+ "1": {
310
+ "name": "punctuation.definition.annotation.end.malloy"
311
+ }
312
+ },
313
+ "name": "meta.annotation.block.malloy",
314
+ "patterns": [
315
+ {
316
+ "include": "#tag-content"
317
+ }
318
+ ]
218
319
  },
219
320
  {
220
- "begin": "##\\s",
221
- "end": "\\n",
321
+ "begin": "(##?(?:\"|\\([^\\s)]*\\)|<[^\\s>]*>|\\[[^\\s\\]]*\\]|\\{[^\\s}]*\\}))",
322
+ "end": "$",
222
323
  "beginCaptures": {
223
- "0": { "name": "support.type.property-name.json" }
324
+ "1": {
325
+ "name": "punctuation.definition.annotation.malloy"
326
+ }
224
327
  },
225
- "name": "comment.line.double-slash",
226
- "patterns": [{ "include": "#tag-values" }]
328
+ "name": "comment.line.documentation.malloy"
227
329
  },
228
330
  {
229
- "begin": "#",
230
- "end": "\\n",
331
+ "begin": "(##?)(?![|\"(\\[<{])",
332
+ "end": "$",
231
333
  "beginCaptures": {
232
- "0": { "name": "string.quoted" }
334
+ "1": {
335
+ "name": "punctuation.definition.annotation.malloy"
336
+ }
233
337
  },
234
- "name": "string.quoted"
338
+ "name": "meta.annotation.line.malloy",
339
+ "patterns": [
340
+ {
341
+ "include": "#tag-content"
342
+ }
343
+ ]
235
344
  }
236
345
  ],
237
346
  "repository": {
238
- "tag-values": {
239
- "name": "support.type.property-name.json",
240
- "match": "(-)?((?:[^\\s=#]+)|(?:\"[^#]+\"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:\"[^#]+\")))?",
241
- "captures": {
242
- "1": { "name": "keyword.control.negate" },
243
- "2": { "name": "support.type.property-name.json" },
244
- "3": { "name": "keyword.operator.comparison.ts" },
245
- "4": { "name": "string.quoted" }
246
- }
347
+ "tag-content": {
348
+ "patterns": [
349
+ {
350
+ "match": "\"[^\"#]*\"",
351
+ "name": "string.quoted.double.malloy"
352
+ },
353
+ {
354
+ "match": "=",
355
+ "name": "keyword.operator.assignment.malloy"
356
+ },
357
+ {
358
+ "match": "-(?=[A-Za-z_])",
359
+ "name": "keyword.operator.negation.malloy"
360
+ },
361
+ {
362
+ "match": "[0-9][A-Za-z_0-9.]*",
363
+ "name": "constant.numeric.malloy"
364
+ },
365
+ {
366
+ "match": "[A-Za-z_][A-Za-z_0-9.]*",
367
+ "name": "entity.name.tag.malloy"
368
+ }
369
+ ]
247
370
  }
248
371
  }
249
372
  },
250
373
  "strings": {
374
+ "comment": "Order matters: f-/s-/r- prefixed forms begin one char earlier than a bare quote so they win by start position; among same-start ties the triple forms are listed before the single/double forms. Filter (f...) and raw (s...) bodies are opaque in v1 — no inner patterns. The bare triple string has NO interpolation pattern, so %{ } inside it stays plain string text (interpolation is only legal inside .sql(), handled by #sql-string).",
251
375
  "patterns": [
252
376
  {
253
- "begin": "'",
377
+ "begin": "(?i)\\bf'''",
378
+ "end": "'''",
379
+ "name": "string.quoted.filter.malloy"
380
+ },
381
+ {
382
+ "begin": "(?i)\\bf\"\"\"",
383
+ "end": "\"\"\"",
384
+ "name": "string.quoted.filter.malloy"
385
+ },
386
+ {
387
+ "begin": "(?i)\\bf'",
254
388
  "end": "'",
389
+ "name": "string.quoted.filter.malloy"
390
+ },
391
+ {
392
+ "begin": "(?i)\\bf\"",
393
+ "end": "\"",
394
+ "name": "string.quoted.filter.malloy"
395
+ },
396
+ {
397
+ "begin": "(?i)\\bf`",
398
+ "end": "`",
399
+ "name": "string.quoted.filter.malloy"
400
+ },
401
+ {
402
+ "begin": "(?i)\\bs'",
403
+ "end": "'",
404
+ "name": "string.quoted.raw.single.malloy"
405
+ },
406
+ {
407
+ "begin": "(?i)\\bs\"",
408
+ "end": "\"",
409
+ "name": "string.quoted.raw.double.malloy"
410
+ },
411
+ {
412
+ "begin": "(?i)[r/]'",
413
+ "end": "'",
414
+ "name": "string.regexp.malloy",
415
+ "patterns": [
416
+ {
417
+ "include": "#regex-escapes"
418
+ }
419
+ ]
420
+ },
421
+ {
422
+ "begin": "\"\"\"",
423
+ "end": "\"\"\"",
255
424
  "beginCaptures": {
256
- "0": { "name": "punctuation.definition.string.begin" }
425
+ "0": {
426
+ "name": "punctuation.definition.string.begin.malloy"
427
+ }
257
428
  },
258
429
  "endCaptures": {
259
- "0": { "name": "punctuation.definition.string.end" }
430
+ "0": {
431
+ "name": "punctuation.definition.string.end.malloy"
432
+ }
260
433
  },
261
- "name": "string.quoted.single",
262
- "patterns": [{ "include": "#escapes" }]
434
+ "name": "string.quoted.triple.malloy"
263
435
  },
264
436
  {
265
- "begin": "\"",
266
- "end": "\"",
437
+ "begin": "'",
438
+ "end": "'",
267
439
  "beginCaptures": {
268
- "0": { "name": "punctuation.definition.string.begin" }
440
+ "0": {
441
+ "name": "punctuation.definition.string.begin.malloy"
442
+ }
269
443
  },
270
444
  "endCaptures": {
271
- "0": { "name": "punctuation.definition.string.end" }
445
+ "0": {
446
+ "name": "punctuation.definition.string.end.malloy"
447
+ }
272
448
  },
273
- "name": "string.quoted.double",
274
- "patterns": [{ "include": "#escapes" }]
449
+ "name": "string.quoted.single.malloy",
450
+ "patterns": [
451
+ {
452
+ "include": "#escapes"
453
+ }
454
+ ]
275
455
  },
276
456
  {
277
- "begin": "\"\"\"",
278
- "end": "\"\"\"",
457
+ "begin": "\"",
458
+ "end": "\"",
279
459
  "beginCaptures": {
280
- "0": { "name": "punctuation.definition.string.begin" }
460
+ "0": {
461
+ "name": "punctuation.definition.string.begin.malloy"
462
+ }
281
463
  },
282
464
  "endCaptures": {
283
- "0": { "name": "punctuation.definition.string.end" }
465
+ "0": {
466
+ "name": "punctuation.definition.string.end.malloy"
467
+ }
284
468
  },
285
- "name": "string.quoted.triple"
286
- },
287
- {
288
- "begin": "(?i)[r/]'",
289
- "end": "'",
290
- "name": "string.regexp",
291
- "patterns": [{ "include": "#regex-escapes" }]
469
+ "name": "string.quoted.double.malloy",
470
+ "patterns": [
471
+ {
472
+ "include": "#escapes"
473
+ }
474
+ ]
292
475
  }
293
476
  ],
294
477
  "repository": {
@@ -296,14 +479,18 @@
296
479
  "name": "constant.character.escape",
297
480
  "match": "\\\\(u[A-Fa-f0-9]{4}|.)",
298
481
  "captures": {
299
- "0": { "name": "constant.character.escape" }
482
+ "0": {
483
+ "name": "constant.character.escape"
484
+ }
300
485
  }
301
486
  },
302
487
  "regex-escapes": {
303
488
  "name": "constant.character.escape",
304
489
  "match": "\\\\.",
305
490
  "captures": {
306
- "0": { "name": "constant.character.escape" }
491
+ "0": {
492
+ "name": "constant.character.escape"
493
+ }
307
494
  }
308
495
  }
309
496
  }
@@ -315,324 +502,41 @@
315
502
  "constants": {
316
503
  "patterns": [
317
504
  {
318
- "match": "(?i)\\bnull\\b",
319
- "name": "constant.language.null"
320
- },
321
- {
322
- "match": "(?i)\\btrue\\b",
323
- "name": "constant.language.true"
505
+ "match": "(?i)\\b(false|now|null|true)\\b",
506
+ "name": "constant.language.malloy"
324
507
  },
325
508
  {
326
- "match": "(?i)\\bfalse\\b",
327
- "name": "constant.language.false"
509
+ "match": "(?i)\\bthis\\b",
510
+ "name": "variable.language.malloy"
328
511
  }
329
512
  ]
330
513
  },
331
514
  "types": {
332
515
  "patterns": [
333
516
  {
334
- "match": "(?i)\\bstring\\b",
335
- "name": "entity.name.type.string"
336
- },
337
- {
338
- "match": "(?i)\\bnumber\\b",
339
- "name": "entity.name.type.number"
340
- },
341
- {
342
- "match": "(?i)\\bdate\\b",
343
- "name": "entity.name.type.date"
344
- },
345
- {
346
- "match": "(?i)\\btimestamptz\\b",
347
- "name": "entity.name.type.timestamptz"
348
- },
349
- {
350
- "match": "(?i)\\btimestamp\\b",
351
- "name": "entity.name.type.timestamp"
352
- },
353
- {
354
- "match": "(?i)\\bboolean\\b",
355
- "name": "entity.name.type.boolean"
517
+ "match": "(?i)\\b(boolean|date|json|number|string|timestamp|timestamptz)\\b",
518
+ "name": "storage.type.malloy"
356
519
  }
357
520
  ]
358
521
  },
359
522
  "properties": {
523
+ "comment": "Two buckets, both keyword.control.malloy. Colon-keywords (the lexer tokens that REQUIRE a trailing ':') only highlight in keyword position via a (?=:) lookahead — so a field named `query`/`index`/`sample` is NOT mis-colored, and the ':' itself stays uncolored. No \\s* before the ':' on purpose (mtoy is killing the lexer's SPACE* allowance; don't replicate it). Bare keywords (incl. dual-form extend/internal/private/public/source) match anywhere, matching their bare lexer tokens.",
360
524
  "patterns": [
361
525
  {
362
- "match": "(?i)\\baccept\\b",
363
- "name": "keyword.control.accept"
364
- },
365
- {
366
- "match": "(?i)\\bselect\\b",
367
- "name": "keyword.control.select"
368
- },
369
- {
370
- "match": "(?i)\\bconnection\\b",
371
- "name": "keyword.control.connection"
372
- },
373
- {
374
- "match": "(?i)\\brun\\b",
375
- "name": "keyword.control.run"
376
- },
377
- {
378
- "match": "(?i)\\bextend\\b",
379
- "name": "keyword.control.extend"
380
- },
381
- {
382
- "match": "(?i)\\brefine\\b",
383
- "name": "keyword.control.refine"
384
- },
385
- {
386
- "match": "(?i)\\baggregate\\b",
387
- "name": "keyword.control.aggregate"
388
- },
389
- {
390
- "match": "(?i)\\bsample\\b",
391
- "name": "keyword.control.sample"
392
- },
393
- {
394
- "match": "(?i)\\bcalculate\\b",
395
- "name": "keyword.control.calculate"
396
- },
397
- {
398
- "match": "(?i)\\btimezone\\b",
399
- "name": "keyword.control.timezone"
400
- },
401
- {
402
- "match": "(?i)\\bdimension\\b",
403
- "name": "keyword.control.dimension"
404
- },
405
- {
406
- "match": "(?i)\\bexcept\\b",
407
- "name": "keyword.control.except"
408
- },
409
- {
410
- "match": "(?i)\\bsource\\b",
411
- "name": "keyword.control.source"
412
- },
413
- {
414
- "match": "(?i)\\bgroup_by\\b",
415
- "name": "keyword.control.group_by"
416
- },
417
- {
418
- "match": "(?i)\\bdrill\\b",
419
- "name": "keyword.control.drill"
420
- },
421
- {
422
- "match": "(?i)\\bgrouped_by\\b",
423
- "name": "keyword.control.grouped_by"
424
- },
425
- {
426
- "match": "(?i)\\bhaving\\b",
427
- "name": "keyword.control.having"
428
- },
429
- {
430
- "match": "(?i)\\bindex\\b",
431
- "name": "keyword.control.index"
432
- },
433
- {
434
- "match": "(?i)\\bjoin_one\\b",
435
- "name": "keyword.control.join_one"
436
- },
437
- {
438
- "match": "(?i)\\bwith\\b",
439
- "name": "keyword.control.with"
440
- },
441
- {
442
- "match": "(?i)\\bjoin_many\\b",
443
- "name": "keyword.control.join_many"
444
- },
445
- {
446
- "match": "(?i)\\bjoin_cross\\b",
447
- "name": "keyword.control.join_cross"
448
- },
449
- {
450
- "match": "(?i)\\blimit\\b",
451
- "name": "keyword.control.limit"
452
- },
453
- {
454
- "match": "(?i)\\bmeasure\\b",
455
- "name": "keyword.control.measure"
456
- },
457
- {
458
- "match": "(?i)\\bnest\\b",
459
- "name": "keyword.control.nest"
460
- },
461
- {
462
- "match": "(?i)\\border_by\\b",
463
- "name": "keyword.control.order_by"
464
- },
465
- {
466
- "match": "(?i)\\bpartition_by\\b",
467
- "name": "keyword.control.partition_by"
468
- },
469
- {
470
- "match": "(?i)\\bprimary_key\\b",
471
- "name": "keyword.control.primary_key"
472
- },
473
- {
474
- "match": "(?i)\\bproject\\b",
475
- "name": "keyword.control.project"
476
- },
477
- {
478
- "match": "(?i)\\bquery\\b",
479
- "name": "keyword.control.query"
480
- },
481
- {
482
- "match": "(?i)\\brename\\b",
483
- "name": "keyword.control.rename"
484
- },
485
- {
486
- "match": "(?i)\\btop\\b",
487
- "name": "keyword.control.top"
488
- },
489
- {
490
- "match": "(?i)\\bview\\b",
491
- "name": "keyword.control.view"
492
- },
493
- {
494
- "match": "(?i)\\bwhere\\b",
495
- "name": "keyword.control.where"
496
- },
497
- {
498
- "match": "(?i)\\bdeclare\\b",
499
- "name": "keyword.control.declare"
500
- },
501
- {
502
- "match": "(?i)\\btype\\b",
503
- "name": "keyword.control.type"
526
+ "match": "(?i)\\b(accept|aggregate|calculate|calculation|connection|declare|dimension|drill|except|given|group_by|grouped_by|having|index|join_cross|join_many|join_one|limit|measure|nest|order_by|partition_by|primary_key|query|rename|run|sample|select|timezone|top|type|view|where)(?=:)",
527
+ "name": "keyword.control.malloy"
504
528
  },
505
529
  {
506
- "match": "(?i)\\bgiven\\b",
507
- "name": "keyword.control.given"
530
+ "match": "(?i)\\b(as|asc|by|case|desc|distinct|else|end|export|extend|filter|from|full|has|import|include|inner|internal|is|left|on|pick|private|public|right|source|then|when|with)\\b",
531
+ "name": "keyword.control.malloy"
508
532
  }
509
533
  ]
510
534
  },
511
535
  "keywords": {
512
536
  "patterns": [
513
537
  {
514
- "match": "(?i)\\bis\\b",
515
- "name": "keyword.control.is"
516
- },
517
- {
518
- "match": "(?i)\\bon\\b",
519
- "name": "keyword.control.on"
520
- },
521
- {
522
- "match": "(?i)\\bnot\\b",
523
- "name": "keyword.other.not"
524
- },
525
- {
526
- "match": "(?i)\\bor\\b",
527
- "name": "keyword.other.or"
528
- },
529
- {
530
- "match": "(?i)\\bdesc\\b",
531
- "name": "keyword.control.desc"
532
- },
533
- {
534
- "match": "(?i)\\bby\\b",
535
- "name": "keyword.control.by"
536
- },
537
- {
538
- "match": "(?i)\\band\\b",
539
- "name": "keyword.other.and"
540
- },
541
- {
542
- "match": "(?i)\\basc\\b",
543
- "name": "keyword.control.asc"
544
- },
545
- {
546
- "match": "(?i)\\bfor\\b",
547
- "name": "keyword.other.for"
548
- },
549
- {
550
- "match": "(?i)\\belse\\b",
551
- "name": "keyword.other.else"
552
- },
553
- {
554
- "match": "(?i)\\bto\\b",
555
- "name": "keyword.other.to"
556
- },
557
- {
558
- "match": "(?i)\\bwhen\\b",
559
- "name": "keyword.other.when"
560
- },
561
- {
562
- "match": "(?i)\\bpick\\b",
563
- "name": "keyword.other.pick"
564
- },
565
- {
566
- "match": "(?i)\\bimport\\b",
567
- "name": "keyword.control.import"
568
- },
569
- {
570
- "match": "(?i)\\binternal\\b",
571
- "name": "keyword.control.internal"
572
- },
573
- {
574
- "match": "(?i)\\bpublic\\b",
575
- "name": "keyword.control.public"
576
- },
577
- {
578
- "match": "(?i)\\bprivate\\b",
579
- "name": "keyword.control.private"
580
- },
581
- {
582
- "match": "(?i)\\binclude\\b",
583
- "name": "keyword.control.include"
584
- },
585
- {
586
- "match": "(?i)\\bas\\b",
587
- "name": "keyword.control.as"
588
- },
589
- {
590
- "match": "(?i)\\bfrom\\b",
591
- "name": "keyword.control.from"
592
- },
593
- {
594
- "match": "(?i)\\bexport\\b",
595
- "name": "keyword.control.export"
596
- },
597
- {
598
- "match": "(?i)\\bcase\\b",
599
- "name": "keyword.control.case"
600
- },
601
- {
602
- "match": "(?i)\\bthen\\b",
603
- "name": "keyword.control.then"
604
- },
605
- {
606
- "match": "(?i)\\bend\\b",
607
- "name": "keyword.control.end"
608
- },
609
- {
610
- "match": "(?i)\\bfilter\\b",
611
- "name": "keyword.control.filter"
612
- },
613
- {
614
- "match": "(?i)\\bin\\b",
615
- "name": "keyword.other.in"
616
- },
617
- {
618
- "match": "(?i)\\blike\\b",
619
- "name": "keyword.other.like"
620
- },
621
- {
622
- "match": "(?i)\\binner\\b",
623
- "name": "keyword.other.inner"
624
- },
625
- {
626
- "match": "(?i)\\bleft\\b",
627
- "name": "keyword.other.left"
628
- },
629
- {
630
- "match": "(?i)\\bright\\b",
631
- "name": "keyword.other.right"
632
- },
633
- {
634
- "match": "(?i)\\bfull\\b",
635
- "name": "keyword.other.full"
538
+ "match": "(?i)\\b(and|for|in|like|not|or|to)\\b",
539
+ "name": "keyword.operator.malloy"
636
540
  }
637
541
  ]
638
542
  }