@malloydata/syntax-highlight 0.0.403 → 0.0.405

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/LICENSE ADDED
@@ -0,0 +1,77 @@
1
+ Malloy Project License
2
+ SPDX-License-Identifier: MIT
3
+
4
+ Copyright Contributors to the Malloy project
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+
24
+ ========================================================================
25
+ SOURCE FILE HEADER
26
+ ========================================================================
27
+
28
+ Every source file in this project carries the following header (shown here
29
+ in C/Java/JavaScript comment style; equivalent comment styles are used for
30
+ other languages):
31
+
32
+ /*
33
+ * Copyright Contributors to the Malloy project
34
+ * SPDX-License-Identifier: MIT
35
+ */
36
+
37
+ ========================================================================
38
+ HISTORICAL ATTRIBUTIONS & NOTICES
39
+ ========================================================================
40
+
41
+ Portions of this software were originally contributed by Google LLC and
42
+ Meta Platforms, Inc. and affiliates under the MIT License. For ease of
43
+ maintenance, individual file headers have been updated to the current
44
+ standard header. The full historical attribution and authorship for
45
+ individual files remains completely preserved and accessible via the Git
46
+ repository history.
47
+
48
+ The original copyright and permission notices for those contributions
49
+ are preserved below:
50
+
51
+ ------------------------------------------------------------------------
52
+ Copyright 2023 Google LLC
53
+
54
+ Permission is hereby granted, free of charge, to any person obtaining
55
+ a copy of this software and associated documentation files (the
56
+ "Software"), to deal in the Software without restriction, including
57
+ without limitation the rights to use, copy, modify, merge, publish,
58
+ distribute, sublicense, and/or sell copies of the Software, and to
59
+ permit persons to whom the Software is furnished to do so, subject to
60
+ the following conditions:
61
+
62
+ The above copyright notice and this permission notice shall be
63
+ included in all copies or substantial portions of the Software.
64
+
65
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
66
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
67
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
68
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
69
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
70
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
71
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
72
+ ------------------------------------------------------------------------
73
+ Copyright (c) Meta Platforms, Inc. and affiliates.
74
+
75
+ This source code is licensed under the MIT license found in the
76
+ LICENSE file in the root directory of this source tree.
77
+ ------------------------------------------------------------------------
@@ -1,24 +1,6 @@
1
1
  /*
2
- * Copyright 2023 Google LLC
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining
5
- * a copy of this software and associated documentation files
6
- * (the "Software"), to deal in the Software without restriction,
7
- * including without limitation the rights to use, copy, modify, merge,
8
- * publish, distribute, sublicense, and/or sell copies of the Software,
9
- * and to permit persons to whom the Software is furnished to do so,
10
- * subject to the following conditions:
11
- *
12
- * The above copyright notice and this permission notice shall be
13
- * included in all copies or substantial portions of the Software.
14
- *
15
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2
+ * Copyright Contributors to the Malloy project
3
+ * SPDX-License-Identifier: MIT
22
4
  */
23
5
 
24
6
  import {languages as Monaco} from 'monaco-editor';
@@ -199,6 +181,19 @@ export const monarch: Monaco.IMonarchLanguage = {
199
181
  [/\bpublic\b/, 'keyword.control.public'],
200
182
  [/\bprivate\b/, 'keyword.control.private'],
201
183
  [/\binclude\b/, 'keyword.control.include'],
184
+ [/\bas\b/, 'keyword.control.as'],
185
+ [/\bfrom\b/, 'keyword.control.from'],
186
+ [/\bexport\b/, 'keyword.control.export'],
187
+ [/\bcase\b/, 'keyword.control.case'],
188
+ [/\bthen\b/, 'keyword.control.then'],
189
+ [/\bend\b/, 'keyword.control.end'],
190
+ [/\bfilter\b/, 'keyword.control.filter'],
191
+ [/\bin\b/, 'keyword.other.in'],
192
+ [/\blike\b/, 'keyword.other.like'],
193
+ [/\binner\b/, 'keyword.other.inner'],
194
+ [/\bleft\b/, 'keyword.other.left'],
195
+ [/\bright\b/, 'keyword.other.right'],
196
+ [/\bfull\b/, 'keyword.other.full'],
202
197
  ],
203
198
  properties: [
204
199
  [/\baccept\b/, 'keyword.control.accept'],
@@ -236,6 +231,8 @@ export const monarch: Monaco.IMonarchLanguage = {
236
231
  [/\bview\b/, 'keyword.control.view'],
237
232
  [/\bwhere\b/, 'keyword.control.where'],
238
233
  [/\bdeclare\b/, 'keyword.control.declare'],
234
+ [/\btype\b/, 'keyword.control.type'],
235
+ [/\bgiven\b/, 'keyword.control.given'],
239
236
  ],
240
237
  functions: [
241
238
  [
@@ -243,7 +240,7 @@ export const monarch: Monaco.IMonarchLanguage = {
243
240
  ['entity.name.function', '', 'entity.name.function.modifier'],
244
241
  ],
245
242
  [
246
- /\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\s*\()/,
243
+ /\b(ALL|AVG|CAST|COMPOSE|COUNT|EXCLUDE|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\s*\()/,
247
244
  ['entity.name.function', ''],
248
245
  ],
249
246
  [/\b([a-zA-Z_][a-zA-Z_0-9]*)(\s*\()/, ['entity.name.function', '']],
@@ -267,6 +264,7 @@ export const monarch: Monaco.IMonarchLanguage = {
267
264
  [/\bstring\b/, 'entity.name.type.string'],
268
265
  [/\bnumber\b/, 'entity.name.type.number'],
269
266
  [/\bdate\b/, 'entity.name.type.date'],
267
+ [/\btimestamptz\b/, 'entity.name.type.timestamptz'],
270
268
  [/\btimestamp\b/, 'entity.name.type.timestamp'],
271
269
  [/\bboolean\b/, 'entity.name.type.boolean'],
272
270
  ],
@@ -68,7 +68,7 @@
68
68
  }
69
69
  },
70
70
  {
71
- "match": "(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",
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*\\()",
72
72
  "captures": {
73
73
  "1": { "name": "entity.name.function" }
74
74
  }
@@ -342,6 +342,10 @@
342
342
  "match": "(?i)\\bdate\\b",
343
343
  "name": "entity.name.type.date"
344
344
  },
345
+ {
346
+ "match": "(?i)\\btimestamptz\\b",
347
+ "name": "entity.name.type.timestamptz"
348
+ },
345
349
  {
346
350
  "match": "(?i)\\btimestamp\\b",
347
351
  "name": "entity.name.type.timestamp"
@@ -493,6 +497,14 @@
493
497
  {
494
498
  "match": "(?i)\\bdeclare\\b",
495
499
  "name": "keyword.control.declare"
500
+ },
501
+ {
502
+ "match": "(?i)\\btype\\b",
503
+ "name": "keyword.control.type"
504
+ },
505
+ {
506
+ "match": "(?i)\\bgiven\\b",
507
+ "name": "keyword.control.given"
496
508
  }
497
509
  ]
498
510
  },
@@ -569,6 +581,58 @@
569
581
  {
570
582
  "match": "(?i)\\binclude\\b",
571
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"
572
636
  }
573
637
  ]
574
638
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/syntax-highlight",
3
- "version": "0.0.403",
3
+ "version": "0.0.405",
4
4
  "description": "A package to simplify the process of developing, testing, and syncnig Malloy syntax highlighting grammars",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "build": "npm run codegen && tsc",
20
20
  "clean": "tsc --build --clean && rm -f tsconfig.tsbuildinfo && rm -rf dist && node ../../scripts/femto-build.js --clean",
21
21
  "gen-malloy-monarch": "ts-node scripts/generateMonarchGrammar grammars/malloy/malloy.tmGrammar.json grammars/malloy/malloy.monarch.ts && prettier grammars/malloy/malloy.monarch.ts --write",
22
- "gen-malloy-tokens": "ts-node scripts/generateLanguageTokenizationFile grammars/malloy/tokenizations/darkPlus.ts",
22
+ "gen-malloy-tokens": "ts-node scripts/generateLanguageTokenizationFile grammars/malloy/tokenizations/darkPlus.ts && prettier grammars/malloy/tokenizations/darkPlus.ts --write",
23
23
  "test-monarch-grammars": "rimraf ./dist && tsc && karma start",
24
24
  "test-textmate-grammars": "jest",
25
25
  "gen-monaco-darkplus": "ts-node scripts/generateMonarchTheme themes/textmate/dark_plus.json themes/monaco/darkPlus.ts",