Skip to content

Commit 716eb7c

Browse files
cleanup from_sql and sql: in textmade grammar
1 parent 6795efd commit 716eb7c

File tree

2 files changed

+3
-36
lines changed

2 files changed

+3
-36
lines changed

packages/malloy-syntax-highlight/grammars/malloy/malloy.monarch.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@ export const monarch: Monaco.IMonarchLanguage = {
4747
{include: '@identifiers_unquoted'},
4848
],
4949
sql_string: [
50-
[
51-
/\b(select)(\s*:\s*)(""")/,
52-
[
53-
'keyword.control.select',
54-
'',
55-
{
56-
next: '@sql_end',
57-
nextEmbedded: 'sql',
58-
token: 'punctuation.sql.block.open',
59-
},
60-
],
61-
],
6250
[
6351
/(\b[A-Za-z_][A-Za-z_0-9]*)(\s*\.\s*)(sql)(\s*\(\s*)(""")/,
6452
[
@@ -196,7 +184,6 @@ export const monarch: Monaco.IMonarchLanguage = {
196184
],
197185
properties: [
198186
[/\baccept\b/, 'keyword.control.accept'],
199-
[/\bsql\b/, 'keyword.control.sql'],
200187
[/\bselect\b/, 'keyword.control.select'],
201188
[/\bconnection\b/, 'keyword.control.connection'],
202189
[/\brun\b/, 'keyword.control.run'],
@@ -236,7 +223,7 @@ export const monarch: Monaco.IMonarchLanguage = {
236223
['entity.name.function', '', 'entity.name.function.modifier'],
237224
],
238225
[
239-
/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|TABLE|FROM|FROM_SQL|UNGROUPED)(\s*\()/,
226+
/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\s*\()/,
240227
['entity.name.function', ''],
241228
],
242229
[/\b([a-zA-Z_][a-zA-Z_0-9]*)(\s*\()/, ['entity.name.function', '']],

packages/malloy-syntax-highlight/grammars/malloy/malloy.tmGrammar.json

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,6 @@
3939
},
4040
"sql-string": {
4141
"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-
},
5842
{
5943
"begin": "(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(\"\"\")",
6044
"end": "\"\"\"",
@@ -84,7 +68,7 @@
8468
}
8569
},
8670
{
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*\\()",
71+
"match": "(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",
8872
"captures": {
8973
"1": { "name": "entity.name.function" }
9074
}
@@ -350,11 +334,7 @@
350334
"match": "(?i)\\baccept\\b",
351335
"name": "keyword.control.accept"
352336
},
353-
{
354-
"match": "(?i)\\bsql\\b",
355-
"name": "keyword.control.sql"
356-
},
357-
{
337+
{
358338
"match": "(?i)\\bselect\\b",
359339
"name": "keyword.control.select"
360340
},

0 commit comments

Comments
 (0)