@malloydata/syntax-highlight 0.0.82-dev230912235413
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/README.md +7 -0
- package/grammars/malloy/malloy-language.json +26 -0
- package/grammars/malloy/malloy.tmGrammar.json +540 -0
- package/grammars/malloy-notebook/malloy-notebook-language.json +34 -0
- package/grammars/malloy-notebook/malloy-notebook.tmGrammar.json +31 -0
- package/grammars/malloy-sql/malloy-sql-language.json +33 -0
- package/grammars/malloy-sql/malloy-sql.tmGrammar.json +64 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Malloy Syntax Highlighting
|
|
2
|
+
|
|
3
|
+
Malloy is an experimental language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently supports BigQuery and Postgres, as well as querying Parquet and CSV files via DuckDB.
|
|
4
|
+
|
|
5
|
+
Currently, two other dialects of Malloy are supported in addition to the standard syntax used in `.malloy` files: the Malloy notebook format (`.malloynb`) and Malloy SQL (`.malloysql`). The purpose of this `npm` package is to mitigate syncing issues across `@malloydata` repositories that depend upon syntax highlight files and to make these assets more easily available for future integrations.
|
|
6
|
+
|
|
7
|
+
This `npm` package does not include the source files used to develop these syntax highlighting files. If you are interested in using the existing infrastructure to modify, test, or generate these grammar files, please refer to the [malloy monorepo](https://github.com/malloydata/malloy/tree/main/packages/malloy-syntax-highlight) and see `DEVELOPING.md` for steps to do so.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comments": {
|
|
3
|
+
"lineComment": "//",
|
|
4
|
+
"blockComment": ["/*", "*/"]
|
|
5
|
+
},
|
|
6
|
+
"brackets": [
|
|
7
|
+
["{", "}"],
|
|
8
|
+
["[", "]"],
|
|
9
|
+
["(", ")"]
|
|
10
|
+
],
|
|
11
|
+
"autoClosingPairs": [
|
|
12
|
+
{ "open": "{", "close": "}" },
|
|
13
|
+
{ "open": "[", "close": "]" },
|
|
14
|
+
{ "open": "(", "close": ")" },
|
|
15
|
+
{ "open": "\"", "close": "\"", "notIn": ["string"] },
|
|
16
|
+
{ "open": "'", "close": "'" },
|
|
17
|
+
{ "open": "/*", "close": " */", "notIn": ["string"] }
|
|
18
|
+
],
|
|
19
|
+
"surroundingPairs": [
|
|
20
|
+
{ "open": "{", "close": "}" },
|
|
21
|
+
{ "open": "[", "close": "]" },
|
|
22
|
+
{ "open": "(", "close": ")" },
|
|
23
|
+
{ "open": "\"", "close": "\"" },
|
|
24
|
+
{ "open": "'", "close": "'" }
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scopeName": "source.malloy",
|
|
3
|
+
"patterns": [{ "include": "#malloy-language" }],
|
|
4
|
+
"repository": {
|
|
5
|
+
"malloy-language": {
|
|
6
|
+
"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" }
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"malloy-matched": {
|
|
24
|
+
"begin": "{",
|
|
25
|
+
"end": "}",
|
|
26
|
+
"patterns": [
|
|
27
|
+
{ "include": "#malloy-matched" },
|
|
28
|
+
{ "include": "#malloy-language" }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"malloy-in-sql": {
|
|
32
|
+
"begin": "%{",
|
|
33
|
+
"name": "source.malloy-in-sql",
|
|
34
|
+
"end": "}%?",
|
|
35
|
+
"patterns": [
|
|
36
|
+
{ "include": "#malloy-matched" },
|
|
37
|
+
{ "include": "#malloy-language" }
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"sql-string": {
|
|
41
|
+
"patterns": [
|
|
42
|
+
{
|
|
43
|
+
"begin": "\\b(select)(\\s*:\\s*)(\"\"\")",
|
|
44
|
+
"end": "\"\"\"",
|
|
45
|
+
"beginCaptures": {
|
|
46
|
+
"1": { "name": "keyword.control.select" },
|
|
47
|
+
"3": { "name": "punctuation.sql-block.open" }
|
|
48
|
+
},
|
|
49
|
+
"endCaptures": {
|
|
50
|
+
"0": { "name": "punctuation.sql-block.close" }
|
|
51
|
+
},
|
|
52
|
+
"name": "source.sql",
|
|
53
|
+
"patterns": [
|
|
54
|
+
{ "include": "#malloy-in-sql" },
|
|
55
|
+
{ "include": "source.sql" }
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"begin": "(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(\"\"\")",
|
|
60
|
+
"end": "\"\"\"",
|
|
61
|
+
"beginCaptures": {
|
|
62
|
+
"1": { "name": "variable.other" },
|
|
63
|
+
"3": { "name": "keyword.control.sql" },
|
|
64
|
+
"5": { "name": "punctuation.sql-block.open" }
|
|
65
|
+
},
|
|
66
|
+
"endCaptures": {
|
|
67
|
+
"0": { "name": "punctuation.sql-block.close" }
|
|
68
|
+
},
|
|
69
|
+
"name": "source.sql",
|
|
70
|
+
"patterns": [
|
|
71
|
+
{ "include": "#malloy-in-sql" },
|
|
72
|
+
{ "include": "source.sql" }
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"functions": {
|
|
78
|
+
"patterns": [
|
|
79
|
+
{
|
|
80
|
+
"match": "(?i)\\b(count)(\\s*\\()(distinct)",
|
|
81
|
+
"captures": {
|
|
82
|
+
"1": { "name": "entity.name.function" },
|
|
83
|
+
"3": { "name": "entity.name.function.modifier" }
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"match": "(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|TABLE|FROM|FROM_SQL|UNGROUPED)(\\s*\\()",
|
|
88
|
+
"captures": {
|
|
89
|
+
"1": { "name": "entity.name.function" }
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"match": "(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",
|
|
94
|
+
"captures": {
|
|
95
|
+
"1": { "name": "entity.name.function" }
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"match": "(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",
|
|
100
|
+
"captures": {
|
|
101
|
+
"1": { "name": "entity.name.function" },
|
|
102
|
+
"3": { "name": "entity.name.type" }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"datetimes": {
|
|
108
|
+
"patterns": [
|
|
109
|
+
{
|
|
110
|
+
"match": "(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",
|
|
111
|
+
"name": "constant.numeric.timestamp"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"match": "(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",
|
|
115
|
+
"name": "constant.numeric.date"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"identifiers-quoted": {
|
|
120
|
+
"patterns": [
|
|
121
|
+
{
|
|
122
|
+
"match": "`[^`]*`",
|
|
123
|
+
"name": "variable.other.quoted"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"identifiers-unquoted": {
|
|
128
|
+
"patterns": [
|
|
129
|
+
{
|
|
130
|
+
"match": "(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",
|
|
131
|
+
"name": "variable.other"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"timeframes": {
|
|
136
|
+
"patterns": [
|
|
137
|
+
{
|
|
138
|
+
"match": "(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",
|
|
139
|
+
"name": "keyword.other.timeframe"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"match": "(?i)\\b(day_of_year|day_of_month)\\b",
|
|
143
|
+
"name": "keyword.other.timeframe"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"comments": {
|
|
148
|
+
"patterns": [
|
|
149
|
+
{
|
|
150
|
+
"begin": "/\\*",
|
|
151
|
+
"end": "\\*/",
|
|
152
|
+
"beginCaptures": {
|
|
153
|
+
"0": { "name": "punctuation.definition.comment.begin" }
|
|
154
|
+
},
|
|
155
|
+
"endCaptures": {
|
|
156
|
+
"0": { "name": "punctuation.definition.comment.end" }
|
|
157
|
+
},
|
|
158
|
+
"name": "comment.block"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"begin": "//",
|
|
162
|
+
"end": "\\n",
|
|
163
|
+
"beginCaptures": {
|
|
164
|
+
"0": { "name": "punctuation.definition.comment" }
|
|
165
|
+
},
|
|
166
|
+
"name": "comment.line.double-slash"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"begin": "--",
|
|
170
|
+
"end": "\\n",
|
|
171
|
+
"beginCaptures": {
|
|
172
|
+
"0": { "name": "punctuation.definition.comment" }
|
|
173
|
+
},
|
|
174
|
+
"name": "comment.line.double-hyphen"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"tags": {
|
|
179
|
+
"patterns": [
|
|
180
|
+
{
|
|
181
|
+
"match": "##\\n",
|
|
182
|
+
"name": "string.quoted",
|
|
183
|
+
"captures": {
|
|
184
|
+
"0": { "name": "string.quoted" }
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"begin": "#\"",
|
|
189
|
+
"end": "\\n",
|
|
190
|
+
"beginCaptures": {
|
|
191
|
+
"0": { "name": "punctuation.definition.comment" }
|
|
192
|
+
},
|
|
193
|
+
"name": "comment.line.double-slash"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"match": "#\\n",
|
|
197
|
+
"name": "string.quoted",
|
|
198
|
+
"captures": {
|
|
199
|
+
"0": { "name": "string.quoted" }
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"begin": "#\\s",
|
|
204
|
+
"end": "\\n",
|
|
205
|
+
"beginCaptures": {
|
|
206
|
+
"0": { "name": "support.type.property-name.json" }
|
|
207
|
+
},
|
|
208
|
+
"name": "comment.line.double-slash",
|
|
209
|
+
"patterns": [{ "include": "#tag-values" }]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"begin": "##\\s",
|
|
213
|
+
"end": "\\n",
|
|
214
|
+
"beginCaptures": {
|
|
215
|
+
"0": { "name": "support.type.property-name.json" }
|
|
216
|
+
},
|
|
217
|
+
"name": "comment.line.double-slash",
|
|
218
|
+
"patterns": [{ "include": "#tag-values" }]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"begin": "#",
|
|
222
|
+
"end": "\\n",
|
|
223
|
+
"beginCaptures": {
|
|
224
|
+
"0": { "name": "string.quoted" }
|
|
225
|
+
},
|
|
226
|
+
"name": "string.quoted"
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"repository": {
|
|
230
|
+
"tag-values": {
|
|
231
|
+
"name": "support.type.property-name.json",
|
|
232
|
+
"match": "(-)?((?:[^\\s=#]+)|(?:\"[^#]+\"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:\"[^#]+\")))?",
|
|
233
|
+
"captures": {
|
|
234
|
+
"1": { "name": "keyword.control.negate" },
|
|
235
|
+
"2": { "name": "support.type.property-name.json" },
|
|
236
|
+
"3": { "name": "keyword.operator.comparison.ts" },
|
|
237
|
+
"4": { "name": "string.quoted" }
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"strings": {
|
|
243
|
+
"patterns": [
|
|
244
|
+
{
|
|
245
|
+
"begin": "'",
|
|
246
|
+
"end": "'",
|
|
247
|
+
"beginCaptures": {
|
|
248
|
+
"0": { "name": "punctuation.definition.string.begin" }
|
|
249
|
+
},
|
|
250
|
+
"endCaptures": {
|
|
251
|
+
"0": { "name": "punctuation.definition.string.end" }
|
|
252
|
+
},
|
|
253
|
+
"name": "string.quoted.single",
|
|
254
|
+
"patterns": [{ "include": "#escapes" }]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"begin": "\"",
|
|
258
|
+
"end": "\"",
|
|
259
|
+
"beginCaptures": {
|
|
260
|
+
"0": { "name": "punctuation.definition.string.begin" }
|
|
261
|
+
},
|
|
262
|
+
"endCaptures": {
|
|
263
|
+
"0": { "name": "punctuation.definition.string.end" }
|
|
264
|
+
},
|
|
265
|
+
"name": "string.quoted.double",
|
|
266
|
+
"patterns": [{ "include": "#escapes" }]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"begin": "\"\"\"",
|
|
270
|
+
"end": "\"\"\"",
|
|
271
|
+
"beginCaptures": {
|
|
272
|
+
"0": { "name": "punctuation.definition.string.begin" }
|
|
273
|
+
},
|
|
274
|
+
"endCaptures": {
|
|
275
|
+
"0": { "name": "punctuation.definition.string.end" }
|
|
276
|
+
},
|
|
277
|
+
"name": "string.quoted.triple"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"begin": "(?i)[r|/]'",
|
|
281
|
+
"end": "'",
|
|
282
|
+
"name": "string.regexp",
|
|
283
|
+
"patterns": [{ "include": "#regex-escapes" }]
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"repository": {
|
|
287
|
+
"escapes": {
|
|
288
|
+
"name": "constant.character.escape",
|
|
289
|
+
"match": "\\\\(u[A-Fa-f0-9]{4}|.)",
|
|
290
|
+
"captures": {
|
|
291
|
+
"0": { "name": "constant.character.escape" }
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"regex-escapes": {
|
|
295
|
+
"name": "constant.character.escape",
|
|
296
|
+
"match": "\\\\.",
|
|
297
|
+
"captures": {
|
|
298
|
+
"0": { "name": "constant.character.escape" }
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"numbers": {
|
|
304
|
+
"match": "(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",
|
|
305
|
+
"name": "constant.numeric"
|
|
306
|
+
},
|
|
307
|
+
"constants": {
|
|
308
|
+
"patterns": [
|
|
309
|
+
{
|
|
310
|
+
"match": "(?i)\\bnull\\b",
|
|
311
|
+
"name": "constant.language.null"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"match": "(?i)\\btrue\\b",
|
|
315
|
+
"name": "constant.language.true"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"match": "(?i)\\bfalse\\b",
|
|
319
|
+
"name": "constant.language.false"
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
},
|
|
323
|
+
"types": {
|
|
324
|
+
"patterns": [
|
|
325
|
+
{
|
|
326
|
+
"match": "(?i)\\bstring\\b",
|
|
327
|
+
"name": "entity.name.type.string"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"match": "(?i)\\bnumber\\b",
|
|
331
|
+
"name": "entity.name.type.number"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"match": "(?i)\\bdate\\b",
|
|
335
|
+
"name": "entity.name.type.date"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"match": "(?i)\\btimestamp\\b",
|
|
339
|
+
"name": "entity.name.type.timestamp"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"match": "(?i)\\bboolean\\b",
|
|
343
|
+
"name": "entity.name.type.boolean"
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
"properties": {
|
|
348
|
+
"patterns": [
|
|
349
|
+
{
|
|
350
|
+
"match": "(?i)\\baccept\\b",
|
|
351
|
+
"name": "keyword.control.accept"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"match": "(?i)\\bsql\\b",
|
|
355
|
+
"name": "keyword.control.sql"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"match": "(?i)\\bselect\\b",
|
|
359
|
+
"name": "keyword.control.select"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"match": "(?i)\\bconnection\\b",
|
|
363
|
+
"name": "keyword.control.connection"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"match": "(?i)\\brun\\b",
|
|
367
|
+
"name": "keyword"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"match": "(?i)\\bextend\\b",
|
|
371
|
+
"name": "keyword.control.extend"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"match": "(?i)\\brefine\\b",
|
|
375
|
+
"name": "keyword.control.refine"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"match": "(?i)\\baggregate\\b",
|
|
379
|
+
"name": "keyword.control.aggregate"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"match": "(?i)\\bsample\\b",
|
|
383
|
+
"name": "keyword.control.sample"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"match": "(?i)\\bcalculate\\b",
|
|
387
|
+
"name": "keyword.control.calculate"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"match": "(?i)\\btimezone\\b",
|
|
391
|
+
"name": "keyword.control.timezone"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"match": "(?i)\\bdimension\\b",
|
|
395
|
+
"name": "keyword.control.dimension"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"match": "(?i)\\bexcept\\b",
|
|
399
|
+
"name": "keyword.control.except"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"match": "(?i)\\bsource\\b",
|
|
403
|
+
"name": "keyword.control.source"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"match": "(?i)\\bgroup_by\\b",
|
|
407
|
+
"name": "keyword.control.group_by"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"match": "(?i)\\bhaving\\b",
|
|
411
|
+
"name": "keyword.control.having"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"match": "(?i)\\bindex\\b",
|
|
415
|
+
"name": "keyword.control.index"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"match": "(?i)\\bjoin_one\\b",
|
|
419
|
+
"name": "keyword.control.join_one"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"match": "(?i)\\bwith\\b",
|
|
423
|
+
"name": "keyword.control.with"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"match": "(?i)\\bjoin_many\\b",
|
|
427
|
+
"name": "keyword.control.join_many"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"match": "(?i)\\bjoin_cross\\b",
|
|
431
|
+
"name": "keyword.control.join_cross"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"match": "(?i)\\blimit\\b",
|
|
435
|
+
"name": "keyword.control.limit"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"match": "(?i)\\bmeasure\\b",
|
|
439
|
+
"name": "keyword.control.measure"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"match": "(?i)\\bnest\\b",
|
|
443
|
+
"name": "keyword.control.nest"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"match": "(?i)\\border_by\\b",
|
|
447
|
+
"name": "keyword.control.order_by"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"match": "(?i)\\bprimary_key\\b",
|
|
451
|
+
"name": "keyword.control.primary_key"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"match": "(?i)\\bproject\\b",
|
|
455
|
+
"name": "keyword.control.project"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"match": "(?i)\\bquery\\b",
|
|
459
|
+
"name": "keyword.control.query"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"match": "(?i)\\brename\\b",
|
|
463
|
+
"name": "keyword.control.rename"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"match": "(?i)\\btop\\b",
|
|
467
|
+
"name": "keyword.control.top"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"match": "(?i)\\bwhere\\b",
|
|
471
|
+
"name": "keyword.control.where"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"match": "(?i)\\bdeclare\\b",
|
|
475
|
+
"name": "keyword.control.declare"
|
|
476
|
+
}
|
|
477
|
+
]
|
|
478
|
+
},
|
|
479
|
+
"keywords": {
|
|
480
|
+
"patterns": [
|
|
481
|
+
{
|
|
482
|
+
"match": "(?i)\\bis\\b",
|
|
483
|
+
"name": "keyword.control.is"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"match": "(?i)\\bon\\b",
|
|
487
|
+
"name": "keyword.control.on"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"match": "(?i)\\bnot\\b",
|
|
491
|
+
"name": "keyword.other.not"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"match": "(?i)\\bor\\b",
|
|
495
|
+
"name": "keyword.other.or"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"match": "(?i)\\bdesc\\b",
|
|
499
|
+
"name": "keyword.control.desc"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"match": "(?i)\\bby\\b",
|
|
503
|
+
"name": "keyword.control.by"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"match": "(?i)\\band\\b",
|
|
507
|
+
"name": "keyword.other.and"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"match": "(?i)\\basc\\b",
|
|
511
|
+
"name": "keyword.control.asc"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"match": "(?i)\\bfor\\b",
|
|
515
|
+
"name": "keyword.other.for"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"match": "(?i)\\belse\\b",
|
|
519
|
+
"name": "keyword.other.else"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"match": "(?i)\\bto\\b",
|
|
523
|
+
"name": "keyword.other.to"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"match": "(?i)\\bwhen\\b",
|
|
527
|
+
"name": "keyword.other.when"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"match": "(?i)\\bpick\\b",
|
|
531
|
+
"name": "keyword.other.pick"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"match": "(?i)\\bimport\\b",
|
|
535
|
+
"name": "keyword.control.import"
|
|
536
|
+
}
|
|
537
|
+
]
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comments": {
|
|
3
|
+
"lineComment": ["--", "//"],
|
|
4
|
+
"blockComment": ["/*", "*/"]
|
|
5
|
+
},
|
|
6
|
+
"brackets": [
|
|
7
|
+
["{", "}"],
|
|
8
|
+
["[", "]"],
|
|
9
|
+
["(", ")"]
|
|
10
|
+
],
|
|
11
|
+
"autoClosingPairs": [
|
|
12
|
+
["{", "}"],
|
|
13
|
+
["[", "]"],
|
|
14
|
+
["(", ")"],
|
|
15
|
+
{ "open": "\"", "close": "\"", "notIn": ["string"] },
|
|
16
|
+
{ "open": "N'", "close": "'", "notIn": ["string", "comment"] },
|
|
17
|
+
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }
|
|
18
|
+
],
|
|
19
|
+
"surroundingPairs": [
|
|
20
|
+
[">>>", ">>>"],
|
|
21
|
+
["{", "}"],
|
|
22
|
+
["[", "]"],
|
|
23
|
+
["(", ")"],
|
|
24
|
+
["\"", "\""],
|
|
25
|
+
["'", "'"],
|
|
26
|
+
["`", "`"]
|
|
27
|
+
],
|
|
28
|
+
"folding": {
|
|
29
|
+
"markers": {
|
|
30
|
+
"start": "^\\s*--\\s*#region\\b",
|
|
31
|
+
"end": "^\\s*--\\s*#endregion\\b"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Malloy Notebook",
|
|
3
|
+
"scopeName": "source.malloy-notebook",
|
|
4
|
+
"patterns": [
|
|
5
|
+
{ "include": "#comments" },
|
|
6
|
+
{ "include": "#malloysql-malloy" },
|
|
7
|
+
{ "include": "#malloysql-sql" }
|
|
8
|
+
],
|
|
9
|
+
"repository": {
|
|
10
|
+
"malloysql-malloy": {
|
|
11
|
+
"begin": ">>>malloy",
|
|
12
|
+
"end": "(?=>>>)",
|
|
13
|
+
"beginCaptures": {
|
|
14
|
+
"0": { "name": "entity.other.attribute.malloy-sql" }
|
|
15
|
+
},
|
|
16
|
+
"name": "meta.embedded.block.malloysql.malloy",
|
|
17
|
+
"patterns": [{ "include": "source.malloy" }]
|
|
18
|
+
},
|
|
19
|
+
"malloysql-sql": {
|
|
20
|
+
"begin": "(>>>sql)(\\s*connection:.*?(?<!\n)(?<!//))?",
|
|
21
|
+
"end": "(?=>>>)",
|
|
22
|
+
"beginCaptures": {
|
|
23
|
+
"0": { "name": "entity.other.attribute.malloy-sql" },
|
|
24
|
+
"1": { "name": "entity.other.attribute.malloy-sql" },
|
|
25
|
+
"3": { "name": "comment.line.double-slash" }
|
|
26
|
+
},
|
|
27
|
+
"name": "meta.embedded.block.malloysql.sql",
|
|
28
|
+
"patterns": [{ "include": "source.malloy-sql" }]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comments": {
|
|
3
|
+
"lineComment": ["--", "//"],
|
|
4
|
+
"blockComment": ["/*", "*/"]
|
|
5
|
+
},
|
|
6
|
+
"brackets": [
|
|
7
|
+
["{", "}"],
|
|
8
|
+
["[", "]"],
|
|
9
|
+
["(", ")"]
|
|
10
|
+
],
|
|
11
|
+
"autoClosingPairs": [
|
|
12
|
+
["{", "}"],
|
|
13
|
+
["[", "]"],
|
|
14
|
+
["(", ")"],
|
|
15
|
+
{ "open": "\"", "close": "\"", "notIn": ["string"] },
|
|
16
|
+
{ "open": "N'", "close": "'", "notIn": ["string", "comment"] },
|
|
17
|
+
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }
|
|
18
|
+
],
|
|
19
|
+
"surroundingPairs": [
|
|
20
|
+
["{", "}"],
|
|
21
|
+
["[", "]"],
|
|
22
|
+
["(", ")"],
|
|
23
|
+
["\"", "\""],
|
|
24
|
+
["'", "'"],
|
|
25
|
+
["`", "`"]
|
|
26
|
+
],
|
|
27
|
+
"folding": {
|
|
28
|
+
"markers": {
|
|
29
|
+
"start": "^\\s*--\\s*#region\\b",
|
|
30
|
+
"end": "^\\s*--\\s*#endregion\\b"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Malloy SQL",
|
|
3
|
+
"scopeName": "source.malloy-sql",
|
|
4
|
+
"patterns": [{ "include": "#malloysql-sql" }],
|
|
5
|
+
"repository": {
|
|
6
|
+
"malloysql-sql": {
|
|
7
|
+
"beginCaptures": {
|
|
8
|
+
"0": { "name": "entity.other.attribute.malloy-sql" },
|
|
9
|
+
"1": { "name": "entity.other.attribute.malloy-sql" },
|
|
10
|
+
"3": { "name": "comment.line.double-slash" }
|
|
11
|
+
},
|
|
12
|
+
"name": "meta.embedded.block.malloysql.sql",
|
|
13
|
+
"patterns": [
|
|
14
|
+
{ "include": "#comments" },
|
|
15
|
+
{
|
|
16
|
+
"begin": "%{",
|
|
17
|
+
"end": "}%",
|
|
18
|
+
"beginCaptures": {
|
|
19
|
+
"0": { "name": "punctuation.definition.malloy-sql" }
|
|
20
|
+
},
|
|
21
|
+
"endCaptures": {
|
|
22
|
+
"0": { "name": "punctuation.definition.malloy-sql" }
|
|
23
|
+
},
|
|
24
|
+
"name": "meta.embedded.block.malloy",
|
|
25
|
+
"patterns": [{ "include": "source.malloy" }]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"include": "source.sql"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"comments": {
|
|
33
|
+
"patterns": [
|
|
34
|
+
{
|
|
35
|
+
"begin": "/\\*",
|
|
36
|
+
"end": "\\*/",
|
|
37
|
+
"beginCaptures": {
|
|
38
|
+
"0": { "name": "punctuation.definition.comment.begin" }
|
|
39
|
+
},
|
|
40
|
+
"endCaptures": {
|
|
41
|
+
"0": { "name": "punctuation.definition.comment.end" }
|
|
42
|
+
},
|
|
43
|
+
"name": "comment.block"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"begin": "//",
|
|
47
|
+
"end": "\\n",
|
|
48
|
+
"beginCaptures": {
|
|
49
|
+
"0": { "name": "punctuation.definition.comment" }
|
|
50
|
+
},
|
|
51
|
+
"name": "comment.line.double-slash"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"begin": "--",
|
|
55
|
+
"end": "\\n",
|
|
56
|
+
"beginCaptures": {
|
|
57
|
+
"0": { "name": "punctuation.definition.comment" }
|
|
58
|
+
},
|
|
59
|
+
"name": "comment.line.double-hyphen"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@malloydata/syntax-highlight",
|
|
3
|
+
"version": "0.0.82-dev230912235413",
|
|
4
|
+
"description": "A package to simplify the process of developing, testing, and syncnig Malloy syntax highlighting grammars",
|
|
5
|
+
"files": [
|
|
6
|
+
"grammars/**/*.tmGrammar.json",
|
|
7
|
+
"grammars/**/*-language.json"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"gen-malloy-monarch": "ts-node scripts/generateMonarchGrammar grammars/malloy/malloy.tmGrammar.json grammars/malloy/malloy.monarch.ts && prettier grammars/malloy/malloy.monarch.ts --write",
|
|
12
|
+
"gen-malloy-tokens": "ts-node scripts/generateLanguageTokenizationFile grammars/malloy/tokenizations/darkPlus.ts",
|
|
13
|
+
"test-monarch-grammars": "rimraf ./dist && tsc && karma start",
|
|
14
|
+
"test-textmate-grammars": "jest",
|
|
15
|
+
"gen-monaco-darkplus": "ts-node scripts/generateMonarchTheme themes/textmate/dark_plus.json themes/monaco/darkPlus.ts"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/jasmine": "^4.3.5",
|
|
20
|
+
"jasmine-core": "^5.1.1",
|
|
21
|
+
"json5": "^2.2.3",
|
|
22
|
+
"karma": "^6.4.2",
|
|
23
|
+
"karma-chrome-launcher": "^3.2.0",
|
|
24
|
+
"karma-cli": "^2.0.0",
|
|
25
|
+
"karma-jasmine": "^5.1.0",
|
|
26
|
+
"karma-jasmine-html-reporter": "^2.1.0",
|
|
27
|
+
"karma-spec-reporter": "^0.0.36",
|
|
28
|
+
"monaco-editor": "^0.41.0",
|
|
29
|
+
"vscode-oniguruma": "^1.7.0",
|
|
30
|
+
"vscode-textmate": "^9.0.0"
|
|
31
|
+
}
|
|
32
|
+
}
|