@malloydata/malloy 0.0.43 → 0.0.44-dev230623185845

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 (102) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.js +3 -1
  3. package/dist/lang/ast/elements/define-query.d.ts +7 -1
  4. package/dist/lang/ast/elements/define-query.js +10 -1
  5. package/dist/lang/ast/elements/define-source.d.ts +7 -1
  6. package/dist/lang/ast/elements/define-source.js +16 -9
  7. package/dist/lang/ast/elements/pipeline-desc.d.ts +2 -1
  8. package/dist/lang/ast/elements/pipeline-desc.js +6 -2
  9. package/dist/lang/ast/elements/refined-source.d.ts +5 -4
  10. package/dist/lang/ast/elements/refined-source.js +5 -0
  11. package/dist/lang/ast/expressions/expr-id-reference.js +4 -4
  12. package/dist/lang/ast/field-space/column-space-field.d.ts +1 -1
  13. package/dist/lang/ast/field-space/column-space-field.js +3 -3
  14. package/dist/lang/ast/field-space/field-definition-value.d.ts +1 -1
  15. package/dist/lang/ast/field-space/field-definition-value.js +16 -10
  16. package/dist/lang/ast/field-space/query-field-struct.js +1 -0
  17. package/dist/lang/ast/field-space/query-spaces.js +4 -1
  18. package/dist/lang/ast/field-space/reference-field.d.ts +8 -2
  19. package/dist/lang/ast/field-space/reference-field.js +51 -9
  20. package/dist/lang/ast/index.d.ts +2 -2
  21. package/dist/lang/ast/index.js +2 -2
  22. package/dist/lang/ast/query-elements/anonymous-query.d.ts +6 -1
  23. package/dist/lang/ast/query-elements/anonymous-query.js +8 -0
  24. package/dist/lang/ast/query-elements/existing-query.js +3 -0
  25. package/dist/lang/ast/query-elements/full-query.js +7 -4
  26. package/dist/lang/ast/query-elements/run-query.d.ts +6 -1
  27. package/dist/lang/ast/query-elements/run-query.js +11 -1
  28. package/dist/lang/ast/query-items/field-declaration.d.ts +6 -2
  29. package/dist/lang/ast/query-items/field-declaration.js +6 -0
  30. package/dist/lang/ast/query-items/field-references.d.ts +13 -5
  31. package/dist/lang/ast/query-items/field-references.js +10 -4
  32. package/dist/lang/ast/query-properties/aggregate.d.ts +3 -3
  33. package/dist/lang/ast/query-properties/aggregate.js +5 -4
  34. package/dist/lang/ast/query-properties/calculate.d.ts +3 -3
  35. package/dist/lang/ast/query-properties/calculate.js +5 -4
  36. package/dist/lang/ast/query-properties/declare-fields.d.ts +4 -3
  37. package/dist/lang/ast/query-properties/declare-fields.js +5 -4
  38. package/dist/lang/ast/query-properties/dimensions.d.ts +4 -0
  39. package/dist/lang/ast/query-properties/{dimmensions.js → dimensions.js} +4 -3
  40. package/dist/lang/ast/query-properties/extend.d.ts +1 -1
  41. package/dist/lang/ast/query-properties/extend.js +3 -2
  42. package/dist/lang/ast/query-properties/filters.d.ts +0 -1
  43. package/dist/lang/ast/query-properties/filters.js +2 -2
  44. package/dist/lang/ast/query-properties/group-by.d.ts +3 -3
  45. package/dist/lang/ast/query-properties/group-by.js +5 -4
  46. package/dist/lang/ast/query-properties/joins.d.ts +10 -4
  47. package/dist/lang/ast/query-properties/joins.js +16 -2
  48. package/dist/lang/ast/query-properties/measures.d.ts +1 -2
  49. package/dist/lang/ast/query-properties/measures.js +3 -2
  50. package/dist/lang/ast/query-properties/nest.d.ts +5 -1
  51. package/dist/lang/ast/query-properties/nest.js +11 -1
  52. package/dist/lang/ast/query-properties/nests.d.ts +3 -2
  53. package/dist/lang/ast/query-properties/nests.js +4 -3
  54. package/dist/lang/ast/query-properties/ordering.d.ts +1 -0
  55. package/dist/lang/ast/query-properties/ordering.js +2 -1
  56. package/dist/lang/ast/query-properties/project-statement.d.ts +3 -3
  57. package/dist/lang/ast/query-properties/project-statement.js +5 -4
  58. package/dist/lang/ast/query-properties/qop-desc.d.ts +1 -1
  59. package/dist/lang/ast/query-properties/qop-desc.js +3 -2
  60. package/dist/lang/ast/source-properties/renames.d.ts +1 -1
  61. package/dist/lang/ast/source-properties/renames.js +3 -2
  62. package/dist/lang/ast/source-properties/turtles.d.ts +3 -3
  63. package/dist/lang/ast/source-properties/turtles.js +5 -4
  64. package/dist/lang/ast/types/definition-list.d.ts +10 -0
  65. package/dist/lang/ast/types/definition-list.js +52 -0
  66. package/dist/lang/ast/types/malloy-element.d.ts +21 -6
  67. package/dist/lang/ast/types/malloy-element.js +45 -13
  68. package/dist/lang/ast/types/noteable.d.ts +12 -0
  69. package/dist/lang/ast/types/noteable.js +42 -0
  70. package/dist/lang/ast/types/query-extend-property.d.ts +1 -1
  71. package/dist/lang/ast/types/query-extend-property.js +2 -2
  72. package/dist/lang/ast/types/query-property.d.ts +3 -2
  73. package/dist/lang/ast/types/query-property.js +2 -0
  74. package/dist/lang/ast/types/source-desc.d.ts +5 -0
  75. package/dist/lang/ast/types/{explore-desc.js → source-desc.js} +7 -6
  76. package/dist/lang/ast/types/source-property.d.ts +2 -2
  77. package/dist/lang/ast/types/source-property.js +2 -0
  78. package/dist/lang/ast/types/space-field.d.ts +1 -0
  79. package/dist/lang/lib/Malloy/MalloyLexer.d.ts +56 -54
  80. package/dist/lang/lib/Malloy/MalloyLexer.js +1051 -1042
  81. package/dist/lang/lib/Malloy/MalloyParser.d.ts +326 -182
  82. package/dist/lang/lib/Malloy/MalloyParser.js +2894 -1718
  83. package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +133 -19
  84. package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +83 -11
  85. package/dist/lang/malloy-to-ast.d.ts +23 -10
  86. package/dist/lang/malloy-to-ast.js +144 -122
  87. package/dist/lang/parse-tree-walkers/document-symbol-walker.js +2 -1
  88. package/dist/lang/test/annotation.spec.d.ts +1 -0
  89. package/dist/lang/test/annotation.spec.js +565 -0
  90. package/dist/lang/test/parse.spec.js +20 -19
  91. package/dist/lang/test/test-translator.d.ts +2 -2
  92. package/dist/lang/test/test-translator.js +27 -15
  93. package/dist/malloy.d.ts +11 -5
  94. package/dist/malloy.js +16 -0
  95. package/dist/model/malloy_query.js +10 -0
  96. package/dist/model/malloy_types.d.ts +19 -2
  97. package/dist/model/malloy_types.js +1 -1
  98. package/dist/tags.d.ts +21 -0
  99. package/dist/tags.js +155 -0
  100. package/package.json +1 -1
  101. package/dist/lang/ast/query-properties/dimmensions.d.ts +0 -5
  102. package/dist/lang/ast/types/explore-desc.d.ts +0 -5
@@ -0,0 +1,52 @@
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.DefinitionList = void 0;
26
+ const malloy_element_1 = require("./malloy-element");
27
+ const noteable_1 = require("../types/noteable");
28
+ class DefinitionList extends malloy_element_1.ListOf {
29
+ constructor() {
30
+ super(...arguments);
31
+ this.isNoteableObj = true;
32
+ }
33
+ extendNote(ext) {
34
+ (0, noteable_1.extendNoteHelper)(this, ext);
35
+ this.distributeAnnotation();
36
+ }
37
+ distributeAnnotation() {
38
+ if (this.note) {
39
+ for (const el of this.elements) {
40
+ if ((0, noteable_1.isNoteable)(el)) {
41
+ el.extendNote(this.note);
42
+ }
43
+ }
44
+ }
45
+ }
46
+ newContents() {
47
+ super.newContents();
48
+ this.distributeAnnotation();
49
+ }
50
+ }
51
+ exports.DefinitionList = DefinitionList;
52
+ //# sourceMappingURL=definition-list.js.map
@@ -1,10 +1,11 @@
1
- import { DocumentLocation, DocumentReference, ModelDef, Query, SQLBlockStructDef } from '../../../model/malloy_types';
1
+ import { Annotation, DocumentLocation, DocumentReference, ModelDef, Query, SQLBlockStructDef } from '../../../model/malloy_types';
2
2
  import { LogSeverity } from '../../parse-log';
3
3
  import { MalloyTranslation } from '../../parse-malloy';
4
4
  import { ModelDataRequest } from '../../translate-response';
5
5
  import { DocumentCompileResult } from './document-compile-result';
6
6
  import { ModelEntry } from './model-entry';
7
7
  import { NameSpace } from './name-space';
8
+ import { Noteable, extendNoteMethod } from './noteable';
8
9
  export declare abstract class MalloyElement {
9
10
  abstract elementType: string;
10
11
  codeLocation?: DocumentLocation;
@@ -62,18 +63,22 @@ export interface DocStatement extends MalloyElement {
62
63
  execute(doc: Document): ModelDataRequest;
63
64
  }
64
65
  export declare function isDocStatement(e: MalloyElement): e is DocStatement;
65
- export declare class ListOf<ET extends MalloyElement> extends MalloyElement {
66
+ export declare abstract class ListOf<ET extends MalloyElement> extends MalloyElement {
66
67
  protected elements: ET[];
67
- elementType: string;
68
- constructor(listDesc: string, elements: ET[]);
69
- private newContents;
68
+ constructor(elements: ET[]);
69
+ protected newContents(): void;
70
70
  get list(): ET[];
71
71
  empty(): boolean;
72
72
  notEmpty(): boolean;
73
73
  push(...el: ET[]): ET[];
74
74
  }
75
- export declare class RunList extends ListOf<DocStatement> {
75
+ export declare class RunList extends ListOf<DocStatement> implements Noteable {
76
+ elementType: string;
76
77
  execCursor: number;
78
+ readonly isNoteableObj = true;
79
+ extendNote: typeof extendNoteMethod;
80
+ note?: Annotation;
81
+ noteCursor: number;
77
82
  executeList(doc: Document): ModelDataRequest;
78
83
  }
79
84
  /**
@@ -97,6 +102,7 @@ export declare class Document extends MalloyElement implements NameSpace {
97
102
  sqlBlocks: SQLBlockStructDef[];
98
103
  statements: RunList;
99
104
  didInitModel: boolean;
105
+ notes: string[];
100
106
  constructor(statements: DocStatement[]);
101
107
  initModelDef(extendingModelDef: ModelDef | undefined): void;
102
108
  compile(): DocumentCompileResult;
@@ -105,4 +111,13 @@ export declare class Document extends MalloyElement implements NameSpace {
105
111
  getEntry(str: string): ModelEntry;
106
112
  setEntry(str: string, ent: ModelEntry): void;
107
113
  }
114
+ export declare class ObjectAnnotation extends MalloyElement {
115
+ readonly notes: string[];
116
+ elementType: string;
117
+ constructor(notes: string[]);
118
+ }
119
+ export declare class ModelAnnotation extends ObjectAnnotation implements DocStatement {
120
+ elementType: string;
121
+ execute(doc: Document): ModelDataRequest;
122
+ }
108
123
  export {};
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Document = exports.RunList = exports.ListOf = exports.isDocStatement = exports.ModelEntryReference = exports.Unimplemented = exports.MalloyElement = void 0;
6
+ exports.ModelAnnotation = exports.ObjectAnnotation = exports.Document = exports.RunList = exports.ListOf = exports.isDocStatement = exports.ModelEntryReference = exports.Unimplemented = exports.MalloyElement = void 0;
7
7
  /*
8
8
  * Copyright 2023 Google LLC
9
9
  *
@@ -29,6 +29,7 @@ exports.Document = exports.RunList = exports.ListOf = exports.isDocStatement = e
29
29
  const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
30
30
  const malloy_types_1 = require("../../../model/malloy_types");
31
31
  const global_name_space_1 = require("./global-name-space");
32
+ const noteable_1 = require("./noteable");
32
33
  class MalloyElement {
33
34
  /**
34
35
  * @param kids All children passed to the constructor are not optional
@@ -262,17 +263,13 @@ function isDocStatement(e) {
262
263
  }
263
264
  exports.isDocStatement = isDocStatement;
264
265
  class ListOf extends MalloyElement {
265
- constructor(listDesc, elements) {
266
+ constructor(elements) {
266
267
  super();
267
268
  this.elements = elements;
268
- this.elementType = 'genericElementList';
269
- if (this.elementType === 'genericElementList') {
270
- this.elementType = listDesc;
271
- }
272
269
  this.newContents();
273
270
  }
274
271
  newContents() {
275
- this.has({ [this.elementType]: this.elements });
272
+ this.has({ listOf: this.elements });
276
273
  }
277
274
  get list() {
278
275
  return this.elements;
@@ -293,18 +290,30 @@ exports.ListOf = ListOf;
293
290
  class RunList extends ListOf {
294
291
  constructor() {
295
292
  super(...arguments);
293
+ this.elementType = 'topLevelStatements';
296
294
  this.execCursor = 0;
295
+ this.isNoteableObj = true;
296
+ this.extendNote = noteable_1.extendNoteMethod;
297
+ this.noteCursor = 0;
297
298
  }
298
299
  executeList(doc) {
299
300
  while (this.execCursor < this.elements.length) {
300
301
  const el = this.elements[this.execCursor];
301
- if (isDocStatement(el)) {
302
- const resp = el.execute(doc);
303
- if (resp) {
304
- return resp;
302
+ if (this.noteCursor === this.execCursor) {
303
+ // We only want to set the note on each element once,
304
+ // but we might execute a element multiple times
305
+ if (this.note && (0, noteable_1.isNoteable)(el)) {
306
+ el.extendNote(this.note);
305
307
  }
306
- this.execCursor += 1;
308
+ this.noteCursor += 1;
309
+ }
310
+ const resp = el.execute(doc);
311
+ if (resp) {
312
+ // Statment needs information (likely SQL schema) so we return
313
+ // the response, and will come back here later
314
+ return resp;
307
315
  }
316
+ this.execCursor += 1;
308
317
  }
309
318
  return undefined;
310
319
  }
@@ -332,7 +341,8 @@ class Document extends MalloyElement {
332
341
  this.queryList = [];
333
342
  this.sqlBlocks = [];
334
343
  this.didInitModel = false;
335
- this.statements = new RunList('topLevelStatements', statements);
344
+ this.notes = [];
345
+ this.statements = new RunList(statements);
336
346
  this.has({ statements: statements });
337
347
  }
338
348
  initModelDef(extendingModelDef) {
@@ -376,6 +386,9 @@ class Document extends MalloyElement {
376
386
  def.contents[entry] = (0, cloneDeep_1.default)(entryDef);
377
387
  }
378
388
  }
389
+ if (this.notes.length > 0) {
390
+ def.annotation = { notes: this.notes };
391
+ }
379
392
  return def;
380
393
  }
381
394
  defineSQL(sql, name) {
@@ -407,4 +420,23 @@ class Document extends MalloyElement {
407
420
  }
408
421
  }
409
422
  exports.Document = Document;
423
+ class ObjectAnnotation extends MalloyElement {
424
+ constructor(notes) {
425
+ super();
426
+ this.notes = notes;
427
+ this.elementType = 'annotation';
428
+ }
429
+ }
430
+ exports.ObjectAnnotation = ObjectAnnotation;
431
+ class ModelAnnotation extends ObjectAnnotation {
432
+ constructor() {
433
+ super(...arguments);
434
+ this.elementType = 'modelAnnotation';
435
+ }
436
+ execute(doc) {
437
+ doc.notes = doc.notes.concat(this.notes);
438
+ return;
439
+ }
440
+ }
441
+ exports.ModelAnnotation = ModelAnnotation;
410
442
  //# sourceMappingURL=malloy-element.js.map
@@ -0,0 +1,12 @@
1
+ import { Annotation } from '../../../model/malloy_types';
2
+ /**
3
+ * An object which can receive annotations is "Noteable"
4
+ */
5
+ export interface Noteable {
6
+ isNoteableObj: true;
7
+ note?: Annotation;
8
+ extendNote(ext: Partial<Annotation>): void;
9
+ }
10
+ export declare function isNoteable(el: unknown): el is Noteable;
11
+ export declare function extendNoteMethod(this: Noteable, ext: Partial<Annotation>): void;
12
+ export declare function extendNoteHelper(to: Noteable, ext: Partial<Annotation>): void;
@@ -0,0 +1,42 @@
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.extendNoteHelper = exports.extendNoteMethod = exports.isNoteable = void 0;
26
+ function isNoteable(el) {
27
+ return el.isNoteableObj;
28
+ }
29
+ exports.isNoteable = isNoteable;
30
+ function extendNoteMethod(ext) {
31
+ extendNoteHelper(this, ext);
32
+ }
33
+ exports.extendNoteMethod = extendNoteMethod;
34
+ function extendNoteHelper(to, ext) {
35
+ if ((ext.notes && ext.notes.length > 0) ||
36
+ (ext.blockNotes && ext.blockNotes.length > 0) ||
37
+ ext.inherits !== undefined) {
38
+ to.note = { ...to.note, ...ext };
39
+ }
40
+ }
41
+ exports.extendNoteHelper = extendNoteHelper;
42
+ //# sourceMappingURL=noteable.js.map
@@ -1,4 +1,4 @@
1
- import { Dimensions } from '../query-properties/dimmensions';
1
+ import { Dimensions } from '../query-properties/dimensions';
2
2
  import { Joins } from '../query-properties/joins';
3
3
  import { Measures } from '../query-properties/measures';
4
4
  import { MalloyElement } from './malloy-element';
@@ -23,11 +23,11 @@
23
23
  */
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.isQueryExtendProperty = void 0;
26
- const dimmensions_1 = require("../query-properties/dimmensions");
26
+ const dimensions_1 = require("../query-properties/dimensions");
27
27
  const joins_1 = require("../query-properties/joins");
28
28
  const measures_1 = require("../query-properties/measures");
29
29
  function isQueryExtendProperty(q) {
30
- return q instanceof dimmensions_1.Dimensions || q instanceof measures_1.Measures || q instanceof joins_1.Joins;
30
+ return q instanceof dimensions_1.Dimensions || q instanceof measures_1.Measures || q instanceof joins_1.Joins;
31
31
  }
32
32
  exports.isQueryExtendProperty = isQueryExtendProperty;
33
33
  //# sourceMappingURL=query-extend-property.js.map
@@ -1,6 +1,6 @@
1
1
  import { NestDefinition } from '../query-properties/nest';
2
2
  import { NestReference } from '../query-properties/nest-reference';
3
- import { MalloyElement } from './malloy-element';
3
+ import { MalloyElement, ObjectAnnotation } from './malloy-element';
4
4
  import { Aggregate } from '../query-properties/aggregate';
5
5
  import { DeclareFields } from '../query-properties/declare-fields';
6
6
  import { Filter } from '../query-properties/filters';
@@ -13,6 +13,7 @@ import { Ordering } from '../query-properties/ordering';
13
13
  import { ProjectStatement } from '../query-properties/project-statement';
14
14
  import { SampleProperty } from '../query-properties/sampling';
15
15
  import { Top } from '../query-properties/top';
16
+ import { TimezoneStatement } from '../source-properties/timezone-statement';
16
17
  import { ExtendBlock } from '../query-properties/extend';
17
- export declare type QueryProperty = Ordering | Top | Limit | Filter | Index | SampleProperty | Joins | DeclareFields | ProjectStatement | NestReference | NestDefinition | NestReference | Nests | Aggregate | GroupBy | ExtendBlock;
18
+ export declare type QueryProperty = Ordering | Top | Limit | Filter | Index | SampleProperty | Joins | DeclareFields | ProjectStatement | NestReference | NestDefinition | NestReference | Nests | Aggregate | GroupBy | ObjectAnnotation | TimezoneStatement | GroupBy | ExtendBlock;
18
19
  export declare function isQueryProperty(q: MalloyElement): q is QueryProperty;
@@ -24,6 +24,7 @@
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.isQueryProperty = void 0;
26
26
  const nest_1 = require("../query-properties/nest");
27
+ const malloy_element_1 = require("./malloy-element");
27
28
  const aggregate_1 = require("../query-properties/aggregate");
28
29
  const declare_fields_1 = require("../query-properties/declare-fields");
29
30
  const filters_1 = require("../query-properties/filters");
@@ -53,6 +54,7 @@ function isQueryProperty(q) {
53
54
  q instanceof calculate_1.Calculate ||
54
55
  q instanceof nests_1.Nests ||
55
56
  q instanceof extend_1.ExtendBlock ||
57
+ q instanceof malloy_element_1.ObjectAnnotation ||
56
58
  (0, nest_1.isNestedQuery)(q) ||
57
59
  q instanceof group_by_1.GroupBy ||
58
60
  q instanceof timezone_statement_1.TimezoneStatement);
@@ -0,0 +1,5 @@
1
+ import { SourceProperty } from './source-property';
2
+ import { ListOf } from './malloy-element';
3
+ export declare class SourceDesc extends ListOf<SourceProperty> {
4
+ elementType: string;
5
+ }
@@ -22,12 +22,13 @@
22
22
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.ExploreDesc = void 0;
25
+ exports.SourceDesc = void 0;
26
26
  const malloy_element_1 = require("./malloy-element");
27
- class ExploreDesc extends malloy_element_1.ListOf {
28
- constructor(props) {
29
- super('exploreDesc', props);
27
+ class SourceDesc extends malloy_element_1.ListOf {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.elementType = 'sourceDescription';
30
31
  }
31
32
  }
32
- exports.ExploreDesc = ExploreDesc;
33
- //# sourceMappingURL=explore-desc.js.map
33
+ exports.SourceDesc = SourceDesc;
34
+ //# sourceMappingURL=source-desc.js.map
@@ -5,7 +5,7 @@ import { FieldListEdit } from '../source-properties/field-list-edit';
5
5
  import { Renames } from '../source-properties/renames';
6
6
  import { PrimaryKey } from '../source-properties/primary-key';
7
7
  import { Turtles } from '../source-properties/turtles';
8
- import { MalloyElement } from './malloy-element';
8
+ import { MalloyElement, ObjectAnnotation } from './malloy-element';
9
9
  import { TimezoneStatement } from '../source-properties/timezone-statement';
10
- export declare type SourceProperty = Filter | Joins | DeclareFields | FieldListEdit | Renames | PrimaryKey | Turtles | TimezoneStatement;
10
+ export declare type SourceProperty = Filter | Joins | DeclareFields | FieldListEdit | Renames | PrimaryKey | ObjectAnnotation | Turtles | TimezoneStatement;
11
11
  export declare function isSourceProperty(p: MalloyElement): p is SourceProperty;
@@ -30,6 +30,7 @@ const field_list_edit_1 = require("../source-properties/field-list-edit");
30
30
  const renames_1 = require("../source-properties/renames");
31
31
  const primary_key_1 = require("../source-properties/primary-key");
32
32
  const turtles_1 = require("../source-properties/turtles");
33
+ const malloy_element_1 = require("./malloy-element");
33
34
  const timezone_statement_1 = require("../source-properties/timezone-statement");
34
35
  function isSourceProperty(p) {
35
36
  return (p instanceof filters_1.Filter ||
@@ -38,6 +39,7 @@ function isSourceProperty(p) {
38
39
  p instanceof field_list_edit_1.FieldListEdit ||
39
40
  p instanceof renames_1.Renames ||
40
41
  p instanceof primary_key_1.PrimaryKey ||
42
+ p instanceof malloy_element_1.ObjectAnnotation ||
41
43
  p instanceof turtles_1.Turtles ||
42
44
  p instanceof timezone_statement_1.TimezoneStatement);
43
45
  }
@@ -3,6 +3,7 @@ import { SpaceEntry } from './space-entry';
3
3
  import { FieldSpace } from './field-space';
4
4
  export declare abstract class SpaceField extends SpaceEntry {
5
5
  readonly refType = "field";
6
+ haveFieldDef?: FieldDef;
6
7
  protected fieldTypeFromFieldDef(def: FieldDef): TypeDesc;
7
8
  getQueryFieldDef(_fs: FieldSpace): QueryFieldDef | undefined;
8
9
  fieldDef(): FieldDef | undefined;
@@ -93,60 +93,62 @@ export declare class MalloyLexer extends Lexer {
93
93
  static readonly STRING_ESCAPE = 88;
94
94
  static readonly HACKY_REGEX = 89;
95
95
  static readonly STRING_LITERAL = 90;
96
- static readonly AMPER = 91;
97
- static readonly ARROW = 92;
98
- static readonly FAT_ARROW = 93;
99
- static readonly OPAREN = 94;
100
- static readonly CPAREN = 95;
101
- static readonly OBRACK = 96;
102
- static readonly CBRACK = 97;
103
- static readonly OCURLY = 98;
104
- static readonly CCURLY = 99;
105
- static readonly DOUBLECOLON = 100;
106
- static readonly TRIPLECOLON = 101;
107
- static readonly EXCLAM = 102;
108
- static readonly COLON = 103;
109
- static readonly COMMA = 104;
110
- static readonly DOT = 105;
111
- static readonly LT = 106;
112
- static readonly GT = 107;
113
- static readonly EQ = 108;
114
- static readonly NE = 109;
115
- static readonly LTE = 110;
116
- static readonly GTE = 111;
117
- static readonly PLUS = 112;
118
- static readonly MINUS = 113;
119
- static readonly STAR = 114;
120
- static readonly STARSTAR = 115;
121
- static readonly SLASH = 116;
122
- static readonly BAR = 117;
123
- static readonly SEMI = 118;
124
- static readonly NOT_MATCH = 119;
125
- static readonly MATCH = 120;
126
- static readonly PERCENT = 121;
127
- static readonly DOUBLE_QMARK = 122;
128
- static readonly QMARK = 123;
129
- static readonly LITERAL_TIMESTAMP = 124;
130
- static readonly LITERAL_HOUR = 125;
131
- static readonly LITERAL_DAY = 126;
132
- static readonly LITERAL_QUARTER = 127;
133
- static readonly LITERAL_MONTH = 128;
134
- static readonly LITERAL_WEEK = 129;
135
- static readonly LITERAL_YEAR = 130;
136
- static readonly IDENTIFIER = 131;
137
- static readonly PERCENT_LITERAL = 132;
138
- static readonly INTEGER_LITERAL = 133;
139
- static readonly NUMERIC_LITERAL = 134;
140
- static readonly OBJECT_NAME_LITERAL = 135;
141
- static readonly BLOCK_COMMENT = 136;
142
- static readonly COMMENT_TO_EOL = 137;
143
- static readonly WHITE_SPACE = 138;
144
- static readonly SQL_BEGIN = 139;
145
- static readonly CLOSE_CODE = 140;
146
- static readonly UNWATED_CHARS_TRAILING_NUMBERS = 141;
147
- static readonly UNEXPECTED_CHAR = 142;
148
- static readonly OPEN_CODE = 143;
149
- static readonly SQL_END = 144;
96
+ static readonly DOC_ANNOTATION = 91;
97
+ static readonly ANNOTATION = 92;
98
+ static readonly AMPER = 93;
99
+ static readonly ARROW = 94;
100
+ static readonly FAT_ARROW = 95;
101
+ static readonly OPAREN = 96;
102
+ static readonly CPAREN = 97;
103
+ static readonly OBRACK = 98;
104
+ static readonly CBRACK = 99;
105
+ static readonly OCURLY = 100;
106
+ static readonly CCURLY = 101;
107
+ static readonly DOUBLECOLON = 102;
108
+ static readonly TRIPLECOLON = 103;
109
+ static readonly EXCLAM = 104;
110
+ static readonly COLON = 105;
111
+ static readonly COMMA = 106;
112
+ static readonly DOT = 107;
113
+ static readonly LT = 108;
114
+ static readonly GT = 109;
115
+ static readonly EQ = 110;
116
+ static readonly NE = 111;
117
+ static readonly LTE = 112;
118
+ static readonly GTE = 113;
119
+ static readonly PLUS = 114;
120
+ static readonly MINUS = 115;
121
+ static readonly STAR = 116;
122
+ static readonly STARSTAR = 117;
123
+ static readonly SLASH = 118;
124
+ static readonly BAR = 119;
125
+ static readonly SEMI = 120;
126
+ static readonly NOT_MATCH = 121;
127
+ static readonly MATCH = 122;
128
+ static readonly PERCENT = 123;
129
+ static readonly DOUBLE_QMARK = 124;
130
+ static readonly QMARK = 125;
131
+ static readonly LITERAL_TIMESTAMP = 126;
132
+ static readonly LITERAL_HOUR = 127;
133
+ static readonly LITERAL_DAY = 128;
134
+ static readonly LITERAL_QUARTER = 129;
135
+ static readonly LITERAL_MONTH = 130;
136
+ static readonly LITERAL_WEEK = 131;
137
+ static readonly LITERAL_YEAR = 132;
138
+ static readonly IDENTIFIER = 133;
139
+ static readonly PERCENT_LITERAL = 134;
140
+ static readonly INTEGER_LITERAL = 135;
141
+ static readonly NUMERIC_LITERAL = 136;
142
+ static readonly OBJECT_NAME_LITERAL = 137;
143
+ static readonly BLOCK_COMMENT = 138;
144
+ static readonly COMMENT_TO_EOL = 139;
145
+ static readonly WHITE_SPACE = 140;
146
+ static readonly SQL_BEGIN = 141;
147
+ static readonly CLOSE_CODE = 142;
148
+ static readonly UNWATED_CHARS_TRAILING_NUMBERS = 143;
149
+ static readonly UNEXPECTED_CHAR = 144;
150
+ static readonly OPEN_CODE = 145;
151
+ static readonly SQL_END = 146;
150
152
  static readonly SQL_MODE = 1;
151
153
  static readonly channelNames: string[];
152
154
  static readonly modeNames: string[];