@malloydata/malloy 0.0.398 → 0.0.399

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.
@@ -122,6 +122,8 @@ import { ImportStatementContext } from "./MalloyParser";
122
122
  import { ImportSelectContext } from "./MalloyParser";
123
123
  import { ImportItemContext } from "./MalloyParser";
124
124
  import { ImportURLContext } from "./MalloyParser";
125
+ import { ExportStatementContext } from "./MalloyParser";
126
+ import { ExportItemContext } from "./MalloyParser";
125
127
  import { DocAnnotationsContext } from "./MalloyParser";
126
128
  import { IgnoredObjectAnnotationsContext } from "./MalloyParser";
127
129
  import { IgnoredModelAnnotationsContext } from "./MalloyParser";
@@ -1690,6 +1692,26 @@ export interface MalloyParserListener extends ParseTreeListener {
1690
1692
  * @param ctx the parse tree
1691
1693
  */
1692
1694
  exitImportURL?: (ctx: ImportURLContext) => void;
1695
+ /**
1696
+ * Enter a parse tree produced by `MalloyParser.exportStatement`.
1697
+ * @param ctx the parse tree
1698
+ */
1699
+ enterExportStatement?: (ctx: ExportStatementContext) => void;
1700
+ /**
1701
+ * Exit a parse tree produced by `MalloyParser.exportStatement`.
1702
+ * @param ctx the parse tree
1703
+ */
1704
+ exitExportStatement?: (ctx: ExportStatementContext) => void;
1705
+ /**
1706
+ * Enter a parse tree produced by `MalloyParser.exportItem`.
1707
+ * @param ctx the parse tree
1708
+ */
1709
+ enterExportItem?: (ctx: ExportItemContext) => void;
1710
+ /**
1711
+ * Exit a parse tree produced by `MalloyParser.exportItem`.
1712
+ * @param ctx the parse tree
1713
+ */
1714
+ exitExportItem?: (ctx: ExportItemContext) => void;
1693
1715
  /**
1694
1716
  * Enter a parse tree produced by `MalloyParser.docAnnotations`.
1695
1717
  * @param ctx the parse tree
@@ -122,6 +122,8 @@ import { ImportStatementContext } from "./MalloyParser";
122
122
  import { ImportSelectContext } from "./MalloyParser";
123
123
  import { ImportItemContext } from "./MalloyParser";
124
124
  import { ImportURLContext } from "./MalloyParser";
125
+ import { ExportStatementContext } from "./MalloyParser";
126
+ import { ExportItemContext } from "./MalloyParser";
125
127
  import { DocAnnotationsContext } from "./MalloyParser";
126
128
  import { IgnoredObjectAnnotationsContext } from "./MalloyParser";
127
129
  import { IgnoredModelAnnotationsContext } from "./MalloyParser";
@@ -1110,6 +1112,18 @@ export interface MalloyParserVisitor<Result> extends ParseTreeVisitor<Result> {
1110
1112
  * @return the visitor result
1111
1113
  */
1112
1114
  visitImportURL?: (ctx: ImportURLContext) => Result;
1115
+ /**
1116
+ * Visit a parse tree produced by `MalloyParser.exportStatement`.
1117
+ * @param ctx the parse tree
1118
+ * @return the visitor result
1119
+ */
1120
+ visitExportStatement?: (ctx: ExportStatementContext) => Result;
1121
+ /**
1122
+ * Visit a parse tree produced by `MalloyParser.exportItem`.
1123
+ * @param ctx the parse tree
1124
+ * @return the visitor result
1125
+ */
1126
+ visitExportItem?: (ctx: ExportItemContext) => Result;
1113
1127
  /**
1114
1128
  * Visit a parse tree produced by `MalloyParser.docAnnotations`.
1115
1129
  * @param ctx the parse tree
@@ -249,6 +249,7 @@ export declare class MalloyToAST extends AbstractParseTreeVisitor<ast.MalloyElem
249
249
  visitLiteralMonth(pcx: parse.LiteralMonthContext): ast.ExpressionDef;
250
250
  visitLiteralQuarter(pcx: parse.LiteralQuarterContext): ast.ExpressionDef;
251
251
  visitLiteralYear(pcx: parse.LiteralYearContext): ast.ExpressionDef;
252
+ visitExportStatement(pcx: parse.ExportStatementContext): ast.ExportStatement;
252
253
  visitImportStatement(pcx: parse.ImportStatementContext): ast.ImportStatement;
253
254
  visitDebugExpr(pcx: parse.DebugExprContext): ast.ExpressionDef;
254
255
  visitSampleStatement(pcx: parse.SampleStatementContext): ast.SampleProperty;
@@ -1482,6 +1482,13 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
1482
1482
  visitLiteralYear(pcx) {
1483
1483
  return this.parseTime(pcx, ast.LiteralYear.parse);
1484
1484
  }
1485
+ visitExportStatement(pcx) {
1486
+ const items = pcx.exportItem().map(itemCx => {
1487
+ const idCx = itemCx.id();
1488
+ return this.astAt(new ast.ExportItem((0, parse_utils_1.idToStr)(idCx)), idCx);
1489
+ });
1490
+ return this.astAt(new ast.ExportStatement(items), pcx);
1491
+ }
1485
1492
  visitImportStatement(pcx) {
1486
1493
  const url = this.getPlainStringFrom(pcx.importURL());
1487
1494
  const importStmt = this.astAt(new ast.ImportStatement(url, this.parseInfo.importBaseURL), pcx);
@@ -281,6 +281,9 @@ type MessageParameterTypes = {
281
281
  'selective-import-not-found': string;
282
282
  'name-conflict-on-indiscriminate-import': string;
283
283
  'failed-import': string;
284
+ 'export-name-not-defined': string;
285
+ 'export-name-not-exportable': string;
286
+ 'duplicate-export-name': string;
284
287
  'unsatisfied-given-in-query': string;
285
288
  'given-alias-collision': string;
286
289
  'failed-to-compute-output-schema': string;
@@ -306,7 +306,7 @@ class TemporalFilterCompiler {
306
306
  this.qi = queryInfo;
307
307
  }
308
308
  time(timeSQL) {
309
- if (this.timetype === 'timestamp') {
309
+ if (this.timetype !== 'date') {
310
310
  return timeSQL;
311
311
  }
312
312
  return this.d.sqlCast({}, {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const MALLOY_VERSION = "0.0.398";
1
+ export declare const MALLOY_VERSION = "0.0.399";
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.398';
5
+ exports.MALLOY_VERSION = '0.0.399';
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.398",
3
+ "version": "0.0.399",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -51,9 +51,9 @@
51
51
  "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"
52
52
  },
53
53
  "dependencies": {
54
- "@malloydata/malloy-filter": "0.0.398",
55
- "@malloydata/malloy-interfaces": "0.0.398",
56
- "@malloydata/malloy-tag": "0.0.398",
54
+ "@malloydata/malloy-filter": "0.0.399",
55
+ "@malloydata/malloy-interfaces": "0.0.399",
56
+ "@malloydata/malloy-tag": "0.0.399",
57
57
  "@noble/hashes": "^1.8.0",
58
58
  "antlr4ts": "^0.5.0-alpha.4",
59
59
  "assert": "^2.0.0",