@malloydata/malloy 0.0.391 → 0.0.392

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 (127) hide show
  1. package/dist/api/asynchronous.js +0 -3
  2. package/dist/api/foundation/compile.d.ts +1 -1
  3. package/dist/api/foundation/config.d.ts +80 -8
  4. package/dist/api/foundation/config.js +151 -69
  5. package/dist/api/foundation/config_compile.js +27 -35
  6. package/dist/api/foundation/config_discover.js +5 -9
  7. package/dist/api/foundation/config_overlays.d.ts +6 -0
  8. package/dist/api/foundation/config_overlays.js +12 -0
  9. package/dist/api/foundation/config_resolve.d.ts +4 -1
  10. package/dist/api/foundation/config_resolve.js +64 -4
  11. package/dist/api/foundation/core.d.ts +75 -2
  12. package/dist/api/foundation/core.js +104 -6
  13. package/dist/api/foundation/index.d.ts +2 -0
  14. package/dist/api/foundation/readers.js +1 -1
  15. package/dist/api/foundation/runtime.d.ts +68 -2
  16. package/dist/api/foundation/runtime.js +212 -10
  17. package/dist/api/foundation/types.d.ts +2 -1
  18. package/dist/index.d.ts +3 -1
  19. package/dist/lang/ast/ast-utils.js +0 -1
  20. package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +1 -1
  21. package/dist/lang/ast/expressions/expr-aggregate-function.js +9 -8
  22. package/dist/lang/ast/expressions/expr-coalesce.d.ts +1 -1
  23. package/dist/lang/ast/expressions/expr-coalesce.js +2 -3
  24. package/dist/lang/ast/expressions/expr-count-distinct.js +1 -1
  25. package/dist/lang/ast/expressions/expr-count.js +6 -4
  26. package/dist/lang/ast/expressions/expr-filter-expr.js +0 -1
  27. package/dist/lang/ast/expressions/expr-func.js +9 -4
  28. package/dist/lang/ast/expressions/expr-given.d.ts +18 -0
  29. package/dist/lang/ast/expressions/expr-given.js +69 -0
  30. package/dist/lang/ast/expressions/expr-granular-time.d.ts +1 -1
  31. package/dist/lang/ast/expressions/expr-id-reference.js +3 -2
  32. package/dist/lang/ast/expressions/expr-now.js +0 -1
  33. package/dist/lang/ast/expressions/expr-props.d.ts +132 -132
  34. package/dist/lang/ast/expressions/expr-props.js +2 -2
  35. package/dist/lang/ast/expressions/expr-ungroup.d.ts +1 -1
  36. package/dist/lang/ast/expressions/expr-ungroup.js +4 -4
  37. package/dist/lang/ast/expressions/for-range.d.ts +1 -1
  38. package/dist/lang/ast/expressions/function-ordering.d.ts +1 -1
  39. package/dist/lang/ast/expressions/function-ordering.js +2 -2
  40. package/dist/lang/ast/expressions/time-literal.d.ts +3 -3
  41. package/dist/lang/ast/field-space/include-utils.js +2 -2
  42. package/dist/lang/ast/field-space/index-field-space.js +18 -23
  43. package/dist/lang/ast/field-space/passthrough-space.d.ts +1 -1
  44. package/dist/lang/ast/field-space/query-spaces.d.ts +6 -2
  45. package/dist/lang/ast/field-space/query-spaces.js +29 -19
  46. package/dist/lang/ast/field-space/reference-field.js +1 -1
  47. package/dist/lang/ast/field-space/rename-space-field.d.ts +1 -1
  48. package/dist/lang/ast/field-space/rename-space-field.js +2 -2
  49. package/dist/lang/ast/field-space/struct-space-field-base.js +2 -3
  50. package/dist/lang/ast/index.d.ts +2 -0
  51. package/dist/lang/ast/index.js +2 -0
  52. package/dist/lang/ast/query-builders/index-builder.d.ts +1 -1
  53. package/dist/lang/ast/query-builders/index-builder.js +4 -3
  54. package/dist/lang/ast/query-builders/reduce-builder.d.ts +2 -2
  55. package/dist/lang/ast/query-builders/reduce-builder.js +4 -5
  56. package/dist/lang/ast/query-elements/query-arrow.js +3 -2
  57. package/dist/lang/ast/query-elements/query-base.d.ts +1 -1
  58. package/dist/lang/ast/query-elements/query-base.js +1 -1
  59. package/dist/lang/ast/query-elements/query-refine.js +3 -1
  60. package/dist/lang/ast/query-items/field-declaration.js +2 -2
  61. package/dist/lang/ast/query-properties/drill.js +6 -6
  62. package/dist/lang/ast/query-properties/filters.js +2 -2
  63. package/dist/lang/ast/query-properties/nest.js +3 -3
  64. package/dist/lang/ast/source-elements/composite-source.js +5 -3
  65. package/dist/lang/ast/source-elements/named-source.js +4 -0
  66. package/dist/lang/ast/source-elements/sql-source.js +2 -2
  67. package/dist/lang/ast/source-elements/table-source.js +3 -1
  68. package/dist/lang/ast/source-properties/join.js +4 -4
  69. package/dist/lang/ast/source-query-elements/sq-reference.js +2 -1
  70. package/dist/lang/ast/statements/define-given.d.ts +29 -0
  71. package/dist/lang/ast/statements/define-given.js +163 -0
  72. package/dist/lang/ast/statements/import-statement.js +72 -9
  73. package/dist/lang/ast/typedesc-utils.d.ts +3 -1
  74. package/dist/lang/ast/typedesc-utils.js +4 -47
  75. package/dist/lang/ast/types/expr-value.js +2 -3
  76. package/dist/lang/ast/types/expression-def.d.ts +2 -2
  77. package/dist/lang/ast/types/expression-def.js +2 -2
  78. package/dist/lang/ast/types/malloy-element.d.ts +5 -15
  79. package/dist/lang/ast/types/malloy-element.js +113 -1
  80. package/dist/lang/ast/types/space-field.js +7 -9
  81. package/dist/lang/ast/view-elements/reference-view.js +6 -5
  82. package/dist/lang/ast/view-elements/refine-utils.js +1 -1
  83. package/dist/lang/composite-source-utils.d.ts +30 -15
  84. package/dist/lang/composite-source-utils.js +234 -64
  85. package/dist/lang/lib/Malloy/MalloyLexer.d.ts +171 -169
  86. package/dist/lang/lib/Malloy/MalloyLexer.js +1194 -1178
  87. package/dist/lang/lib/Malloy/MalloyParser.d.ts +408 -334
  88. package/dist/lang/lib/Malloy/MalloyParser.js +3062 -2561
  89. package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +68 -0
  90. package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +43 -0
  91. package/dist/lang/malloy-to-ast.d.ts +13 -1
  92. package/dist/lang/malloy-to-ast.js +90 -11
  93. package/dist/lang/parse-log.d.ts +8 -0
  94. package/dist/lang/prettify/filter-type.d.ts +3 -0
  95. package/dist/lang/prettify/filter-type.js +38 -0
  96. package/dist/lang/prettify/formatter.js +6 -0
  97. package/dist/lang/prettify/inline-renderer.js +20 -0
  98. package/dist/lang/prettify/rules.d.ts +1 -1
  99. package/dist/lang/prettify/rules.js +1 -0
  100. package/dist/lang/prettify/sections.js +2 -0
  101. package/dist/lang/prettify/tokens.js +2 -0
  102. package/dist/lang/test/expr-to-str.js +2 -0
  103. package/dist/lang/test/parse-expects.d.ts +1 -0
  104. package/dist/lang/test/parse-expects.js +27 -10
  105. package/dist/model/constant_expression_compiler.js +1 -0
  106. package/dist/model/expression_compiler.d.ts +2 -1
  107. package/dist/model/expression_compiler.js +41 -1
  108. package/dist/model/given_binding.d.ts +2 -0
  109. package/dist/model/given_binding.js +204 -0
  110. package/dist/model/index.d.ts +1 -1
  111. package/dist/model/index.js +2 -1
  112. package/dist/model/malloy_types.d.ts +163 -36
  113. package/dist/model/malloy_types.js +97 -0
  114. package/dist/model/query_model_contract.d.ts +2 -1
  115. package/dist/model/query_model_impl.d.ts +2 -1
  116. package/dist/model/query_model_impl.js +7 -0
  117. package/dist/model/query_node.d.ts +2 -1
  118. package/dist/model/source_def_utils.d.ts +2 -1
  119. package/dist/model/source_def_utils.js +4 -0
  120. package/dist/model/utils.d.ts +14 -1
  121. package/dist/model/utils.js +41 -0
  122. package/dist/to_stable.js +1 -1
  123. package/dist/util/closest_match.d.ts +9 -0
  124. package/dist/util/closest_match.js +47 -0
  125. package/dist/version.d.ts +1 -1
  126. package/dist/version.js +1 -1
  127. package/package.json +4 -4
@@ -19,175 +19,177 @@ export declare class MalloyParser extends Parser {
19
19
  static readonly DRILL = 8;
20
20
  static readonly EXCEPT = 9;
21
21
  static readonly EXTENDQ = 10;
22
- static readonly GROUP_BY = 11;
23
- static readonly GROUPED_BY = 12;
24
- static readonly HAVING = 13;
25
- static readonly INDEX = 14;
26
- static readonly INTERNAL = 15;
27
- static readonly JOIN_CROSS = 16;
28
- static readonly JOIN_ONE = 17;
29
- static readonly JOIN_MANY = 18;
30
- static readonly LIMIT = 19;
31
- static readonly MEASURE = 20;
32
- static readonly NEST = 21;
33
- static readonly ORDER_BY = 22;
34
- static readonly PARTITION_BY = 23;
35
- static readonly PRIMARY_KEY = 24;
36
- static readonly PRIVATE = 25;
37
- static readonly PROJECT = 26;
38
- static readonly PUBLIC = 27;
39
- static readonly QUERY = 28;
40
- static readonly RENAME = 29;
41
- static readonly RUN = 30;
42
- static readonly SAMPLE = 31;
43
- static readonly SELECT = 32;
44
- static readonly SOURCE = 33;
45
- static readonly TYPE = 34;
46
- static readonly TOP = 35;
47
- static readonly WHERE = 36;
48
- static readonly VIEW = 37;
49
- static readonly TIMEZONE = 38;
50
- static readonly ALL = 39;
51
- static readonly AND = 40;
52
- static readonly AS = 41;
53
- static readonly ASC = 42;
54
- static readonly AVG = 43;
55
- static readonly BOOLEAN = 44;
56
- static readonly BY = 45;
57
- static readonly CASE = 46;
58
- static readonly CAST = 47;
59
- static readonly CONDITION = 48;
60
- static readonly COUNT = 49;
61
- static readonly COMPOSE = 50;
62
- static readonly DATE = 51;
63
- static readonly DAY = 52;
64
- static readonly DESC = 53;
65
- static readonly DISTINCT = 54;
66
- static readonly ELSE = 55;
67
- static readonly END = 56;
68
- static readonly EXCLUDE = 57;
69
- static readonly EXTEND = 58;
70
- static readonly FALSE = 59;
71
- static readonly FILTER = 60;
72
- static readonly FULL = 61;
73
- static readonly FOR = 62;
74
- static readonly FROM = 63;
75
- static readonly HAS = 64;
76
- static readonly HOUR = 65;
77
- static readonly IMPORT = 66;
78
- static readonly INCLUDE = 67;
79
- static readonly INNER = 68;
80
- static readonly IS = 69;
81
- static readonly IN = 70;
82
- static readonly INTERNAL_KW = 71;
83
- static readonly JSON = 72;
84
- static readonly LAST = 73;
85
- static readonly LEFT = 74;
86
- static readonly LIKE = 75;
87
- static readonly MAX = 76;
88
- static readonly MIN = 77;
89
- static readonly MINUTE = 78;
90
- static readonly MONTH = 79;
91
- static readonly NOT = 80;
92
- static readonly NOW = 81;
93
- static readonly NULL = 82;
94
- static readonly NUMBER = 83;
95
- static readonly ON = 84;
96
- static readonly OR = 85;
97
- static readonly PICK = 86;
98
- static readonly PRIVATE_KW = 87;
99
- static readonly PUBLIC_KW = 88;
100
- static readonly QUARTER = 89;
101
- static readonly RIGHT = 90;
102
- static readonly SECOND = 91;
103
- static readonly STRING = 92;
104
- static readonly SOURCE_KW = 93;
105
- static readonly SUM = 94;
106
- static readonly SQL = 95;
107
- static readonly TABLE = 96;
108
- static readonly THEN = 97;
109
- static readonly THIS = 98;
110
- static readonly TIMESTAMPTZ = 99;
111
- static readonly TIMESTAMP = 100;
112
- static readonly TO = 101;
113
- static readonly TRUE = 102;
114
- static readonly TURTLE = 103;
115
- static readonly WEEK = 104;
116
- static readonly WHEN = 105;
117
- static readonly WITH = 106;
118
- static readonly YEAR = 107;
119
- static readonly UNGROUPED = 108;
120
- static readonly VIRTUAL = 109;
121
- static readonly HACKY_REGEX = 110;
122
- static readonly RAW_SQ = 111;
123
- static readonly RAW_DQ = 112;
124
- static readonly SQ3_FILTER = 113;
125
- static readonly SQ_FILTER = 114;
126
- static readonly DQ3_FILTER = 115;
127
- static readonly DQ_FILTER = 116;
128
- static readonly BQ3_FILTER = 117;
129
- static readonly BQ_FILTER = 118;
130
- static readonly SQ_STRING = 119;
131
- static readonly DQ_STRING = 120;
132
- static readonly BQ_STRING = 121;
133
- static readonly DOC_BLOCK_ANNOTATION_BEGIN = 122;
134
- static readonly BLOCK_ANNOTATION_BEGIN = 123;
135
- static readonly DOC_ANNOTATION = 124;
136
- static readonly ANNOTATION = 125;
137
- static readonly AMPER = 126;
138
- static readonly ARROW = 127;
139
- static readonly FAT_ARROW = 128;
140
- static readonly OPAREN = 129;
141
- static readonly CPAREN = 130;
142
- static readonly OBRACK = 131;
143
- static readonly CBRACK = 132;
144
- static readonly OCURLY = 133;
145
- static readonly CCURLY = 134;
146
- static readonly DOUBLECOLON = 135;
147
- static readonly TRIPLECOLON = 136;
148
- static readonly EXCLAM = 137;
149
- static readonly COLON = 138;
150
- static readonly COMMA = 139;
151
- static readonly DOT = 140;
152
- static readonly LT = 141;
153
- static readonly GT = 142;
154
- static readonly EQ = 143;
155
- static readonly NE = 144;
156
- static readonly LTE = 145;
157
- static readonly GTE = 146;
158
- static readonly PLUS = 147;
159
- static readonly MINUS = 148;
160
- static readonly STAR = 149;
161
- static readonly STARSTAR = 150;
162
- static readonly SLASH = 151;
163
- static readonly BAR = 152;
164
- static readonly SEMI = 153;
165
- static readonly NOT_MATCH = 154;
166
- static readonly MATCH = 155;
167
- static readonly PERCENT = 156;
168
- static readonly DOUBLE_QMARK = 157;
169
- static readonly QMARK = 158;
170
- static readonly LITERAL_TIMESTAMP = 159;
171
- static readonly LITERAL_HOUR = 160;
172
- static readonly LITERAL_DAY = 161;
173
- static readonly LITERAL_QUARTER = 162;
174
- static readonly LITERAL_MONTH = 163;
175
- static readonly LITERAL_WEEK = 164;
176
- static readonly LITERAL_YEAR = 165;
177
- static readonly IDENTIFIER = 166;
178
- static readonly PERCENT_LITERAL = 167;
179
- static readonly NUMERIC_LITERAL = 168;
180
- static readonly INTEGER_LITERAL = 169;
181
- static readonly BLOCK_COMMENT = 170;
182
- static readonly COMMENT_TO_EOL = 171;
183
- static readonly WHITE_SPACE = 172;
184
- static readonly SQL_BEGIN = 173;
185
- static readonly UNWATED_CHARS_TRAILING_NUMBERS = 174;
186
- static readonly UNEXPECTED_CHAR = 175;
187
- static readonly OPEN_CODE = 176;
188
- static readonly SQL_END = 177;
189
- static readonly BLOCK_ANNOTATION_END = 178;
190
- static readonly BLOCK_ANNOTATION_TEXT = 179;
22
+ static readonly GIVEN = 11;
23
+ static readonly GROUP_BY = 12;
24
+ static readonly GROUPED_BY = 13;
25
+ static readonly HAVING = 14;
26
+ static readonly INDEX = 15;
27
+ static readonly INTERNAL = 16;
28
+ static readonly JOIN_CROSS = 17;
29
+ static readonly JOIN_ONE = 18;
30
+ static readonly JOIN_MANY = 19;
31
+ static readonly LIMIT = 20;
32
+ static readonly MEASURE = 21;
33
+ static readonly NEST = 22;
34
+ static readonly ORDER_BY = 23;
35
+ static readonly PARTITION_BY = 24;
36
+ static readonly PRIMARY_KEY = 25;
37
+ static readonly PRIVATE = 26;
38
+ static readonly PROJECT = 27;
39
+ static readonly PUBLIC = 28;
40
+ static readonly QUERY = 29;
41
+ static readonly RENAME = 30;
42
+ static readonly RUN = 31;
43
+ static readonly SAMPLE = 32;
44
+ static readonly SELECT = 33;
45
+ static readonly SOURCE = 34;
46
+ static readonly TYPE = 35;
47
+ static readonly TOP = 36;
48
+ static readonly WHERE = 37;
49
+ static readonly VIEW = 38;
50
+ static readonly TIMEZONE = 39;
51
+ static readonly ALL = 40;
52
+ static readonly AND = 41;
53
+ static readonly AS = 42;
54
+ static readonly ASC = 43;
55
+ static readonly AVG = 44;
56
+ static readonly BOOLEAN = 45;
57
+ static readonly BY = 46;
58
+ static readonly CASE = 47;
59
+ static readonly CAST = 48;
60
+ static readonly CONDITION = 49;
61
+ static readonly COUNT = 50;
62
+ static readonly COMPOSE = 51;
63
+ static readonly DATE = 52;
64
+ static readonly DAY = 53;
65
+ static readonly DESC = 54;
66
+ static readonly DISTINCT = 55;
67
+ static readonly ELSE = 56;
68
+ static readonly END = 57;
69
+ static readonly EXCLUDE = 58;
70
+ static readonly EXTEND = 59;
71
+ static readonly FALSE = 60;
72
+ static readonly FILTER = 61;
73
+ static readonly FULL = 62;
74
+ static readonly FOR = 63;
75
+ static readonly FROM = 64;
76
+ static readonly HAS = 65;
77
+ static readonly HOUR = 66;
78
+ static readonly IMPORT = 67;
79
+ static readonly INCLUDE = 68;
80
+ static readonly INNER = 69;
81
+ static readonly IS = 70;
82
+ static readonly IN = 71;
83
+ static readonly INTERNAL_KW = 72;
84
+ static readonly JSON = 73;
85
+ static readonly LAST = 74;
86
+ static readonly LEFT = 75;
87
+ static readonly LIKE = 76;
88
+ static readonly MAX = 77;
89
+ static readonly MIN = 78;
90
+ static readonly MINUTE = 79;
91
+ static readonly MONTH = 80;
92
+ static readonly NOT = 81;
93
+ static readonly NOW = 82;
94
+ static readonly NULL = 83;
95
+ static readonly NUMBER = 84;
96
+ static readonly ON = 85;
97
+ static readonly OR = 86;
98
+ static readonly PICK = 87;
99
+ static readonly PRIVATE_KW = 88;
100
+ static readonly PUBLIC_KW = 89;
101
+ static readonly QUARTER = 90;
102
+ static readonly RIGHT = 91;
103
+ static readonly SECOND = 92;
104
+ static readonly STRING = 93;
105
+ static readonly SOURCE_KW = 94;
106
+ static readonly SUM = 95;
107
+ static readonly SQL = 96;
108
+ static readonly TABLE = 97;
109
+ static readonly THEN = 98;
110
+ static readonly THIS = 99;
111
+ static readonly TIMESTAMPTZ = 100;
112
+ static readonly TIMESTAMP = 101;
113
+ static readonly TO = 102;
114
+ static readonly TRUE = 103;
115
+ static readonly TURTLE = 104;
116
+ static readonly WEEK = 105;
117
+ static readonly WHEN = 106;
118
+ static readonly WITH = 107;
119
+ static readonly YEAR = 108;
120
+ static readonly UNGROUPED = 109;
121
+ static readonly VIRTUAL = 110;
122
+ static readonly HACKY_REGEX = 111;
123
+ static readonly RAW_SQ = 112;
124
+ static readonly RAW_DQ = 113;
125
+ static readonly SQ3_FILTER = 114;
126
+ static readonly SQ_FILTER = 115;
127
+ static readonly DQ3_FILTER = 116;
128
+ static readonly DQ_FILTER = 117;
129
+ static readonly BQ3_FILTER = 118;
130
+ static readonly BQ_FILTER = 119;
131
+ static readonly SQ_STRING = 120;
132
+ static readonly DQ_STRING = 121;
133
+ static readonly BQ_STRING = 122;
134
+ static readonly DOC_BLOCK_ANNOTATION_BEGIN = 123;
135
+ static readonly BLOCK_ANNOTATION_BEGIN = 124;
136
+ static readonly DOC_ANNOTATION = 125;
137
+ static readonly ANNOTATION = 126;
138
+ static readonly AMPER = 127;
139
+ static readonly ARROW = 128;
140
+ static readonly FAT_ARROW = 129;
141
+ static readonly OPAREN = 130;
142
+ static readonly CPAREN = 131;
143
+ static readonly OBRACK = 132;
144
+ static readonly CBRACK = 133;
145
+ static readonly OCURLY = 134;
146
+ static readonly CCURLY = 135;
147
+ static readonly DOUBLECOLON = 136;
148
+ static readonly TRIPLECOLON = 137;
149
+ static readonly EXCLAM = 138;
150
+ static readonly COLON = 139;
151
+ static readonly COMMA = 140;
152
+ static readonly DOT = 141;
153
+ static readonly LT = 142;
154
+ static readonly GT = 143;
155
+ static readonly EQ = 144;
156
+ static readonly NE = 145;
157
+ static readonly LTE = 146;
158
+ static readonly GTE = 147;
159
+ static readonly PLUS = 148;
160
+ static readonly MINUS = 149;
161
+ static readonly STAR = 150;
162
+ static readonly STARSTAR = 151;
163
+ static readonly SLASH = 152;
164
+ static readonly BAR = 153;
165
+ static readonly SEMI = 154;
166
+ static readonly NOT_MATCH = 155;
167
+ static readonly MATCH = 156;
168
+ static readonly PERCENT = 157;
169
+ static readonly DOUBLE_QMARK = 158;
170
+ static readonly QMARK = 159;
171
+ static readonly LITERAL_TIMESTAMP = 160;
172
+ static readonly LITERAL_HOUR = 161;
173
+ static readonly LITERAL_DAY = 162;
174
+ static readonly LITERAL_QUARTER = 163;
175
+ static readonly LITERAL_MONTH = 164;
176
+ static readonly LITERAL_WEEK = 165;
177
+ static readonly LITERAL_YEAR = 166;
178
+ static readonly GIVEN_REF = 167;
179
+ static readonly IDENTIFIER = 168;
180
+ static readonly PERCENT_LITERAL = 169;
181
+ static readonly NUMERIC_LITERAL = 170;
182
+ static readonly INTEGER_LITERAL = 171;
183
+ static readonly BLOCK_COMMENT = 172;
184
+ static readonly COMMENT_TO_EOL = 173;
185
+ static readonly WHITE_SPACE = 174;
186
+ static readonly SQL_BEGIN = 175;
187
+ static readonly UNWATED_CHARS_TRAILING_NUMBERS = 176;
188
+ static readonly UNEXPECTED_CHAR = 177;
189
+ static readonly OPEN_CODE = 178;
190
+ static readonly SQL_END = 179;
191
+ static readonly BLOCK_ANNOTATION_END = 180;
192
+ static readonly BLOCK_ANNOTATION_TEXT = 181;
191
193
  static readonly RULE_malloyDocument = 0;
192
194
  static readonly RULE_malloyStatement = 1;
193
195
  static readonly RULE_defineSourceStatement = 2;
@@ -200,171 +202,176 @@ export declare class MalloyParser extends Parser {
200
202
  static readonly RULE_userTypeField = 9;
201
203
  static readonly RULE_userTypeFieldType = 10;
202
204
  static readonly RULE_defineQuery = 11;
203
- static readonly RULE_topLevelAnonQueryDef = 12;
204
- static readonly RULE_annotation = 13;
205
- static readonly RULE_tags = 14;
206
- static readonly RULE_blockAnnotation = 15;
207
- static readonly RULE_docAnnotation = 16;
208
- static readonly RULE_docBlockAnnotation = 17;
209
- static readonly RULE_isDefine = 18;
210
- static readonly RULE_runStatement = 19;
211
- static readonly RULE_sqlString = 20;
212
- static readonly RULE_sqlInterpolation = 21;
213
- static readonly RULE_importStatement = 22;
214
- static readonly RULE_importSelect = 23;
215
- static readonly RULE_importItem = 24;
216
- static readonly RULE_importURL = 25;
217
- static readonly RULE_docAnnotations = 26;
218
- static readonly RULE_ignoredObjectAnnotations = 27;
219
- static readonly RULE_ignoredModelAnnotations = 28;
220
- static readonly RULE_topLevelQueryDefs = 29;
221
- static readonly RULE_topLevelQueryDef = 30;
222
- static readonly RULE_refineOperator = 31;
223
- static readonly RULE_turtleName = 32;
224
- static readonly RULE_sqlSource = 33;
225
- static readonly RULE_exploreTable = 34;
226
- static readonly RULE_virtualSource = 35;
227
- static readonly RULE_connectionId = 36;
228
- static readonly RULE_queryProperties = 37;
229
- static readonly RULE_queryName = 38;
230
- static readonly RULE_sourcePropertyList = 39;
231
- static readonly RULE_sourceDefinition = 40;
232
- static readonly RULE_sqExplore = 41;
233
- static readonly RULE_sourceParameters = 42;
234
- static readonly RULE_legalParamType = 43;
235
- static readonly RULE_sourceParameter = 44;
236
- static readonly RULE_parameterNameDef = 45;
237
- static readonly RULE_sourceNameDef = 46;
238
- static readonly RULE_exploreProperties = 47;
239
- static readonly RULE_exploreStatement = 48;
240
- static readonly RULE_accessLabel = 49;
241
- static readonly RULE_accessModifierList = 50;
242
- static readonly RULE_defMeasures = 51;
243
- static readonly RULE_defDimensions = 52;
244
- static readonly RULE_renameList = 53;
245
- static readonly RULE_renameEntry = 54;
246
- static readonly RULE_defList = 55;
247
- static readonly RULE_fieldDef = 56;
248
- static readonly RULE_fieldNameDef = 57;
249
- static readonly RULE_joinNameDef = 58;
250
- static readonly RULE_declareStatement = 59;
251
- static readonly RULE_joinStatement = 60;
252
- static readonly RULE_queryExtend = 61;
253
- static readonly RULE_modEither = 62;
254
- static readonly RULE_sourceArguments = 63;
255
- static readonly RULE_argumentId = 64;
256
- static readonly RULE_sourceArgument = 65;
257
- static readonly RULE_sqExpr = 66;
258
- static readonly RULE_sourceTypeConstraints = 67;
259
- static readonly RULE_userTypeName = 68;
260
- static readonly RULE_includeBlock = 69;
261
- static readonly RULE_includeItem = 70;
262
- static readonly RULE_orphanedAnnotation = 71;
263
- static readonly RULE_accessLabelProp = 72;
264
- static readonly RULE_includeExceptList = 73;
265
- static readonly RULE_includeExceptListItem = 74;
266
- static readonly RULE_includeList = 75;
267
- static readonly RULE_includeField = 76;
268
- static readonly RULE_segExpr = 77;
269
- static readonly RULE_vExpr = 78;
270
- static readonly RULE_queryExtendStatement = 79;
271
- static readonly RULE_queryExtendStatementList = 80;
272
- static readonly RULE_joinList = 81;
273
- static readonly RULE_isExplore = 82;
274
- static readonly RULE_matrixOperation = 83;
275
- static readonly RULE_joinFrom = 84;
276
- static readonly RULE_joinDef = 85;
277
- static readonly RULE_joinExpression = 86;
278
- static readonly RULE_filterStatement = 87;
279
- static readonly RULE_fieldProperties = 88;
280
- static readonly RULE_aggregateOrdering = 89;
281
- static readonly RULE_aggregateOrderBySpec = 90;
282
- static readonly RULE_aggregateOrderByStatement = 91;
283
- static readonly RULE_fieldPropertyLimitStatement = 92;
284
- static readonly RULE_fieldPropertyStatement = 93;
285
- static readonly RULE_filterClauseList = 94;
286
- static readonly RULE_whereStatement = 95;
287
- static readonly RULE_havingStatement = 96;
288
- static readonly RULE_subQueryDefList = 97;
289
- static readonly RULE_exploreQueryNameDef = 98;
290
- static readonly RULE_exploreQueryDef = 99;
291
- static readonly RULE_drillStatement = 100;
292
- static readonly RULE_drillClauseList = 101;
293
- static readonly RULE_queryStatement = 102;
294
- static readonly RULE_queryJoinStatement = 103;
295
- static readonly RULE_groupByStatement = 104;
296
- static readonly RULE_queryFieldList = 105;
297
- static readonly RULE_queryFieldEntry = 106;
298
- static readonly RULE_nestStatement = 107;
299
- static readonly RULE_nestedQueryList = 108;
300
- static readonly RULE_nestEntry = 109;
301
- static readonly RULE_aggregateStatement = 110;
302
- static readonly RULE_calculateStatement = 111;
303
- static readonly RULE_projectStatement = 112;
304
- static readonly RULE_partitionByStatement = 113;
305
- static readonly RULE_groupedByStatement = 114;
306
- static readonly RULE_orderByStatement = 115;
307
- static readonly RULE_ordering = 116;
308
- static readonly RULE_orderBySpec = 117;
309
- static readonly RULE_limitStatement = 118;
310
- static readonly RULE_bySpec = 119;
311
- static readonly RULE_topStatement = 120;
312
- static readonly RULE_indexElement = 121;
313
- static readonly RULE_indexFields = 122;
314
- static readonly RULE_indexStatement = 123;
315
- static readonly RULE_sampleStatement = 124;
316
- static readonly RULE_timezoneStatement = 125;
317
- static readonly RULE_queryAnnotation = 126;
318
- static readonly RULE_sampleSpec = 127;
319
- static readonly RULE_aggregate = 128;
320
- static readonly RULE_malloyType = 129;
321
- static readonly RULE_malloyBasicType = 130;
322
- static readonly RULE_malloyRecordType = 131;
323
- static readonly RULE_malloyRecordField = 132;
324
- static readonly RULE_compareOp = 133;
325
- static readonly RULE_string = 134;
326
- static readonly RULE_shortString = 135;
327
- static readonly RULE_rawString = 136;
328
- static readonly RULE_numericLiteral = 137;
329
- static readonly RULE_literal = 138;
330
- static readonly RULE_dateLiteral = 139;
331
- static readonly RULE_tablePath = 140;
332
- static readonly RULE_tableURI = 141;
333
- static readonly RULE_id = 142;
334
- static readonly RULE_timeframe = 143;
335
- static readonly RULE_ungroup = 144;
336
- static readonly RULE_malloyOrSQLType = 145;
337
- static readonly RULE_fieldExpr = 146;
338
- static readonly RULE_partialCompare = 147;
339
- static readonly RULE_partialTest = 148;
340
- static readonly RULE_partialAllowedFieldExpr = 149;
341
- static readonly RULE_fieldExprList = 150;
342
- static readonly RULE_pickStatement = 151;
343
- static readonly RULE_pick = 152;
344
- static readonly RULE_caseStatement = 153;
345
- static readonly RULE_caseWhen = 154;
346
- static readonly RULE_recordKey = 155;
347
- static readonly RULE_recordElement = 156;
348
- static readonly RULE_argumentList = 157;
349
- static readonly RULE_fieldNameList = 158;
350
- static readonly RULE_fieldCollection = 159;
351
- static readonly RULE_collectionWildCard = 160;
352
- static readonly RULE_starQualified = 161;
353
- static readonly RULE_taggedRef = 162;
354
- static readonly RULE_refExpr = 163;
355
- static readonly RULE_collectionMember = 164;
356
- static readonly RULE_fieldPath = 165;
357
- static readonly RULE_joinName = 166;
358
- static readonly RULE_fieldName = 167;
359
- static readonly RULE_sqlExploreNameRef = 168;
360
- static readonly RULE_nameSQLBlock = 169;
361
- static readonly RULE_connectionName = 170;
362
- static readonly RULE_tripFilterString = 171;
363
- static readonly RULE_tickFilterString = 172;
364
- static readonly RULE_filterString = 173;
365
- static readonly RULE_debugExpr = 174;
366
- static readonly RULE_debugPartial = 175;
367
- static readonly RULE_experimentalStatementForTesting = 176;
205
+ static readonly RULE_defineGivenStatement = 12;
206
+ static readonly RULE_givenDefList = 13;
207
+ static readonly RULE_givenDef = 14;
208
+ static readonly RULE_givenNameDef = 15;
209
+ static readonly RULE_givenType = 16;
210
+ static readonly RULE_topLevelAnonQueryDef = 17;
211
+ static readonly RULE_annotation = 18;
212
+ static readonly RULE_tags = 19;
213
+ static readonly RULE_blockAnnotation = 20;
214
+ static readonly RULE_docAnnotation = 21;
215
+ static readonly RULE_docBlockAnnotation = 22;
216
+ static readonly RULE_isDefine = 23;
217
+ static readonly RULE_runStatement = 24;
218
+ static readonly RULE_sqlString = 25;
219
+ static readonly RULE_sqlInterpolation = 26;
220
+ static readonly RULE_importStatement = 27;
221
+ static readonly RULE_importSelect = 28;
222
+ static readonly RULE_importItem = 29;
223
+ static readonly RULE_importURL = 30;
224
+ static readonly RULE_docAnnotations = 31;
225
+ static readonly RULE_ignoredObjectAnnotations = 32;
226
+ static readonly RULE_ignoredModelAnnotations = 33;
227
+ static readonly RULE_topLevelQueryDefs = 34;
228
+ static readonly RULE_topLevelQueryDef = 35;
229
+ static readonly RULE_refineOperator = 36;
230
+ static readonly RULE_turtleName = 37;
231
+ static readonly RULE_sqlSource = 38;
232
+ static readonly RULE_exploreTable = 39;
233
+ static readonly RULE_virtualSource = 40;
234
+ static readonly RULE_connectionId = 41;
235
+ static readonly RULE_queryProperties = 42;
236
+ static readonly RULE_queryName = 43;
237
+ static readonly RULE_sourcePropertyList = 44;
238
+ static readonly RULE_sourceDefinition = 45;
239
+ static readonly RULE_sqExplore = 46;
240
+ static readonly RULE_sourceParameters = 47;
241
+ static readonly RULE_legalParamType = 48;
242
+ static readonly RULE_sourceParameter = 49;
243
+ static readonly RULE_parameterNameDef = 50;
244
+ static readonly RULE_sourceNameDef = 51;
245
+ static readonly RULE_exploreProperties = 52;
246
+ static readonly RULE_exploreStatement = 53;
247
+ static readonly RULE_accessLabel = 54;
248
+ static readonly RULE_accessModifierList = 55;
249
+ static readonly RULE_defMeasures = 56;
250
+ static readonly RULE_defDimensions = 57;
251
+ static readonly RULE_renameList = 58;
252
+ static readonly RULE_renameEntry = 59;
253
+ static readonly RULE_defList = 60;
254
+ static readonly RULE_fieldDef = 61;
255
+ static readonly RULE_fieldNameDef = 62;
256
+ static readonly RULE_joinNameDef = 63;
257
+ static readonly RULE_declareStatement = 64;
258
+ static readonly RULE_joinStatement = 65;
259
+ static readonly RULE_queryExtend = 66;
260
+ static readonly RULE_modEither = 67;
261
+ static readonly RULE_sourceArguments = 68;
262
+ static readonly RULE_argumentId = 69;
263
+ static readonly RULE_sourceArgument = 70;
264
+ static readonly RULE_sqExpr = 71;
265
+ static readonly RULE_sourceTypeConstraints = 72;
266
+ static readonly RULE_userTypeName = 73;
267
+ static readonly RULE_includeBlock = 74;
268
+ static readonly RULE_includeItem = 75;
269
+ static readonly RULE_orphanedAnnotation = 76;
270
+ static readonly RULE_accessLabelProp = 77;
271
+ static readonly RULE_includeExceptList = 78;
272
+ static readonly RULE_includeExceptListItem = 79;
273
+ static readonly RULE_includeList = 80;
274
+ static readonly RULE_includeField = 81;
275
+ static readonly RULE_segExpr = 82;
276
+ static readonly RULE_vExpr = 83;
277
+ static readonly RULE_queryExtendStatement = 84;
278
+ static readonly RULE_queryExtendStatementList = 85;
279
+ static readonly RULE_joinList = 86;
280
+ static readonly RULE_isExplore = 87;
281
+ static readonly RULE_matrixOperation = 88;
282
+ static readonly RULE_joinFrom = 89;
283
+ static readonly RULE_joinDef = 90;
284
+ static readonly RULE_joinExpression = 91;
285
+ static readonly RULE_filterStatement = 92;
286
+ static readonly RULE_fieldProperties = 93;
287
+ static readonly RULE_aggregateOrdering = 94;
288
+ static readonly RULE_aggregateOrderBySpec = 95;
289
+ static readonly RULE_aggregateOrderByStatement = 96;
290
+ static readonly RULE_fieldPropertyLimitStatement = 97;
291
+ static readonly RULE_fieldPropertyStatement = 98;
292
+ static readonly RULE_filterClauseList = 99;
293
+ static readonly RULE_whereStatement = 100;
294
+ static readonly RULE_havingStatement = 101;
295
+ static readonly RULE_subQueryDefList = 102;
296
+ static readonly RULE_exploreQueryNameDef = 103;
297
+ static readonly RULE_exploreQueryDef = 104;
298
+ static readonly RULE_drillStatement = 105;
299
+ static readonly RULE_drillClauseList = 106;
300
+ static readonly RULE_queryStatement = 107;
301
+ static readonly RULE_queryJoinStatement = 108;
302
+ static readonly RULE_groupByStatement = 109;
303
+ static readonly RULE_queryFieldList = 110;
304
+ static readonly RULE_queryFieldEntry = 111;
305
+ static readonly RULE_nestStatement = 112;
306
+ static readonly RULE_nestedQueryList = 113;
307
+ static readonly RULE_nestEntry = 114;
308
+ static readonly RULE_aggregateStatement = 115;
309
+ static readonly RULE_calculateStatement = 116;
310
+ static readonly RULE_projectStatement = 117;
311
+ static readonly RULE_partitionByStatement = 118;
312
+ static readonly RULE_groupedByStatement = 119;
313
+ static readonly RULE_orderByStatement = 120;
314
+ static readonly RULE_ordering = 121;
315
+ static readonly RULE_orderBySpec = 122;
316
+ static readonly RULE_limitStatement = 123;
317
+ static readonly RULE_bySpec = 124;
318
+ static readonly RULE_topStatement = 125;
319
+ static readonly RULE_indexElement = 126;
320
+ static readonly RULE_indexFields = 127;
321
+ static readonly RULE_indexStatement = 128;
322
+ static readonly RULE_sampleStatement = 129;
323
+ static readonly RULE_timezoneStatement = 130;
324
+ static readonly RULE_queryAnnotation = 131;
325
+ static readonly RULE_sampleSpec = 132;
326
+ static readonly RULE_aggregate = 133;
327
+ static readonly RULE_malloyType = 134;
328
+ static readonly RULE_malloyBasicType = 135;
329
+ static readonly RULE_malloyRecordType = 136;
330
+ static readonly RULE_malloyRecordField = 137;
331
+ static readonly RULE_compareOp = 138;
332
+ static readonly RULE_string = 139;
333
+ static readonly RULE_shortString = 140;
334
+ static readonly RULE_rawString = 141;
335
+ static readonly RULE_numericLiteral = 142;
336
+ static readonly RULE_literal = 143;
337
+ static readonly RULE_dateLiteral = 144;
338
+ static readonly RULE_tablePath = 145;
339
+ static readonly RULE_tableURI = 146;
340
+ static readonly RULE_id = 147;
341
+ static readonly RULE_timeframe = 148;
342
+ static readonly RULE_ungroup = 149;
343
+ static readonly RULE_malloyOrSQLType = 150;
344
+ static readonly RULE_fieldExpr = 151;
345
+ static readonly RULE_partialCompare = 152;
346
+ static readonly RULE_partialTest = 153;
347
+ static readonly RULE_partialAllowedFieldExpr = 154;
348
+ static readonly RULE_fieldExprList = 155;
349
+ static readonly RULE_pickStatement = 156;
350
+ static readonly RULE_pick = 157;
351
+ static readonly RULE_caseStatement = 158;
352
+ static readonly RULE_caseWhen = 159;
353
+ static readonly RULE_recordKey = 160;
354
+ static readonly RULE_recordElement = 161;
355
+ static readonly RULE_argumentList = 162;
356
+ static readonly RULE_fieldNameList = 163;
357
+ static readonly RULE_fieldCollection = 164;
358
+ static readonly RULE_collectionWildCard = 165;
359
+ static readonly RULE_starQualified = 166;
360
+ static readonly RULE_taggedRef = 167;
361
+ static readonly RULE_refExpr = 168;
362
+ static readonly RULE_collectionMember = 169;
363
+ static readonly RULE_fieldPath = 170;
364
+ static readonly RULE_joinName = 171;
365
+ static readonly RULE_fieldName = 172;
366
+ static readonly RULE_sqlExploreNameRef = 173;
367
+ static readonly RULE_nameSQLBlock = 174;
368
+ static readonly RULE_connectionName = 175;
369
+ static readonly RULE_tripFilterString = 176;
370
+ static readonly RULE_tickFilterString = 177;
371
+ static readonly RULE_filterString = 178;
372
+ static readonly RULE_debugExpr = 179;
373
+ static readonly RULE_debugPartial = 180;
374
+ static readonly RULE_experimentalStatementForTesting = 181;
368
375
  static readonly ruleNames: string[];
369
376
  private static readonly _LITERAL_NAMES;
370
377
  private static readonly _SYMBOLIC_NAMES;
@@ -388,6 +395,11 @@ export declare class MalloyParser extends Parser {
388
395
  userTypeFieldType(): UserTypeFieldTypeContext;
389
396
  userTypeFieldType(_p: number): UserTypeFieldTypeContext;
390
397
  defineQuery(): DefineQueryContext;
398
+ defineGivenStatement(): DefineGivenStatementContext;
399
+ givenDefList(): GivenDefListContext;
400
+ givenDef(): GivenDefContext;
401
+ givenNameDef(): GivenNameDefContext;
402
+ givenType(): GivenTypeContext;
391
403
  topLevelAnonQueryDef(): TopLevelAnonQueryDefContext;
392
404
  annotation(): AnnotationContext;
393
405
  tags(): TagsContext;
@@ -588,6 +600,7 @@ export declare class MalloyStatementContext extends ParserRuleContext {
588
600
  defineSourceStatement(): DefineSourceStatementContext | undefined;
589
601
  defineUserTypeStatement(): DefineUserTypeStatementContext | undefined;
590
602
  defineQuery(): DefineQueryContext | undefined;
603
+ defineGivenStatement(): DefineGivenStatementContext | undefined;
591
604
  importStatement(): ImportStatementContext | undefined;
592
605
  runStatement(): RunStatementContext | undefined;
593
606
  docAnnotations(): DocAnnotationsContext | undefined;
@@ -727,6 +740,60 @@ export declare class Use_top_level_query_defsContext extends DefineQueryContext
727
740
  exitRule(listener: MalloyParserListener): void;
728
741
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
729
742
  }
743
+ export declare class DefineGivenStatementContext extends ParserRuleContext {
744
+ tags(): TagsContext;
745
+ GIVEN(): TerminalNode;
746
+ givenDefList(): GivenDefListContext;
747
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
748
+ get ruleIndex(): number;
749
+ enterRule(listener: MalloyParserListener): void;
750
+ exitRule(listener: MalloyParserListener): void;
751
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
752
+ }
753
+ export declare class GivenDefListContext extends ParserRuleContext {
754
+ givenDef(): GivenDefContext[];
755
+ givenDef(i: number): GivenDefContext;
756
+ COMMA(): TerminalNode[];
757
+ COMMA(i: number): TerminalNode;
758
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
759
+ get ruleIndex(): number;
760
+ enterRule(listener: MalloyParserListener): void;
761
+ exitRule(listener: MalloyParserListener): void;
762
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
763
+ }
764
+ export declare class GivenDefContext extends ParserRuleContext {
765
+ tags(): TagsContext;
766
+ givenNameDef(): GivenNameDefContext;
767
+ DOUBLECOLON(): TerminalNode;
768
+ givenType(): GivenTypeContext;
769
+ isDefine(): IsDefineContext | undefined;
770
+ fieldExpr(): FieldExprContext | undefined;
771
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
772
+ get ruleIndex(): number;
773
+ enterRule(listener: MalloyParserListener): void;
774
+ exitRule(listener: MalloyParserListener): void;
775
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
776
+ }
777
+ export declare class GivenNameDefContext extends ParserRuleContext {
778
+ id(): IdContext;
779
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
780
+ get ruleIndex(): number;
781
+ enterRule(listener: MalloyParserListener): void;
782
+ exitRule(listener: MalloyParserListener): void;
783
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
784
+ }
785
+ export declare class GivenTypeContext extends ParserRuleContext {
786
+ malloyType(): MalloyTypeContext | undefined;
787
+ FILTER(): TerminalNode | undefined;
788
+ LT(): TerminalNode | undefined;
789
+ malloyBasicType(): MalloyBasicTypeContext | undefined;
790
+ GT(): TerminalNode | undefined;
791
+ constructor(parent: ParserRuleContext | undefined, invokingState: number);
792
+ get ruleIndex(): number;
793
+ enterRule(listener: MalloyParserListener): void;
794
+ exitRule(listener: MalloyParserListener): void;
795
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
796
+ }
730
797
  export declare class TopLevelAnonQueryDefContext extends ParserRuleContext {
731
798
  tags(): TagsContext;
732
799
  sqExpr(): SqExprContext;
@@ -2509,6 +2576,13 @@ export declare class ExprFieldPathContext extends FieldExprContext {
2509
2576
  exitRule(listener: MalloyParserListener): void;
2510
2577
  accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
2511
2578
  }
2579
+ export declare class ExprGivenRefContext extends FieldExprContext {
2580
+ GIVEN_REF(): TerminalNode;
2581
+ constructor(ctx: FieldExprContext);
2582
+ enterRule(listener: MalloyParserListener): void;
2583
+ exitRule(listener: MalloyParserListener): void;
2584
+ accept<Result>(visitor: MalloyParserVisitor<Result>): Result;
2585
+ }
2512
2586
  export declare class ExprLiteralContext extends FieldExprContext {
2513
2587
  literal(): LiteralContext;
2514
2588
  constructor(ctx: FieldExprContext);