@malloydata/malloy 0.0.22-dev230126015148 → 0.0.22-dev230206094309

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.
Files changed (93) hide show
  1. package/package.json +2 -2
  2. package/dist/connection_utils.d.ts +0 -1
  3. package/dist/connection_utils.js +0 -66
  4. package/dist/dialect/dialect.d.ts +0 -66
  5. package/dist/dialect/dialect.js +0 -85
  6. package/dist/dialect/dialect_map.d.ts +0 -3
  7. package/dist/dialect/dialect_map.js +0 -45
  8. package/dist/dialect/duckdb.d.ts +0 -52
  9. package/dist/dialect/duckdb.js +0 -364
  10. package/dist/dialect/index.d.ts +0 -6
  11. package/dist/dialect/index.js +0 -37
  12. package/dist/dialect/postgres.d.ts +0 -52
  13. package/dist/dialect/postgres.js +0 -330
  14. package/dist/dialect/standardsql.d.ts +0 -49
  15. package/dist/dialect/standardsql.js +0 -381
  16. package/dist/index.d.ts +0 -10
  17. package/dist/index.js +0 -59
  18. package/dist/lang/ast/apply-expr.d.ts +0 -3
  19. package/dist/lang/ast/apply-expr.js +0 -34
  20. package/dist/lang/ast/ast-expr.d.ts +0 -206
  21. package/dist/lang/ast/ast-expr.js +0 -781
  22. package/dist/lang/ast/ast-main.d.ts +0 -915
  23. package/dist/lang/ast/ast-main.js +0 -3672
  24. package/dist/lang/ast/ast-time-expr.d.ts +0 -69
  25. package/dist/lang/ast/ast-time-expr.js +0 -389
  26. package/dist/lang/ast/ast-types.d.ts +0 -83
  27. package/dist/lang/ast/ast-types.js +0 -225
  28. package/dist/lang/ast/index.d.ts +0 -5
  29. package/dist/lang/ast/index.js +0 -44
  30. package/dist/lang/ast/time-utils.d.ts +0 -9
  31. package/dist/lang/ast/time-utils.js +0 -104
  32. package/dist/lang/field-utils.d.ts +0 -5
  33. package/dist/lang/field-utils.js +0 -43
  34. package/dist/lang/index.d.ts +0 -9
  35. package/dist/lang/index.js +0 -32
  36. package/dist/lang/lib/Malloy/MalloyLexer.d.ts +0 -165
  37. package/dist/lang/lib/Malloy/MalloyLexer.js +0 -1232
  38. package/dist/lang/lib/Malloy/MalloyParser.d.ts +0 -1947
  39. package/dist/lang/lib/Malloy/MalloyParser.js +0 -11909
  40. package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +0 -2022
  41. package/dist/lang/lib/Malloy/MalloyParserListener.js +0 -4
  42. package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +0 -1274
  43. package/dist/lang/lib/Malloy/MalloyParserVisitor.js +0 -4
  44. package/dist/lang/parse-log.d.ts +0 -27
  45. package/dist/lang/parse-log.js +0 -51
  46. package/dist/lang/parse-malloy.d.ts +0 -236
  47. package/dist/lang/parse-malloy.js +0 -746
  48. package/dist/lang/parse-to-ast.d.ts +0 -155
  49. package/dist/lang/parse-to-ast.js +0 -990
  50. package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +0 -10
  51. package/dist/lang/parse-tree-walkers/document-completion-walker.js +0 -148
  52. package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +0 -9
  53. package/dist/lang/parse-tree-walkers/document-help-context-walker.js +0 -107
  54. package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +0 -83
  55. package/dist/lang/parse-tree-walkers/document-highlight-walker.js +0 -385
  56. package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +0 -11
  57. package/dist/lang/parse-tree-walkers/document-symbol-walker.js +0 -182
  58. package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +0 -34
  59. package/dist/lang/parse-tree-walkers/explore-query-walker.js +0 -74
  60. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +0 -11
  61. package/dist/lang/parse-tree-walkers/find-external-references.js +0 -61
  62. package/dist/lang/reference-list.d.ts +0 -10
  63. package/dist/lang/reference-list.js +0 -90
  64. package/dist/lang/space-field.d.ts +0 -17
  65. package/dist/lang/space-field.js +0 -127
  66. package/dist/lang/test/document-help-context-walker.spec.d.ts +0 -1
  67. package/dist/lang/test/document-help-context-walker.spec.js +0 -55
  68. package/dist/lang/test/document-symbol-walker.spec.d.ts +0 -1
  69. package/dist/lang/test/document-symbol-walker.spec.js +0 -110
  70. package/dist/lang/test/field-symbols.spec.d.ts +0 -1
  71. package/dist/lang/test/field-symbols.spec.js +0 -180
  72. package/dist/lang/test/parse.spec.d.ts +0 -14
  73. package/dist/lang/test/parse.spec.js +0 -2134
  74. package/dist/lang/test/test-translator.d.ts +0 -38
  75. package/dist/lang/test/test-translator.js +0 -344
  76. package/dist/lang/zone.d.ts +0 -57
  77. package/dist/lang/zone.js +0 -107
  78. package/dist/malloy.d.ts +0 -1146
  79. package/dist/malloy.js +0 -2413
  80. package/dist/model/index.d.ts +0 -2
  81. package/dist/model/index.js +0 -45
  82. package/dist/model/malloy_query.d.ts +0 -351
  83. package/dist/model/malloy_query.js +0 -3174
  84. package/dist/model/malloy_types.d.ts +0 -551
  85. package/dist/model/malloy_types.js +0 -378
  86. package/dist/model/sql_block.d.ts +0 -7
  87. package/dist/model/sql_block.js +0 -56
  88. package/dist/model/utils.d.ts +0 -22
  89. package/dist/model/utils.js +0 -102
  90. package/dist/run_sql_options.d.ts +0 -3
  91. package/dist/run_sql_options.js +0 -25
  92. package/dist/runtime_types.d.ts +0 -105
  93. package/dist/runtime_types.js +0 -25
@@ -1,10 +0,0 @@
1
- import { CommonTokenStream } from "antlr4ts";
2
- import { ParseTree } from "antlr4ts/tree";
3
- export interface DocumentCompletion {
4
- type: string;
5
- text: string;
6
- }
7
- export declare function walkForDocumentCompletions(tokens: CommonTokenStream, parseTree: ParseTree, position: {
8
- line: number;
9
- character: number;
10
- }): DocumentCompletion[];
@@ -1,148 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright 2023 Google LLC
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining
6
- * a copy of this software and associated documentation files
7
- * (the "Software"), to deal in the Software without restriction,
8
- * including without limitation the rights to use, copy, modify, merge,
9
- * publish, distribute, sublicense, and/or sell copies of the Software,
10
- * and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be
14
- * included in all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- */
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.walkForDocumentCompletions = void 0;
26
- const ParseTreeWalker_1 = require("antlr4ts/tree/ParseTreeWalker");
27
- const EXPLORE_PROPERTIES = [
28
- "dimension",
29
- "measure",
30
- "join_one",
31
- "join_many",
32
- "join_cross",
33
- "where",
34
- "primary_key",
35
- "rename",
36
- "accept",
37
- "except",
38
- "query",
39
- "declare",
40
- ];
41
- const QUERY_PROPERTIES = [
42
- "group_by",
43
- "project",
44
- "index",
45
- "aggregate",
46
- "top",
47
- "limit",
48
- "order_by",
49
- "where",
50
- "having",
51
- "nest",
52
- "declare",
53
- ];
54
- const MODEL_PROPERTIES = ["source", "explore", "query", "sql"];
55
- class DocumentCompletionWalker {
56
- constructor(tokens, completions, position) {
57
- this.tokens = tokens;
58
- this.completions = completions;
59
- this.position = position;
60
- }
61
- rangeOf(pcx) {
62
- const stopToken = pcx.stop || pcx.start;
63
- return {
64
- start: {
65
- line: pcx.start.line - 1,
66
- character: pcx.start.charPositionInLine,
67
- },
68
- end: {
69
- line: stopToken.line - 1,
70
- character: stopToken.stopIndex -
71
- (stopToken.startIndex - stopToken.charPositionInLine) +
72
- 1,
73
- },
74
- };
75
- }
76
- inRange(range) {
77
- const { start, end } = range;
78
- const afterStart = this.position.line > start.line ||
79
- (this.position.line === start.line &&
80
- this.position.character >= start.character);
81
- const beforeEnd = this.position.line < end.line ||
82
- (this.position.line === end.line &&
83
- this.position.character <= end.character);
84
- return afterStart && beforeEnd;
85
- }
86
- enterExploreProperties(ctx) {
87
- if (this.inRange(this.rangeOf(ctx))) {
88
- let insideStatement = false;
89
- for (const exploreStatementContext of ctx.exploreStatement()) {
90
- if (this.inRange(this.rangeOf(exploreStatementContext))) {
91
- insideStatement = true;
92
- }
93
- }
94
- if (!insideStatement) {
95
- for (const property of EXPLORE_PROPERTIES) {
96
- this.completions.push({
97
- type: "explore_property",
98
- text: `${property}: `,
99
- });
100
- }
101
- }
102
- }
103
- }
104
- enterQueryProperties(ctx) {
105
- if (this.inRange(this.rangeOf(ctx))) {
106
- let insideStatement = false;
107
- for (const exploreStatementContext of ctx.queryStatement()) {
108
- if (this.inRange(this.rangeOf(exploreStatementContext))) {
109
- insideStatement = true;
110
- }
111
- }
112
- if (!insideStatement) {
113
- for (const property of QUERY_PROPERTIES) {
114
- this.completions.push({
115
- type: "query_property",
116
- text: `${property}: `,
117
- });
118
- }
119
- }
120
- }
121
- }
122
- enterMalloyDocument(ctx) {
123
- if (this.inRange(this.rangeOf(ctx))) {
124
- let insideStatement = false;
125
- for (const modelStatementContext of ctx.malloyStatement()) {
126
- if (this.inRange(this.rangeOf(modelStatementContext))) {
127
- insideStatement = true;
128
- }
129
- }
130
- if (!insideStatement) {
131
- for (const property of MODEL_PROPERTIES) {
132
- this.completions.push({
133
- type: "model_property",
134
- text: `${property}: `,
135
- });
136
- }
137
- }
138
- }
139
- }
140
- }
141
- function walkForDocumentCompletions(tokens, parseTree, position) {
142
- const finder = new DocumentCompletionWalker(tokens, [], position);
143
- const listener = finder;
144
- ParseTreeWalker_1.ParseTreeWalker.DEFAULT.walk(listener, parseTree);
145
- return finder.completions;
146
- }
147
- exports.walkForDocumentCompletions = walkForDocumentCompletions;
148
- //# sourceMappingURL=document-completion-walker.js.map
@@ -1,9 +0,0 @@
1
- import { ParseTree } from "antlr4ts/tree";
2
- export interface DocumentHelpContext {
3
- type: string;
4
- token: string | undefined;
5
- }
6
- export declare function walkForDocumentHelpContext(parseTree: ParseTree, position: {
7
- line: number;
8
- character: number;
9
- }): DocumentHelpContext | undefined;
@@ -1,107 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright 2023 Google LLC
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining
6
- * a copy of this software and associated documentation files
7
- * (the "Software"), to deal in the Software without restriction,
8
- * including without limitation the rights to use, copy, modify, merge,
9
- * publish, distribute, sublicense, and/or sell copies of the Software,
10
- * and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be
14
- * included in all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- */
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.walkForDocumentHelpContext = void 0;
26
- const tree_1 = require("antlr4ts/tree");
27
- class HelpContextVisitor extends tree_1.AbstractParseTreeVisitor {
28
- constructor(position) {
29
- super();
30
- this.position = position;
31
- this.type = "";
32
- }
33
- rangeOf(ctx) {
34
- const stopToken = ctx.stop || ctx.start;
35
- return {
36
- start: {
37
- line: ctx.start.line - 1,
38
- character: ctx.start.charPositionInLine,
39
- },
40
- end: {
41
- line: stopToken.line - 1,
42
- character: stopToken.stopIndex -
43
- (stopToken.startIndex - stopToken.charPositionInLine) +
44
- 1,
45
- },
46
- };
47
- }
48
- inRange(range) {
49
- return (range.start.line <= this.position.line &&
50
- range.end.line >= this.position.line &&
51
- (this.position.line !== range.start.line ||
52
- this.position.character >= range.start.character) &&
53
- (this.position.line !== range.end.line ||
54
- this.position.character <= range.end.character));
55
- }
56
- defaultResult() {
57
- return undefined;
58
- }
59
- visitChildren(ctx) {
60
- let result = this.defaultResult();
61
- if (this.inRange(this.rangeOf(ctx))) {
62
- result = {
63
- type: this.type,
64
- token: ctx.start.text,
65
- };
66
- const n = ctx.childCount;
67
- for (let i = 0; i < n; i++) {
68
- const c = ctx.getChild(i);
69
- const childResult = c.accept(this);
70
- if (childResult) {
71
- result = this.aggregateResult(result, childResult);
72
- }
73
- }
74
- }
75
- return result;
76
- }
77
- visitMalloyDocument(ctx) {
78
- if (this.inRange(this.rangeOf(ctx))) {
79
- this.type = "model_property";
80
- return this.visitChildren(ctx);
81
- }
82
- return this.defaultResult();
83
- }
84
- visitExploreProperties(ctx) {
85
- if (this.inRange(this.rangeOf(ctx))) {
86
- this.type = "explore_property";
87
- return this.visitChildren(ctx);
88
- }
89
- return this.defaultResult();
90
- }
91
- visitQueryProperties(ctx) {
92
- if (this.inRange(this.rangeOf(ctx))) {
93
- this.type = "query_property";
94
- return this.visitChildren(ctx);
95
- }
96
- return this.defaultResult();
97
- }
98
- aggregateResult(aggregate, nextResult) {
99
- return nextResult;
100
- }
101
- }
102
- function walkForDocumentHelpContext(parseTree, position) {
103
- const visitor = new HelpContextVisitor(position);
104
- return visitor.visit(parseTree);
105
- }
106
- exports.walkForDocumentHelpContext = walkForDocumentHelpContext;
107
- //# sourceMappingURL=document-help-context-walker.js.map
@@ -1,83 +0,0 @@
1
- import { CommonTokenStream } from "antlr4ts";
2
- import { ParseTree } from "antlr4ts/tree";
3
- import { DocumentRange } from "../../model/malloy_types";
4
- export interface DocumentHighlight {
5
- range: DocumentRange;
6
- type: string;
7
- }
8
- export declare const HighlightType: {
9
- Identifier: string;
10
- Type: string;
11
- Literal: {
12
- Date: string;
13
- Number: string;
14
- String: string;
15
- RegularExpression: string;
16
- Boolean: string;
17
- Null: string;
18
- };
19
- Call: {
20
- Aggregate: string;
21
- TimeFrame: string;
22
- Cast: string;
23
- Table: string;
24
- From: string;
25
- Function: string;
26
- FromSQL: string;
27
- };
28
- Keyword: {
29
- AggregateModifier: {
30
- Distinct: string;
31
- };
32
- CastModifier: {
33
- As: string;
34
- };
35
- Is: string;
36
- On: string;
37
- Desc: string;
38
- Asc: string;
39
- Pick: string;
40
- When: string;
41
- Else: string;
42
- With: string;
43
- JSON: string;
44
- Turtle: string;
45
- Import: string;
46
- };
47
- Operator: {
48
- Comparison: string;
49
- Boolean: string;
50
- Date: string;
51
- };
52
- Comment: {
53
- Line: string;
54
- Block: string;
55
- };
56
- Property: {
57
- Accept: string;
58
- Aggregate: string;
59
- Dimension: string;
60
- Except: string;
61
- Source: string;
62
- GroupBy: string;
63
- Having: string;
64
- Index: string;
65
- JoinOne: string;
66
- JoinMany: string;
67
- JoinCross: string;
68
- Limit: string;
69
- Measure: string;
70
- Nest: string;
71
- OrderBy: string;
72
- PrimaryKey: string;
73
- Project: string;
74
- Query: string;
75
- Rename: string;
76
- Top: string;
77
- Where: string;
78
- SQL: string;
79
- };
80
- };
81
- export declare function passForHighlights(tokens: CommonTokenStream): DocumentHighlight[];
82
- export declare function walkForDocumentHighlights(tokens: CommonTokenStream, parseTree: ParseTree): DocumentHighlight[];
83
- export declare function sortHighlights(highlights: DocumentHighlight[]): DocumentHighlight[];