@malloydata/malloy 0.0.237-dev250225015031 → 0.0.237-dev250225213433

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 (38) hide show
  1. package/dist/annotation.d.ts +15 -0
  2. package/dist/annotation.js +86 -0
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.js +5 -3
  5. package/dist/lang/ast/types/annotation-elements.d.ts +1 -1
  6. package/dist/lang/ast/types/annotation-elements.js +2 -2
  7. package/dist/lang/ast/types/malloy-element.d.ts +1 -1
  8. package/dist/lang/ast/types/malloy-element.js +2 -2
  9. package/dist/lang/malloy-to-ast.d.ts +1 -1
  10. package/dist/lang/malloy-to-ast.js +2 -2
  11. package/dist/lang/parse-malloy.d.ts +1 -1
  12. package/dist/lang/parse-malloy.js +4 -3
  13. package/dist/lang/parse-utils.d.ts +0 -11
  14. package/dist/lang/parse-utils.js +4 -82
  15. package/dist/lang/syntax-errors/custom-error-messages.d.ts +4 -2
  16. package/dist/lang/syntax-errors/custom-error-messages.js +75 -16
  17. package/dist/lang/syntax-errors/malloy-error-strategy.d.ts +4 -6
  18. package/dist/lang/syntax-errors/malloy-error-strategy.js +3 -22
  19. package/dist/lang/syntax-errors/malloy-parser-error-listener.d.ts +1 -1
  20. package/dist/lang/syntax-errors/malloy-parser-error-listener.js +107 -10
  21. package/dist/lang/test/literals.spec.js +0 -34
  22. package/dist/lang/test/syntax-errors.spec.js +113 -59
  23. package/dist/malloy.d.ts +13 -8
  24. package/dist/malloy.js +23 -23
  25. package/dist/model/malloy_query.d.ts +3 -1
  26. package/dist/model/malloy_query.js +18 -3
  27. package/dist/model/materialization/utils.js +2 -2
  28. package/dist/to_stable.d.ts +3 -0
  29. package/dist/to_stable.js +170 -0
  30. package/package.json +3 -1
  31. package/dist/lang/lib/Malloy/MalloyTagLexer.d.ts +0 -42
  32. package/dist/lang/lib/Malloy/MalloyTagLexer.js +0 -385
  33. package/dist/lang/lib/Malloy/MalloyTagParser.d.ts +0 -180
  34. package/dist/lang/lib/Malloy/MalloyTagParser.js +0 -1051
  35. package/dist/lang/lib/Malloy/MalloyTagVisitor.d.ts +0 -120
  36. package/dist/lang/lib/Malloy/MalloyTagVisitor.js +0 -4
  37. package/dist/tags.d.ts +0 -72
  38. package/dist/tags.js +0 -512
@@ -1,120 +0,0 @@
1
- import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor";
2
- import { TagEqContext } from "./MalloyTagParser";
3
- import { TagReplacePropertiesContext } from "./MalloyTagParser";
4
- import { TagUpdatePropertiesContext } from "./MalloyTagParser";
5
- import { TagDefContext } from "./MalloyTagParser";
6
- import { TagEmptyContext } from "./MalloyTagParser";
7
- import { TagLineContext } from "./MalloyTagParser";
8
- import { TagSpecContext } from "./MalloyTagParser";
9
- import { StringContext } from "./MalloyTagParser";
10
- import { IdentifierContext } from "./MalloyTagParser";
11
- import { PropNameContext } from "./MalloyTagParser";
12
- import { EqValueContext } from "./MalloyTagParser";
13
- import { ArrayElementContext } from "./MalloyTagParser";
14
- import { ReferenceContext } from "./MalloyTagParser";
15
- import { ArrayValueContext } from "./MalloyTagParser";
16
- import { PropertiesContext } from "./MalloyTagParser";
17
- /**
18
- * This interface defines a complete generic visitor for a parse tree produced
19
- * by `MalloyTagParser`.
20
- *
21
- * @param <Result> The return type of the visit operation. Use `void` for
22
- * operations with no return type.
23
- */
24
- export interface MalloyTagVisitor<Result> extends ParseTreeVisitor<Result> {
25
- /**
26
- * Visit a parse tree produced by the `tagEq`
27
- * labeled alternative in `MalloyTagParser.tagSpec`.
28
- * @param ctx the parse tree
29
- * @return the visitor result
30
- */
31
- visitTagEq?: (ctx: TagEqContext) => Result;
32
- /**
33
- * Visit a parse tree produced by the `tagReplaceProperties`
34
- * labeled alternative in `MalloyTagParser.tagSpec`.
35
- * @param ctx the parse tree
36
- * @return the visitor result
37
- */
38
- visitTagReplaceProperties?: (ctx: TagReplacePropertiesContext) => Result;
39
- /**
40
- * Visit a parse tree produced by the `tagUpdateProperties`
41
- * labeled alternative in `MalloyTagParser.tagSpec`.
42
- * @param ctx the parse tree
43
- * @return the visitor result
44
- */
45
- visitTagUpdateProperties?: (ctx: TagUpdatePropertiesContext) => Result;
46
- /**
47
- * Visit a parse tree produced by the `tagDef`
48
- * labeled alternative in `MalloyTagParser.tagSpec`.
49
- * @param ctx the parse tree
50
- * @return the visitor result
51
- */
52
- visitTagDef?: (ctx: TagDefContext) => Result;
53
- /**
54
- * Visit a parse tree produced by the `tagEmpty`
55
- * labeled alternative in `MalloyTagParser.tagSpec`.
56
- * @param ctx the parse tree
57
- * @return the visitor result
58
- */
59
- visitTagEmpty?: (ctx: TagEmptyContext) => Result;
60
- /**
61
- * Visit a parse tree produced by `MalloyTagParser.tagLine`.
62
- * @param ctx the parse tree
63
- * @return the visitor result
64
- */
65
- visitTagLine?: (ctx: TagLineContext) => Result;
66
- /**
67
- * Visit a parse tree produced by `MalloyTagParser.tagSpec`.
68
- * @param ctx the parse tree
69
- * @return the visitor result
70
- */
71
- visitTagSpec?: (ctx: TagSpecContext) => Result;
72
- /**
73
- * Visit a parse tree produced by `MalloyTagParser.string`.
74
- * @param ctx the parse tree
75
- * @return the visitor result
76
- */
77
- visitString?: (ctx: StringContext) => Result;
78
- /**
79
- * Visit a parse tree produced by `MalloyTagParser.identifier`.
80
- * @param ctx the parse tree
81
- * @return the visitor result
82
- */
83
- visitIdentifier?: (ctx: IdentifierContext) => Result;
84
- /**
85
- * Visit a parse tree produced by `MalloyTagParser.propName`.
86
- * @param ctx the parse tree
87
- * @return the visitor result
88
- */
89
- visitPropName?: (ctx: PropNameContext) => Result;
90
- /**
91
- * Visit a parse tree produced by `MalloyTagParser.eqValue`.
92
- * @param ctx the parse tree
93
- * @return the visitor result
94
- */
95
- visitEqValue?: (ctx: EqValueContext) => Result;
96
- /**
97
- * Visit a parse tree produced by `MalloyTagParser.arrayElement`.
98
- * @param ctx the parse tree
99
- * @return the visitor result
100
- */
101
- visitArrayElement?: (ctx: ArrayElementContext) => Result;
102
- /**
103
- * Visit a parse tree produced by `MalloyTagParser.reference`.
104
- * @param ctx the parse tree
105
- * @return the visitor result
106
- */
107
- visitReference?: (ctx: ReferenceContext) => Result;
108
- /**
109
- * Visit a parse tree produced by `MalloyTagParser.arrayValue`.
110
- * @param ctx the parse tree
111
- * @return the visitor result
112
- */
113
- visitArrayValue?: (ctx: ArrayValueContext) => Result;
114
- /**
115
- * Visit a parse tree produced by `MalloyTagParser.properties`.
116
- * @param ctx the parse tree
117
- * @return the visitor result
118
- */
119
- visitProperties?: (ctx: PropertiesContext) => Result;
120
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- // Generated from MalloyTag.g4 by ANTLR 4.9.0-SNAPSHOT
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=MalloyTagVisitor.js.map
package/dist/tags.d.ts DELETED
@@ -1,72 +0,0 @@
1
- import { LogMessage } from './lang';
2
- import { Annotation } from './model';
3
- export type TagDict = Record<string, TagInterface>;
4
- type TagValue = string | TagInterface[];
5
- export interface TagInterface {
6
- eq?: TagValue;
7
- properties?: TagDict;
8
- }
9
- export interface TagParse {
10
- tag: Tag;
11
- log: LogMessage[];
12
- }
13
- export interface TagParseSpec {
14
- prefix?: RegExp;
15
- extending?: Tag;
16
- scopes?: Tag[];
17
- }
18
- export interface Taggable {
19
- tagParse: (spec?: TagParseSpec) => TagParse;
20
- getTaglines: (prefix?: RegExp) => string[];
21
- }
22
- /**
23
- * Class for interacting with the parsed output of an annotation
24
- * containing the Malloy tag language. Used by the parser to
25
- * generate parsed data, and as an API to that data.
26
- * ```
27
- * tag.text(p?) => string value of tag.p or undefined
28
- * tag.array(p?) => Tag[] value of tag.p or undefined
29
- * tag.numeric(p?) => numeric value of tag.p or undefined
30
- * tag.textArray(p ?) => string[] value of elements in tag.p or undefined
31
- * tag.numericArray(p?) => string[] value of elements in tag.p or undefined
32
- * tag.tag(p?) => Tag value of tag.p
33
- * tag.has(p?) => boolean "tag contains tag.p"
34
- * tag.bare(p?) => tag.p exists and has no properties
35
- * tag.dict => Record<string,Tag> of tag properties
36
- * ```
37
- */
38
- export declare class Tag implements TagInterface {
39
- eq?: TagValue;
40
- properties?: TagDict;
41
- static tagFrom(from?: TagInterface): Tag;
42
- static ids: Map<Tag, number>;
43
- static nextTagId: number;
44
- static id(t: Tag): number;
45
- peek(indent?: number): string;
46
- /**
47
- * Parse a line of Malloy tag language into a Tag which can be queried
48
- * @param source -- The source line to be parsed. If the string starts with #, then it skips
49
- * all characters up to the first space.
50
- * @param extending A tag which this line will be extending
51
- * @param importing Outer "scopes" for $() references
52
- * @returns Something shaped like { tag: Tag , log: ParseErrors[] }
53
- */
54
- static fromTagline(str: string, extending: Tag | undefined, ...importing: Tag[]): TagParse;
55
- static addModelScope(spec: TagParseSpec | undefined, modelScope: Tag): TagParseSpec;
56
- static annotationToTaglines(annote: Annotation | undefined, prefix?: RegExp): string[];
57
- static annotationToTag(annote: Annotation | undefined, spec?: TagParseSpec): TagParse;
58
- constructor(from?: TagInterface);
59
- private find;
60
- tag(...at: string[]): Tag | undefined;
61
- has(...at: string[]): boolean;
62
- text(...at: string[]): string | undefined;
63
- numeric(...at: string[]): number | undefined;
64
- bare(...at: string[]): boolean | undefined;
65
- get dict(): Record<string, Tag>;
66
- array(...at: string[]): Tag[] | undefined;
67
- textArray(...at: string[]): string[] | undefined;
68
- numericArray(...at: string[]): number[] | undefined;
69
- getProperties(): TagDict;
70
- clone(): Tag;
71
- }
72
- export {};