@malloydata/malloy 0.0.248 → 0.0.249-dev250326193717
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/dist/lang/ast/query-properties/declare-fields.d.ts +1 -1
- package/dist/lang/lib/Malloy/MalloyLexer.d.ts +4 -5
- package/dist/lang/lib/Malloy/MalloyLexer.js +1118 -1123
- package/dist/lang/lib/Malloy/MalloyParser.d.ts +9 -44
- package/dist/lang/lib/Malloy/MalloyParser.js +1783 -2061
- package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +0 -52
- package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +0 -32
- package/dist/lang/malloy-to-ast.d.ts +2 -7
- package/dist/lang/malloy-to-ast.js +2 -53
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +0 -9
- package/dist/lang/parse-tree-walkers/find-external-references.js +1 -9
- package/dist/lang/parse-tree-walkers/find-table-path-walker.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
|
@@ -4,7 +4,6 @@ import { RecordExprContext } from "./MalloyParser";
|
|
|
4
4
|
import { VSegContext } from "./MalloyParser";
|
|
5
5
|
import { VArrowContext } from "./MalloyParser";
|
|
6
6
|
import { Use_top_level_query_defsContext } from "./MalloyParser";
|
|
7
|
-
import { AnonymousQueryContext } from "./MalloyParser";
|
|
8
7
|
import { LiteralTimestampContext } from "./MalloyParser";
|
|
9
8
|
import { LiteralHourContext } from "./MalloyParser";
|
|
10
9
|
import { LiteralDayContext } from "./MalloyParser";
|
|
@@ -21,8 +20,6 @@ import { ExprBoolContext } from "./MalloyParser";
|
|
|
21
20
|
import { ExprRegexContext } from "./MalloyParser";
|
|
22
21
|
import { FilterString_stubContext } from "./MalloyParser";
|
|
23
22
|
import { ExprNowContext } from "./MalloyParser";
|
|
24
|
-
import { TableFunctionContext } from "./MalloyParser";
|
|
25
|
-
import { TableMethodContext } from "./MalloyParser";
|
|
26
23
|
import { NestDefContext } from "./MalloyParser";
|
|
27
24
|
import { ExprFieldPathContext } from "./MalloyParser";
|
|
28
25
|
import { ExprLiteralContext } from "./MalloyParser";
|
|
@@ -66,7 +63,6 @@ import { DefJoinManyContext } from "./MalloyParser";
|
|
|
66
63
|
import { DefJoinCrossContext } from "./MalloyParser";
|
|
67
64
|
import { DefExploreDimension_stubContext } from "./MalloyParser";
|
|
68
65
|
import { DefExploreMeasure_stubContext } from "./MalloyParser";
|
|
69
|
-
import { DefDeclare_stubContext } from "./MalloyParser";
|
|
70
66
|
import { DefJoin_stubContext } from "./MalloyParser";
|
|
71
67
|
import { DefExploreWhere_stubContext } from "./MalloyParser";
|
|
72
68
|
import { DefExplorePrimaryKeyContext } from "./MalloyParser";
|
|
@@ -307,18 +303,6 @@ export interface MalloyParserListener extends ParseTreeListener {
|
|
|
307
303
|
* @param ctx the parse tree
|
|
308
304
|
*/
|
|
309
305
|
exitUse_top_level_query_defs?: (ctx: Use_top_level_query_defsContext) => void;
|
|
310
|
-
/**
|
|
311
|
-
* Enter a parse tree produced by the `anonymousQuery`
|
|
312
|
-
* labeled alternative in `MalloyParser.defineQuery`.
|
|
313
|
-
* @param ctx the parse tree
|
|
314
|
-
*/
|
|
315
|
-
enterAnonymousQuery?: (ctx: AnonymousQueryContext) => void;
|
|
316
|
-
/**
|
|
317
|
-
* Exit a parse tree produced by the `anonymousQuery`
|
|
318
|
-
* labeled alternative in `MalloyParser.defineQuery`.
|
|
319
|
-
* @param ctx the parse tree
|
|
320
|
-
*/
|
|
321
|
-
exitAnonymousQuery?: (ctx: AnonymousQueryContext) => void;
|
|
322
306
|
/**
|
|
323
307
|
* Enter a parse tree produced by the `literalTimestamp`
|
|
324
308
|
* labeled alternative in `MalloyParser.dateLiteral`.
|
|
@@ -511,30 +495,6 @@ export interface MalloyParserListener extends ParseTreeListener {
|
|
|
511
495
|
* @param ctx the parse tree
|
|
512
496
|
*/
|
|
513
497
|
exitExprNow?: (ctx: ExprNowContext) => void;
|
|
514
|
-
/**
|
|
515
|
-
* Enter a parse tree produced by the `tableFunction`
|
|
516
|
-
* labeled alternative in `MalloyParser.exploreTable`.
|
|
517
|
-
* @param ctx the parse tree
|
|
518
|
-
*/
|
|
519
|
-
enterTableFunction?: (ctx: TableFunctionContext) => void;
|
|
520
|
-
/**
|
|
521
|
-
* Exit a parse tree produced by the `tableFunction`
|
|
522
|
-
* labeled alternative in `MalloyParser.exploreTable`.
|
|
523
|
-
* @param ctx the parse tree
|
|
524
|
-
*/
|
|
525
|
-
exitTableFunction?: (ctx: TableFunctionContext) => void;
|
|
526
|
-
/**
|
|
527
|
-
* Enter a parse tree produced by the `tableMethod`
|
|
528
|
-
* labeled alternative in `MalloyParser.exploreTable`.
|
|
529
|
-
* @param ctx the parse tree
|
|
530
|
-
*/
|
|
531
|
-
enterTableMethod?: (ctx: TableMethodContext) => void;
|
|
532
|
-
/**
|
|
533
|
-
* Exit a parse tree produced by the `tableMethod`
|
|
534
|
-
* labeled alternative in `MalloyParser.exploreTable`.
|
|
535
|
-
* @param ctx the parse tree
|
|
536
|
-
*/
|
|
537
|
-
exitTableMethod?: (ctx: TableMethodContext) => void;
|
|
538
498
|
/**
|
|
539
499
|
* Enter a parse tree produced by the `nestDef`
|
|
540
500
|
* labeled alternative in `MalloyParser.nestEntry`.
|
|
@@ -1051,18 +1011,6 @@ export interface MalloyParserListener extends ParseTreeListener {
|
|
|
1051
1011
|
* @param ctx the parse tree
|
|
1052
1012
|
*/
|
|
1053
1013
|
exitDefExploreMeasure_stub?: (ctx: DefExploreMeasure_stubContext) => void;
|
|
1054
|
-
/**
|
|
1055
|
-
* Enter a parse tree produced by the `defDeclare_stub`
|
|
1056
|
-
* labeled alternative in `MalloyParser.exploreStatement`.
|
|
1057
|
-
* @param ctx the parse tree
|
|
1058
|
-
*/
|
|
1059
|
-
enterDefDeclare_stub?: (ctx: DefDeclare_stubContext) => void;
|
|
1060
|
-
/**
|
|
1061
|
-
* Exit a parse tree produced by the `defDeclare_stub`
|
|
1062
|
-
* labeled alternative in `MalloyParser.exploreStatement`.
|
|
1063
|
-
* @param ctx the parse tree
|
|
1064
|
-
*/
|
|
1065
|
-
exitDefDeclare_stub?: (ctx: DefDeclare_stubContext) => void;
|
|
1066
1014
|
/**
|
|
1067
1015
|
* Enter a parse tree produced by the `defJoin_stub`
|
|
1068
1016
|
* labeled alternative in `MalloyParser.exploreStatement`.
|
|
@@ -4,7 +4,6 @@ import { RecordExprContext } from "./MalloyParser";
|
|
|
4
4
|
import { VSegContext } from "./MalloyParser";
|
|
5
5
|
import { VArrowContext } from "./MalloyParser";
|
|
6
6
|
import { Use_top_level_query_defsContext } from "./MalloyParser";
|
|
7
|
-
import { AnonymousQueryContext } from "./MalloyParser";
|
|
8
7
|
import { LiteralTimestampContext } from "./MalloyParser";
|
|
9
8
|
import { LiteralHourContext } from "./MalloyParser";
|
|
10
9
|
import { LiteralDayContext } from "./MalloyParser";
|
|
@@ -21,8 +20,6 @@ import { ExprBoolContext } from "./MalloyParser";
|
|
|
21
20
|
import { ExprRegexContext } from "./MalloyParser";
|
|
22
21
|
import { FilterString_stubContext } from "./MalloyParser";
|
|
23
22
|
import { ExprNowContext } from "./MalloyParser";
|
|
24
|
-
import { TableFunctionContext } from "./MalloyParser";
|
|
25
|
-
import { TableMethodContext } from "./MalloyParser";
|
|
26
23
|
import { NestDefContext } from "./MalloyParser";
|
|
27
24
|
import { ExprFieldPathContext } from "./MalloyParser";
|
|
28
25
|
import { ExprLiteralContext } from "./MalloyParser";
|
|
@@ -66,7 +63,6 @@ import { DefJoinManyContext } from "./MalloyParser";
|
|
|
66
63
|
import { DefJoinCrossContext } from "./MalloyParser";
|
|
67
64
|
import { DefExploreDimension_stubContext } from "./MalloyParser";
|
|
68
65
|
import { DefExploreMeasure_stubContext } from "./MalloyParser";
|
|
69
|
-
import { DefDeclare_stubContext } from "./MalloyParser";
|
|
70
66
|
import { DefJoin_stubContext } from "./MalloyParser";
|
|
71
67
|
import { DefExploreWhere_stubContext } from "./MalloyParser";
|
|
72
68
|
import { DefExplorePrimaryKeyContext } from "./MalloyParser";
|
|
@@ -285,13 +281,6 @@ export interface MalloyParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
|
|
285
281
|
* @return the visitor result
|
|
286
282
|
*/
|
|
287
283
|
visitUse_top_level_query_defs?: (ctx: Use_top_level_query_defsContext) => Result;
|
|
288
|
-
/**
|
|
289
|
-
* Visit a parse tree produced by the `anonymousQuery`
|
|
290
|
-
* labeled alternative in `MalloyParser.defineQuery`.
|
|
291
|
-
* @param ctx the parse tree
|
|
292
|
-
* @return the visitor result
|
|
293
|
-
*/
|
|
294
|
-
visitAnonymousQuery?: (ctx: AnonymousQueryContext) => Result;
|
|
295
284
|
/**
|
|
296
285
|
* Visit a parse tree produced by the `literalTimestamp`
|
|
297
286
|
* labeled alternative in `MalloyParser.dateLiteral`.
|
|
@@ -404,20 +393,6 @@ export interface MalloyParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
|
|
404
393
|
* @return the visitor result
|
|
405
394
|
*/
|
|
406
395
|
visitExprNow?: (ctx: ExprNowContext) => Result;
|
|
407
|
-
/**
|
|
408
|
-
* Visit a parse tree produced by the `tableFunction`
|
|
409
|
-
* labeled alternative in `MalloyParser.exploreTable`.
|
|
410
|
-
* @param ctx the parse tree
|
|
411
|
-
* @return the visitor result
|
|
412
|
-
*/
|
|
413
|
-
visitTableFunction?: (ctx: TableFunctionContext) => Result;
|
|
414
|
-
/**
|
|
415
|
-
* Visit a parse tree produced by the `tableMethod`
|
|
416
|
-
* labeled alternative in `MalloyParser.exploreTable`.
|
|
417
|
-
* @param ctx the parse tree
|
|
418
|
-
* @return the visitor result
|
|
419
|
-
*/
|
|
420
|
-
visitTableMethod?: (ctx: TableMethodContext) => Result;
|
|
421
396
|
/**
|
|
422
397
|
* Visit a parse tree produced by the `nestDef`
|
|
423
398
|
* labeled alternative in `MalloyParser.nestEntry`.
|
|
@@ -719,13 +694,6 @@ export interface MalloyParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
|
|
719
694
|
* @return the visitor result
|
|
720
695
|
*/
|
|
721
696
|
visitDefExploreMeasure_stub?: (ctx: DefExploreMeasure_stubContext) => Result;
|
|
722
|
-
/**
|
|
723
|
-
* Visit a parse tree produced by the `defDeclare_stub`
|
|
724
|
-
* labeled alternative in `MalloyParser.exploreStatement`.
|
|
725
|
-
* @param ctx the parse tree
|
|
726
|
-
* @return the visitor result
|
|
727
|
-
*/
|
|
728
|
-
visitDefDeclare_stub?: (ctx: DefDeclare_stubContext) => Result;
|
|
729
697
|
/**
|
|
730
698
|
* Visit a parse tree produced by the `defJoin_stub`
|
|
731
699
|
* labeled alternative in `MalloyParser.exploreStatement`.
|
|
@@ -4,7 +4,7 @@ import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor
|
|
|
4
4
|
import type { MalloyParserVisitor } from './lib/Malloy/MalloyParserVisitor';
|
|
5
5
|
import type * as parse from './lib/Malloy/MalloyParser';
|
|
6
6
|
import * as ast from './ast';
|
|
7
|
-
import type { LogMessageOptions,
|
|
7
|
+
import type { LogMessageOptions, MessageCode, MessageLogger, MessageParameterType } from './parse-log';
|
|
8
8
|
import type { MalloyParseInfo } from './malloy-parse-info';
|
|
9
9
|
import type { FieldDeclarationConstructor } from './ast';
|
|
10
10
|
import type { HasString, HasID } from './parse-utils';
|
|
@@ -53,8 +53,6 @@ export declare class MalloyToAST extends AbstractParseTreeVisitor<ast.MalloyElem
|
|
|
53
53
|
protected contextError<T extends MessageCode>(cx: ParserRuleContext, code: T, data: MessageParameterType<T>, options?: LogMessageOptions): void;
|
|
54
54
|
protected warnWithReplacement<T extends MessageCode>(code: T, data: MessageParameterType<T>, range: DocumentRange, replacement: string): void;
|
|
55
55
|
protected inExperiment(experimentId: string, cx: ParserRuleContext): boolean;
|
|
56
|
-
protected m4Severity(): LogSeverity | false;
|
|
57
|
-
protected m4advisory<T extends MessageCode>(cx: ParserRuleContext, code: T, data: MessageParameterType<T>): void;
|
|
58
56
|
protected only<T extends ast.MalloyElement>(els: ast.MalloyElement[], isGood: (el: ast.MalloyElement) => T | false, desc: string): T[];
|
|
59
57
|
protected getNumber(term: ParseTree): number;
|
|
60
58
|
protected getFieldName(cx: HasID): ast.FieldName;
|
|
@@ -86,8 +84,7 @@ export declare class MalloyToAST extends AbstractParseTreeVisitor<ast.MalloyElem
|
|
|
86
84
|
visitSourceDefinition(pcx: parse.SourceDefinitionContext): ast.DefineSource;
|
|
87
85
|
protected getSourceExtensions(extensions: parse.ExplorePropertiesContext): ast.SourceDesc;
|
|
88
86
|
visitExploreProperties(pcx: parse.ExplorePropertiesContext): ast.SourceDesc;
|
|
89
|
-
|
|
90
|
-
visitTableMethod(pcx: parse.TableMethodContext): ast.TableSource;
|
|
87
|
+
visitExploreTable(pcx: parse.ExploreTableContext): ast.TableSource;
|
|
91
88
|
visitSqlSource(pcx: parse.SqlSourceContext): ast.SQLSource;
|
|
92
89
|
visitDefJoinMany(pcx: parse.DefJoinManyContext): ast.JoinStatement;
|
|
93
90
|
visitDefJoinOne(pcx: parse.DefJoinOneContext): ast.JoinStatement;
|
|
@@ -107,7 +104,6 @@ export declare class MalloyToAST extends AbstractParseTreeVisitor<ast.MalloyElem
|
|
|
107
104
|
getAccessLabelProp(pcx: parse.AccessLabelPropContext | undefined): AccessModifierLabel | undefined;
|
|
108
105
|
visitDefMeasures(pcx: parse.DefMeasuresContext): ast.Measures;
|
|
109
106
|
visitQueryExtend(pcx: parse.QueryExtendContext): ast.ExtendBlock;
|
|
110
|
-
visitDeclareStatement(pcx: parse.DeclareStatementContext): ast.DeclareFields;
|
|
111
107
|
visitExploreRenameDef(pcx: parse.ExploreRenameDefContext): ast.RenameField;
|
|
112
108
|
visitDefExploreRename(pcx: parse.DefExploreRenameContext): ast.Renames;
|
|
113
109
|
visitFilterClauseList(pcx: parse.FilterClauseListContext): ast.Filter;
|
|
@@ -145,7 +141,6 @@ export declare class MalloyToAST extends AbstractParseTreeVisitor<ast.MalloyElem
|
|
|
145
141
|
visitTopStatement(pcx: parse.TopStatementContext): ast.Limit;
|
|
146
142
|
visitTopLevelQueryDefs(pcx: parse.TopLevelQueryDefsContext): ast.DefineQueryList;
|
|
147
143
|
visitTopLevelQueryDef(pcx: parse.TopLevelQueryDefContext): ast.DefineQuery;
|
|
148
|
-
visitAnonymousQuery(pcx: parse.AnonymousQueryContext): ast.AnonymousQuery;
|
|
149
144
|
visitRunStatement(pcx: parse.RunStatementContext): ast.AnonymousQuery;
|
|
150
145
|
visitNestStatement(pcx: parse.NestStatementContext): ast.Nests;
|
|
151
146
|
visitNestedQueryList(pcx: parse.NestedQueryListContext): ast.Nests;
|
|
@@ -71,7 +71,7 @@ class IgnoredElement extends ast.MalloyElement {
|
|
|
71
71
|
this.malloySrc = src;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
const DEFAULT_COMPILER_FLAGS = [
|
|
74
|
+
const DEFAULT_COMPILER_FLAGS = [];
|
|
75
75
|
/**
|
|
76
76
|
* ANTLR visitor pattern parse tree traversal. Generates a Malloy
|
|
77
77
|
* AST from an ANTLR parse tree.
|
|
@@ -142,19 +142,6 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
142
142
|
this.contextError(cx, 'experiment-not-enabled', { experimentId });
|
|
143
143
|
return false;
|
|
144
144
|
}
|
|
145
|
-
m4Severity() {
|
|
146
|
-
const m4severityTag = this.compilerFlags.tag('m4warnings');
|
|
147
|
-
if (m4severityTag) {
|
|
148
|
-
return m4severityTag.text() === 'warn' ? 'warn' : 'error';
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
m4advisory(cx, code, data) {
|
|
153
|
-
const m4 = this.m4Severity();
|
|
154
|
-
if (m4) {
|
|
155
|
-
this.contextError(cx, code, data, { severity: m4 });
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
145
|
only(els, isGood, desc) {
|
|
159
146
|
const acceptable = [];
|
|
160
147
|
for (const el of els) {
|
|
@@ -218,11 +205,6 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
218
205
|
return result || '';
|
|
219
206
|
}
|
|
220
207
|
makeSqlString(pcx, sqlStr) {
|
|
221
|
-
for (const part of pcx.sqlInterpolation()) {
|
|
222
|
-
if (part.CLOSE_CODE()) {
|
|
223
|
-
this.m4advisory(part, 'percent-terminated-query-interpolation', 'Use %{ ... } instead of %{ ... }%');
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
208
|
for (const part of (0, parse_utils_1.getStringParts)(pcx)) {
|
|
227
209
|
if (part instanceof antlr4ts_1.ParserRuleContext) {
|
|
228
210
|
sqlStr.push(this.visit(part));
|
|
@@ -314,13 +296,7 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
314
296
|
const propList = new ast.SourceDesc(visited);
|
|
315
297
|
return propList;
|
|
316
298
|
}
|
|
317
|
-
|
|
318
|
-
const tableURI = this.getPlainStringFrom(pcx.tableURI());
|
|
319
|
-
const el = this.astAt(new ast.TableFunctionSource(tableURI), pcx);
|
|
320
|
-
this.m4advisory(pcx, 'table-function', "`table('connection_name:table_path')` is deprecated; use `connection_name.table('table_path')`");
|
|
321
|
-
return el;
|
|
322
|
-
}
|
|
323
|
-
visitTableMethod(pcx) {
|
|
299
|
+
visitExploreTable(pcx) {
|
|
324
300
|
const connId = pcx.connectionId();
|
|
325
301
|
const connectionName = this.astAt(this.getModelEntryName(connId), connId);
|
|
326
302
|
const tablePath = this.getPlainStringFrom(pcx.tablePath());
|
|
@@ -506,14 +482,6 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
506
482
|
const el = new ast.ExtendBlock(extensions);
|
|
507
483
|
return this.astAt(el, pcx);
|
|
508
484
|
}
|
|
509
|
-
visitDeclareStatement(pcx) {
|
|
510
|
-
const accessLabel = this.getAccessLabel(pcx.accessLabel());
|
|
511
|
-
const defs = this.getFieldDefs(pcx.defList().fieldDef(), ast.DeclareFieldDeclaration);
|
|
512
|
-
const stmt = new ast.DeclareFields(defs, accessLabel);
|
|
513
|
-
const result = this.astAt(stmt, pcx);
|
|
514
|
-
this.m4advisory(pcx, 'declare', '`declare:` is deprecated; use `dimension:` or `measure:` inside a source or `extend:` block');
|
|
515
|
-
return result;
|
|
516
|
-
}
|
|
517
485
|
visitExploreRenameDef(pcx) {
|
|
518
486
|
const newName = pcx.fieldName(0);
|
|
519
487
|
const oldName = pcx.fieldName(1);
|
|
@@ -549,9 +517,6 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
549
517
|
const queryDefs = new ast.Views(babyTurtles, accessLabel);
|
|
550
518
|
const blockNotes = this.getNotes(pcx.tags());
|
|
551
519
|
queryDefs.extendNote({ blockNotes });
|
|
552
|
-
if (pcx.QUERY()) {
|
|
553
|
-
this.m4advisory(pcx, 'query-in-source', 'Use view: inside of a source instead of query:');
|
|
554
|
-
}
|
|
555
520
|
return queryDefs;
|
|
556
521
|
}
|
|
557
522
|
visitDefExplorePrimaryKey(pcx) {
|
|
@@ -688,9 +653,6 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
688
653
|
return this.astAt(new ast.ProjectStatement(fields), pcx);
|
|
689
654
|
}
|
|
690
655
|
visitProjectStatement(pcx) {
|
|
691
|
-
if (pcx.PROJECT()) {
|
|
692
|
-
this.m4advisory(pcx, 'project', 'project: keyword is deprecated, use select:');
|
|
693
|
-
}
|
|
694
656
|
const stmt = this.visitFieldCollection(pcx.fieldCollection());
|
|
695
657
|
stmt.extendNote({ blockNotes: this.getNotes(pcx.tags()) });
|
|
696
658
|
return stmt;
|
|
@@ -795,16 +757,6 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
795
757
|
}
|
|
796
758
|
throw this.internalError(pcx, `Expected query definition, got a '${queryExpr.elementType}'`);
|
|
797
759
|
}
|
|
798
|
-
visitAnonymousQuery(pcx) {
|
|
799
|
-
const defCx = pcx.topLevelAnonQueryDef();
|
|
800
|
-
const query = this.getSqExpr(defCx.sqExpr());
|
|
801
|
-
const theQuery = this.astAt(new ast.AnonymousQuery(query), defCx);
|
|
802
|
-
const notes = this.getNotes(pcx.topLevelAnonQueryDef().tags());
|
|
803
|
-
const blockNotes = this.getNotes(pcx.tags());
|
|
804
|
-
theQuery.extendNote({ notes, blockNotes });
|
|
805
|
-
this.m4advisory(defCx, 'anonymous-query', 'Anonymous `query:` statements are deprecated, use `run:` instead');
|
|
806
|
-
return this.astAt(theQuery, pcx);
|
|
807
|
-
}
|
|
808
760
|
visitRunStatement(pcx) {
|
|
809
761
|
const defCx = pcx.topLevelAnonQueryDef();
|
|
810
762
|
const query = this.getSqExpr(defCx.sqExpr());
|
|
@@ -1041,9 +993,6 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
1041
993
|
const expr = exprDef ? this.getFieldExpr(exprDef) : undefined;
|
|
1042
994
|
const source = undefined;
|
|
1043
995
|
const aggFunc = pcx.aggregate().text.toLowerCase();
|
|
1044
|
-
if (pcx.STAR()) {
|
|
1045
|
-
this.m4advisory(pcx, 'wildcard-in-aggregate', `* illegal inside ${aggFunc}()`);
|
|
1046
|
-
}
|
|
1047
996
|
if (aggFunc === 'count') {
|
|
1048
997
|
return this.astAt(expr ? new ast.ExprCountDistinct(expr) : new ast.ExprCount(), pcx);
|
|
1049
998
|
}
|
|
@@ -64,15 +64,6 @@ class DocumentSymbolWalker {
|
|
|
64
64
|
lensRange: this.translator.rangeFromContext(pcx),
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
enterAnonymousQuery(pcx) {
|
|
68
|
-
this.symbols.push({
|
|
69
|
-
range: this.translator.rangeFromContext(pcx.topLevelAnonQueryDef().sqExpr()),
|
|
70
|
-
name: 'unnamed_query',
|
|
71
|
-
type: 'unnamed_query',
|
|
72
|
-
children: [],
|
|
73
|
-
lensRange: this.translator.rangeFromContext(pcx),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
67
|
enterDefineSourceStatement(pcx) {
|
|
77
68
|
const blockRange = this.translator.rangeFromContext(pcx);
|
|
78
69
|
const sourcePl = pcx.sourcePropertyList();
|
|
@@ -62,20 +62,12 @@ class FindExternalReferences {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
enterExploreTable(pcx) {
|
|
66
66
|
const connId = (0, parse_utils_1.getId)(pcx.connectionId());
|
|
67
67
|
const tablePath = getPlainString(pcx.tablePath());
|
|
68
68
|
const reference = this.trans.rangeFromContext(pcx);
|
|
69
69
|
this.registerTableReference(connId, tablePath, reference);
|
|
70
70
|
}
|
|
71
|
-
enterTableFunction(pcx) {
|
|
72
|
-
const tableURI = getPlainString(pcx.tableURI());
|
|
73
|
-
// This use of `deprecatedParseTableURI` is ok because it is for handling the
|
|
74
|
-
// old, soon-to-be-deprecated table syntax.
|
|
75
|
-
const { connectionName, tablePath } = deprecatedParseTableURI(tableURI);
|
|
76
|
-
const reference = this.trans.rangeFromContext(pcx);
|
|
77
|
-
this.registerTableReference(connectionName, tablePath, reference);
|
|
78
|
-
}
|
|
79
71
|
enterImportURL(pcx) {
|
|
80
72
|
const url = getPlainString(pcx);
|
|
81
73
|
if (!this.needImports[url]) {
|
|
@@ -31,7 +31,7 @@ class FindTablePathWalker {
|
|
|
31
31
|
this.tokens = tokens;
|
|
32
32
|
this.pathInfos = [];
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
enterExploreTable(pcx) {
|
|
35
35
|
const connectionId = (0, parse_utils_1.getId)(pcx.connectionId());
|
|
36
36
|
const [tablePath, _errorList] = (0, parse_utils_1.getPlainString)(pcx.tablePath(), true);
|
|
37
37
|
if (tablePath !== undefined) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MALLOY_VERSION = "0.0.
|
|
1
|
+
export declare const MALLOY_VERSION = "0.0.249";
|
package/dist/version.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MALLOY_VERSION = void 0;
|
|
4
4
|
// generated with 'generate-version-file' script; do not edit manually
|
|
5
|
-
exports.MALLOY_VERSION = '0.0.
|
|
5
|
+
exports.MALLOY_VERSION = '0.0.249';
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/malloy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.249-dev250326193717",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@malloydata/malloy-filter": "^0.0.
|
|
45
|
-
"@malloydata/malloy-interfaces": "^0.0.
|
|
46
|
-
"@malloydata/malloy-tag": "^0.0.
|
|
44
|
+
"@malloydata/malloy-filter": "^0.0.249-dev250326193717",
|
|
45
|
+
"@malloydata/malloy-interfaces": "^0.0.249-dev250326193717",
|
|
46
|
+
"@malloydata/malloy-tag": "^0.0.249-dev250326193717",
|
|
47
47
|
"antlr4ts": "^0.5.0-alpha.4",
|
|
48
48
|
"assert": "^2.0.0",
|
|
49
49
|
"jest-diff": "^29.6.2",
|