@malloydata/malloy 0.0.79-dev230818134709 → 0.0.79-dev230822184259

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 (53) hide show
  1. package/dist/dialect/dialect.d.ts +1 -1
  2. package/dist/dialect/functions/function_map.d.ts +1 -1
  3. package/dist/lang/ast/expressions/expr-cast.d.ts +1 -1
  4. package/dist/lang/ast/expressions/expr-time-extract.js +6 -6
  5. package/dist/lang/ast/query-items/field-declaration.d.ts +1 -1
  6. package/dist/lang/ast/query-items/field-references.d.ts +2 -2
  7. package/dist/lang/ast/query-properties/joins.d.ts +1 -1
  8. package/dist/lang/ast/query-properties/nest.d.ts +1 -1
  9. package/dist/lang/ast/query-properties/top.d.ts +1 -1
  10. package/dist/lang/ast/sources/table-source.d.ts +1 -1
  11. package/dist/lang/ast/space-seed.d.ts +1 -1
  12. package/dist/lang/ast/sql-elements/sql-string.d.ts +1 -1
  13. package/dist/lang/ast/types/comparison.js +1 -1
  14. package/dist/lang/ast/types/equality.js +1 -1
  15. package/dist/lang/ast/types/explore-field.d.ts +1 -1
  16. package/dist/lang/ast/types/expr-result.d.ts +1 -1
  17. package/dist/lang/ast/types/expr-value.d.ts +1 -1
  18. package/dist/lang/ast/types/field-collection-member.d.ts +1 -1
  19. package/dist/lang/ast/types/field-decl.d.ts +1 -1
  20. package/dist/lang/ast/types/lookup-result.d.ts +1 -1
  21. package/dist/lang/ast/types/malloy-element.d.ts +2 -2
  22. package/dist/lang/ast/types/query-element.d.ts +1 -1
  23. package/dist/lang/ast/types/query-extend-property.d.ts +1 -1
  24. package/dist/lang/ast/types/query-item.d.ts +1 -1
  25. package/dist/lang/ast/types/query-property-interface.js +2 -2
  26. package/dist/lang/ast/types/query-property.d.ts +1 -1
  27. package/dist/lang/ast/types/source-property.d.ts +1 -1
  28. package/dist/lang/field-utils.d.ts +1 -1
  29. package/dist/lang/lib/Malloy/MalloyLexer.js +5 -5
  30. package/dist/lang/lib/Malloy/MalloyParser.d.ts +2 -1
  31. package/dist/lang/lib/Malloy/MalloyParser.js +482 -465
  32. package/dist/lang/lib/Malloy/MalloyTagLexer.js +5 -5
  33. package/dist/lang/lib/Malloy/MalloyTagParser.js +4 -4
  34. package/dist/lang/malloy-to-ast.d.ts +1 -1
  35. package/dist/lang/malloy-to-ast.js +3 -0
  36. package/dist/lang/parse-log.d.ts +1 -1
  37. package/dist/lang/parse-malloy.d.ts +3 -3
  38. package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +1 -1
  39. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +2 -2
  40. package/dist/lang/parse-utils.d.ts +3 -3
  41. package/dist/lang/test/parse-expects.d.ts +3 -3
  42. package/dist/lang/test/parse.spec.js +16 -10
  43. package/dist/lang/translate-response.d.ts +8 -8
  44. package/dist/lang/zone.d.ts +3 -3
  45. package/dist/malloy.d.ts +6 -6
  46. package/dist/malloy.js +5 -5
  47. package/dist/model/malloy_query.d.ts +7 -7
  48. package/dist/model/malloy_types.d.ts +44 -44
  49. package/dist/model/malloy_types.js +1 -1
  50. package/dist/runtime_types.d.ts +7 -7
  51. package/dist/tags.d.ts +2 -2
  52. package/dist/tags.js +8 -8
  53. package/package.json +1 -1
@@ -19,7 +19,7 @@ export interface QueryInfo {
19
19
  export declare const dayIndex: number;
20
20
  export declare function inDays(units: string): boolean;
21
21
  export declare function qtz(qi: QueryInfo): string | undefined;
22
- export declare type DialectFieldList = DialectField[];
22
+ export type DialectFieldList = DialectField[];
23
23
  export declare abstract class Dialect {
24
24
  abstract name: string;
25
25
  abstract defaultNumberType: string;
@@ -1,5 +1,5 @@
1
1
  import { DialectFunctionOverloadDef } from './util';
2
- declare type Thunk<T> = () => T;
2
+ type Thunk<T> = () => T;
3
3
  export declare class FunctionMap {
4
4
  private functions;
5
5
  private getters;
@@ -1,7 +1,7 @@
1
1
  import { ExprValue } from '../types/expr-value';
2
2
  import { ExpressionDef } from '../types/expression-def';
3
3
  import { FieldSpace } from '../types/field-space';
4
- export declare type CastType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp';
4
+ export type CastType = 'string' | 'number' | 'boolean' | 'date' | 'timestamp';
5
5
  export declare function isCastType(t: string): t is CastType;
6
6
  export declare class ExprCast extends ExpressionDef {
7
7
  readonly expr: ExpressionDef;
@@ -28,12 +28,6 @@ const ast_utils_1 = require("../ast-utils");
28
28
  const expression_def_1 = require("../types/expression-def");
29
29
  const range_1 = require("./range");
30
30
  class ExprTimeExtract extends expression_def_1.ExpressionDef {
31
- constructor(extractText, args) {
32
- super({ args: args });
33
- this.extractText = extractText;
34
- this.args = args;
35
- this.elementType = 'timeExtract';
36
- }
37
31
  static extractor(funcName) {
38
32
  const mappedName = ExprTimeExtract.pluralMap[funcName];
39
33
  if (mappedName) {
@@ -43,6 +37,12 @@ class ExprTimeExtract extends expression_def_1.ExpressionDef {
43
37
  return funcName;
44
38
  }
45
39
  }
40
+ constructor(extractText, args) {
41
+ super({ args: args });
42
+ this.extractText = extractText;
43
+ this.args = args;
44
+ this.elementType = 'timeExtract';
45
+ }
46
46
  getExpression(fs) {
47
47
  const extractTo = ExprTimeExtract.extractor(this.extractText);
48
48
  if (extractTo) {
@@ -9,7 +9,7 @@ import { MakeEntry, SpaceEntry } from '../types/space-entry';
9
9
  import { extendNoteMethod, Noteable } from '../types/noteable';
10
10
  import { DynamicSpace } from '../field-space/dynamic-space';
11
11
  import { SpaceField } from '../types/space-field';
12
- export declare type FieldDeclarationConstructor = new (expr: ExpressionDef, defineName: string, exprSrc?: string) => FieldDeclaration;
12
+ export type FieldDeclarationConstructor = new (expr: ExpressionDef, defineName: string, exprSrc?: string) => FieldDeclaration;
13
13
  export declare abstract class FieldDeclaration extends MalloyElement implements Noteable, MakeEntry {
14
14
  readonly expr: ExpressionDef;
15
15
  readonly defineName: string;
@@ -6,7 +6,7 @@ import { LookupResult } from '../types/lookup-result';
6
6
  import { ListOf, MalloyElement } from '../types/malloy-element';
7
7
  import { Noteable, extendNoteMethod } from '../types/noteable';
8
8
  import { MakeEntry } from '../types/space-entry';
9
- export declare type FieldReferenceConstructor = new (names: FieldName[]) => FieldReference;
9
+ export type FieldReferenceConstructor = new (names: FieldName[]) => FieldReference;
10
10
  export declare abstract class FieldReference extends ListOf<FieldName> implements Noteable, MakeEntry {
11
11
  readonly isNoteableObj = true;
12
12
  note?: Annotation;
@@ -71,7 +71,7 @@ export declare class WildcardFieldReference extends MalloyElement implements Not
71
71
  getFieldDef(): FieldDef;
72
72
  get refString(): string;
73
73
  }
74
- export declare type FieldReferenceElement = FieldReference | WildcardFieldReference;
74
+ export type FieldReferenceElement = FieldReference | WildcardFieldReference;
75
75
  export declare class FieldReferences extends DefinitionList<FieldReferenceElement> {
76
76
  elementType: string;
77
77
  constructor(members: FieldReferenceElement[]);
@@ -27,7 +27,7 @@ export declare class KeyJoin extends Join {
27
27
  structDef(): StructDef;
28
28
  fixupJoinOn(outer: FieldSpace, inStruct: StructDef): void;
29
29
  }
30
- declare type ExpressionJoinType = 'many' | 'one' | 'cross';
30
+ type ExpressionJoinType = 'many' | 'one' | 'cross';
31
31
  export declare class ExpressionJoin extends Join {
32
32
  readonly name: ModelEntryReference;
33
33
  readonly source: Source;
@@ -59,5 +59,5 @@ export declare class NestReference extends FieldReference implements QueryProper
59
59
  typecheck(type: TypeDesc): void;
60
60
  queryExecute(executeFor: QueryBuilder): void;
61
61
  }
62
- export declare type NestedQuery = NestReference | NestDefinition | NestRefinement;
62
+ export type NestedQuery = NestReference | NestDefinition | NestRefinement;
63
63
  export {};
@@ -3,7 +3,7 @@ import { ExpressionDef } from '../types/expression-def';
3
3
  import { FieldName, FieldSpace } from '../types/field-space';
4
4
  import { MalloyElement } from '../types/malloy-element';
5
5
  import { LegalRefinementStage, QueryPropertyInterface } from '../types/query-property-interface';
6
- declare type TopInit = FieldName | ExpressionDef;
6
+ type TopInit = FieldName | ExpressionDef;
7
7
  export declare class Top extends MalloyElement implements QueryPropertyInterface {
8
8
  readonly limit: number;
9
9
  readonly by?: TopInit | undefined;
@@ -1,7 +1,7 @@
1
1
  import { StructDef } from '../../../model/malloy_types';
2
2
  import { Source } from '../elements/source';
3
3
  import { ModelEntryReference } from '../types/malloy-element';
4
- declare type TableInfo = {
4
+ type TableInfo = {
5
5
  tablePath: string;
6
6
  connectionName?: string | undefined;
7
7
  };
@@ -1,6 +1,6 @@
1
1
  import { StructDef } from '../../model/malloy_types';
2
2
  import { FieldSpace } from './types/field-space';
3
- export declare type SourceSpec = StructDef | FieldSpace;
3
+ export type SourceSpec = StructDef | FieldSpace;
4
4
  /**
5
5
  * Based on how things are constructed, a DynamicSpace can be seeded
6
6
  * with a StructDef, or from another field space.
@@ -1,7 +1,7 @@
1
1
  import { SQLPhrase } from '../../../model/malloy_types';
2
2
  import { QueryElement } from '../types/query-element';
3
3
  import { MalloyElement } from '../types/malloy-element';
4
- declare type SQLStringSegment = string | QueryElement;
4
+ type SQLStringSegment = string | QueryElement;
5
5
  export declare class SQLString extends MalloyElement {
6
6
  elementType: string;
7
7
  elements: SQLStringSegment[];
@@ -33,7 +33,7 @@ var Comparison;
33
33
  Comparison["GreaterThan"] = ">";
34
34
  Comparison["GreaterThanOrEqualTo"] = ">=";
35
35
  Comparison["NotEqualTo"] = "!=";
36
- })(Comparison = exports.Comparison || (exports.Comparison = {}));
36
+ })(Comparison || (exports.Comparison = Comparison = {}));
37
37
  function isComparison(s) {
38
38
  return Object.values(Comparison).includes(s);
39
39
  }
@@ -29,7 +29,7 @@ var Equality;
29
29
  Equality["NotLike"] = "!~";
30
30
  Equality["Equals"] = "=";
31
31
  Equality["NotEquals"] = "!=";
32
- })(Equality = exports.Equality || (exports.Equality = {}));
32
+ })(Equality || (exports.Equality = Equality = {}));
33
33
  function isEquality(s) {
34
34
  return Object.values(Equality).includes(s);
35
35
  }
@@ -1,5 +1,5 @@
1
1
  import { RenameField } from '../source-properties/renames';
2
2
  import { FieldDecl } from './field-decl';
3
3
  import { MalloyElement } from './malloy-element';
4
- export declare type ExploreField = FieldDecl | RenameField;
4
+ export type ExploreField = FieldDecl | RenameField;
5
5
  export declare function isExploreField(f: MalloyElement): f is ExploreField;
@@ -1,5 +1,5 @@
1
1
  import { Fragment, TypeDesc } from '../../../model/malloy_types';
2
- declare type MorphicValues = Record<string, Fragment[]>;
2
+ type MorphicValues = Record<string, Fragment[]>;
3
3
  export interface ExprResult extends TypeDesc {
4
4
  value: Fragment[];
5
5
  morphic?: MorphicValues;
@@ -1,3 +1,3 @@
1
1
  import { ExprResult } from './expr-result';
2
2
  import { TimeResult } from './time-result';
3
- export declare type ExprValue = ExprResult | TimeResult;
3
+ export type ExprValue = ExprResult | TimeResult;
@@ -1,5 +1,5 @@
1
1
  import { FieldDeclaration } from '../query-items/field-declaration';
2
2
  import { FieldReferenceElement } from '../query-items/field-references';
3
3
  import { MalloyElement } from './malloy-element';
4
- export declare type FieldCollectionMember = FieldReferenceElement | FieldDeclaration;
4
+ export type FieldCollectionMember = FieldReferenceElement | FieldDeclaration;
5
5
  export declare function isFieldCollectionMember(el: MalloyElement): el is FieldCollectionMember;
@@ -3,5 +3,5 @@ import { Turtles } from '../source-properties/turtles';
3
3
  import { FieldDeclaration } from '../query-items/field-declaration';
4
4
  import { Join } from '../query-properties/joins';
5
5
  import { MalloyElement } from './malloy-element';
6
- export declare type FieldDecl = FieldDeclaration | Join | TurtleDecl | Turtles;
6
+ export type FieldDecl = FieldDeclaration | Join | TurtleDecl | Turtles;
7
7
  export declare function isFieldDecl(f: MalloyElement): f is FieldDecl;
@@ -7,4 +7,4 @@ export interface LookupError {
7
7
  error: string;
8
8
  found: undefined;
9
9
  }
10
- export declare type LookupResult = LookupFound | LookupError;
10
+ export type LookupResult = LookupFound | LookupError;
@@ -52,8 +52,8 @@ export declare class Unimplemented extends MalloyElement {
52
52
  elementType: string;
53
53
  reported: boolean;
54
54
  }
55
- declare type ChildBody = MalloyElement | MalloyElement[];
56
- declare type ElementChildren = Record<string, ChildBody>;
55
+ type ChildBody = MalloyElement | MalloyElement[];
56
+ type ElementChildren = Record<string, ChildBody>;
57
57
  export declare class ModelEntryReference extends MalloyElement {
58
58
  readonly name: string;
59
59
  elementType: string;
@@ -1,5 +1,5 @@
1
1
  import { MalloyElement } from './malloy-element';
2
2
  import { ExistingQuery } from '../query-elements/existing-query';
3
3
  import { FullQuery } from '../query-elements/full-query';
4
- export declare type QueryElement = FullQuery | ExistingQuery;
4
+ export type QueryElement = FullQuery | ExistingQuery;
5
5
  export declare function isQueryElement(e: MalloyElement): e is QueryElement;
@@ -2,5 +2,5 @@ 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';
5
- export declare type QueryExtendProperty = Dimensions | Measures | Joins;
5
+ export type QueryExtendProperty = Dimensions | Measures | Joins;
6
6
  export declare function isQueryExtendProperty(q: MalloyElement): q is QueryExtendProperty;
@@ -1,4 +1,4 @@
1
1
  import { FieldDeclaration } from '../query-items/field-declaration';
2
2
  import { FieldReference } from '../query-items/field-references';
3
3
  import { NestDefinition, NestReference } from '../query-properties/nest';
4
- export declare type QueryItem = FieldDeclaration | FieldReference | NestDefinition | NestReference;
4
+ export type QueryItem = FieldDeclaration | FieldReference | NestDefinition | NestReference;
@@ -28,7 +28,7 @@ var QueryClass;
28
28
  QueryClass["Index"] = "index";
29
29
  QueryClass["Project"] = "project";
30
30
  QueryClass["Grouping"] = "grouping";
31
- })(QueryClass = exports.QueryClass || (exports.QueryClass = {}));
31
+ })(QueryClass || (exports.QueryClass = QueryClass = {}));
32
32
  /**
33
33
  * A QueryProperty can have these responses to appearing in a refinement
34
34
  * Head -- Legal in all queries, apply it to the first segment
@@ -41,5 +41,5 @@ var LegalRefinementStage;
41
41
  LegalRefinementStage[LegalRefinementStage["Single"] = 0] = "Single";
42
42
  LegalRefinementStage[LegalRefinementStage["Head"] = 1] = "Head";
43
43
  LegalRefinementStage[LegalRefinementStage["Tail"] = 2] = "Tail";
44
- })(LegalRefinementStage = exports.LegalRefinementStage || (exports.LegalRefinementStage = {}));
44
+ })(LegalRefinementStage || (exports.LegalRefinementStage = LegalRefinementStage = {}));
45
45
  //# sourceMappingURL=query-property-interface.js.map
@@ -1,4 +1,4 @@
1
1
  import { MalloyElement } from './malloy-element';
2
2
  import { QueryPropertyInterface } from './query-property-interface';
3
- export declare type QueryProperty = MalloyElement & QueryPropertyInterface;
3
+ export type QueryProperty = MalloyElement & QueryPropertyInterface;
4
4
  export declare function isQueryProperty(q: MalloyElement): q is QueryProperty;
@@ -8,5 +8,5 @@ import { Turtles } from '../source-properties/turtles';
8
8
  import { MalloyElement } from './malloy-element';
9
9
  import { TimezoneStatement } from '../source-properties/timezone-statement';
10
10
  import { ObjectAnnotation } from './annotation-elements';
11
- export declare type SourceProperty = Filter | Joins | DeclareFields | FieldListEdit | Renames | PrimaryKey | ObjectAnnotation | Turtles | TimezoneStatement;
11
+ export type SourceProperty = Filter | Joins | DeclareFields | FieldListEdit | Renames | PrimaryKey | ObjectAnnotation | Turtles | TimezoneStatement;
12
12
  export declare function isSourceProperty(p: MalloyElement): p is SourceProperty;
@@ -1,5 +1,5 @@
1
1
  import { FieldDef, QueryFieldDef } from '../model/malloy_types';
2
- declare type Field = QueryFieldDef | FieldDef;
2
+ type Field = QueryFieldDef | FieldDef;
3
3
  export declare function nameOf(qfd: Field): string;
4
4
  export declare function mergeFields<T extends Field>(older: T[] | undefined, newer: T[]): T[];
5
5
  export {};
@@ -31,16 +31,16 @@ const LexerATNSimulator_1 = require("antlr4ts/atn/LexerATNSimulator");
31
31
  const VocabularyImpl_1 = require("antlr4ts/VocabularyImpl");
32
32
  const Utils = __importStar(require("antlr4ts/misc/Utils"));
33
33
  class MalloyLexer extends Lexer_1.Lexer {
34
- // tslint:enable:no-trailing-whitespace
35
- constructor(input) {
36
- super(input);
37
- this._interp = new LexerATNSimulator_1.LexerATNSimulator(MalloyLexer._ATN, this);
38
- }
39
34
  // @Override
40
35
  // @NotNull
41
36
  get vocabulary() {
42
37
  return MalloyLexer.VOCABULARY;
43
38
  }
39
+ // tslint:enable:no-trailing-whitespace
40
+ constructor(input) {
41
+ super(input);
42
+ this._interp = new LexerATNSimulator_1.LexerATNSimulator(MalloyLexer._ATN, this);
43
+ }
44
44
  // @Override
45
45
  get grammarFileName() { return "MalloyLexer.g4"; }
46
46
  // @Override
@@ -1520,8 +1520,9 @@ export declare class CalculateStatementContext extends ParserRuleContext {
1520
1520
  }
1521
1521
  export declare class ProjectStatementContext extends ParserRuleContext {
1522
1522
  tags(): TagsContext;
1523
- PROJECT(): TerminalNode;
1524
1523
  fieldCollection(): FieldCollectionContext;
1524
+ SELECT(): TerminalNode | undefined;
1525
+ PROJECT(): TerminalNode | undefined;
1525
1526
  constructor(parent: ParserRuleContext | undefined, invokingState: number);
1526
1527
  get ruleIndex(): number;
1527
1528
  enterRule(listener: MalloyParserListener): void;