@malloydata/malloy 0.0.22-dev230207144036 → 0.0.22-dev230207180844

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 (359) hide show
  1. package/dist/connection_utils.d.ts +1 -0
  2. package/dist/connection_utils.js +66 -0
  3. package/dist/dialect/dialect.d.ts +66 -0
  4. package/dist/dialect/dialect.js +85 -0
  5. package/dist/dialect/dialect_map.d.ts +3 -0
  6. package/dist/dialect/dialect_map.js +45 -0
  7. package/dist/dialect/duckdb.d.ts +52 -0
  8. package/dist/dialect/duckdb.js +364 -0
  9. package/dist/dialect/index.d.ts +6 -0
  10. package/dist/dialect/index.js +37 -0
  11. package/dist/dialect/postgres.d.ts +52 -0
  12. package/dist/dialect/postgres.js +330 -0
  13. package/dist/dialect/standardsql.d.ts +49 -0
  14. package/dist/dialect/standardsql.js +381 -0
  15. package/dist/index.d.ts +10 -0
  16. package/dist/index.js +59 -0
  17. package/dist/lang/ast/ast-utils.d.ts +10 -0
  18. package/dist/lang/ast/ast-utils.js +42 -0
  19. package/dist/lang/ast/elements/define-query.d.ts +14 -0
  20. package/dist/lang/ast/elements/define-query.js +56 -0
  21. package/dist/lang/ast/elements/define-source.d.ts +17 -0
  22. package/dist/lang/ast/elements/define-source.js +79 -0
  23. package/dist/lang/ast/elements/import-statement.d.ts +9 -0
  24. package/dist/lang/ast/elements/import-statement.js +78 -0
  25. package/dist/lang/ast/elements/pipeline-desc.d.ts +30 -0
  26. package/dist/lang/ast/elements/pipeline-desc.js +102 -0
  27. package/dist/lang/ast/elements/refined-source.d.ts +15 -0
  28. package/dist/lang/ast/elements/refined-source.js +121 -0
  29. package/dist/lang/ast/elements/source.d.ts +12 -0
  30. package/dist/lang/ast/elements/source.js +53 -0
  31. package/dist/lang/ast/error-factory.d.ts +9 -0
  32. package/dist/lang/ast/error-factory.js +61 -0
  33. package/dist/lang/ast/executors/index-executor.d.ts +18 -0
  34. package/dist/lang/ast/executors/index-executor.js +96 -0
  35. package/dist/lang/ast/executors/project-executor.d.ts +10 -0
  36. package/dist/lang/ast/executors/project-executor.js +68 -0
  37. package/dist/lang/ast/executors/reduce-executor.d.ts +21 -0
  38. package/dist/lang/ast/executors/reduce-executor.js +149 -0
  39. package/dist/lang/ast/expressions/apply.d.ts +8 -0
  40. package/dist/lang/ast/expressions/apply.js +37 -0
  41. package/dist/lang/ast/expressions/binary-boolean.d.ts +12 -0
  42. package/dist/lang/ast/expressions/binary-boolean.js +54 -0
  43. package/dist/lang/ast/expressions/binary-numeric.d.ts +11 -0
  44. package/dist/lang/ast/expressions/binary-numeric.js +42 -0
  45. package/dist/lang/ast/expressions/boolean.d.ts +8 -0
  46. package/dist/lang/ast/expressions/boolean.js +39 -0
  47. package/dist/lang/ast/expressions/constant-sub-expression.d.ts +16 -0
  48. package/dist/lang/ast/expressions/constant-sub-expression.js +98 -0
  49. package/dist/lang/ast/expressions/expr-add-sub.d.ts +4 -0
  50. package/dist/lang/ast/expressions/expr-add-sub.js +34 -0
  51. package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +15 -0
  52. package/dist/lang/ast/expressions/expr-aggregate-function.js +99 -0
  53. package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +11 -0
  54. package/dist/lang/ast/expressions/expr-alternation-tree.js +54 -0
  55. package/dist/lang/ast/expressions/expr-asymmetric.d.ts +10 -0
  56. package/dist/lang/ast/expressions/expr-asymmetric.js +27 -0
  57. package/dist/lang/ast/expressions/expr-avg.d.ts +6 -0
  58. package/dist/lang/ast/expressions/expr-avg.js +34 -0
  59. package/dist/lang/ast/expressions/expr-cast.d.ts +13 -0
  60. package/dist/lang/ast/expressions/expr-cast.js +29 -0
  61. package/dist/lang/ast/expressions/expr-compare.d.ts +10 -0
  62. package/dist/lang/ast/expressions/expr-compare.js +58 -0
  63. package/dist/lang/ast/expressions/expr-count-distinct.d.ts +6 -0
  64. package/dist/lang/ast/expressions/expr-count-distinct.js +35 -0
  65. package/dist/lang/ast/expressions/expr-count.d.ts +11 -0
  66. package/dist/lang/ast/expressions/expr-count.js +57 -0
  67. package/dist/lang/ast/expressions/expr-filter.d.ts +12 -0
  68. package/dist/lang/ast/expressions/expr-filter.js +69 -0
  69. package/dist/lang/ast/expressions/expr-func.d.ts +10 -0
  70. package/dist/lang/ast/expressions/expr-func.js +63 -0
  71. package/dist/lang/ast/expressions/expr-granular-time.d.ts +24 -0
  72. package/dist/lang/ast/expressions/expr-granular-time.js +117 -0
  73. package/dist/lang/ast/expressions/expr-id-reference.d.ts +12 -0
  74. package/dist/lang/ast/expressions/expr-id-reference.js +75 -0
  75. package/dist/lang/ast/expressions/expr-logical-op.d.ts +9 -0
  76. package/dist/lang/ast/expressions/expr-logical-op.js +36 -0
  77. package/dist/lang/ast/expressions/expr-max.d.ts +9 -0
  78. package/dist/lang/ast/expressions/expr-max.js +16 -0
  79. package/dist/lang/ast/expressions/expr-min.d.ts +9 -0
  80. package/dist/lang/ast/expressions/expr-min.js +16 -0
  81. package/dist/lang/ast/expressions/expr-minus.d.ts +9 -0
  82. package/dist/lang/ast/expressions/expr-minus.js +48 -0
  83. package/dist/lang/ast/expressions/expr-mul-div.d.ts +4 -0
  84. package/dist/lang/ast/expressions/expr-mul-div.js +34 -0
  85. package/dist/lang/ast/expressions/expr-not.d.ts +10 -0
  86. package/dist/lang/ast/expressions/expr-not.js +49 -0
  87. package/dist/lang/ast/expressions/expr-now.d.ts +7 -0
  88. package/dist/lang/ast/expressions/expr-now.js +46 -0
  89. package/dist/lang/ast/expressions/expr-null.d.ts +6 -0
  90. package/dist/lang/ast/expressions/expr-null.js +41 -0
  91. package/dist/lang/ast/expressions/expr-number.d.ts +10 -0
  92. package/dist/lang/ast/expressions/expr-number.js +42 -0
  93. package/dist/lang/ast/expressions/expr-parens.d.ts +10 -0
  94. package/dist/lang/ast/expressions/expr-parens.js +42 -0
  95. package/dist/lang/ast/expressions/expr-regex.d.ts +8 -0
  96. package/dist/lang/ast/expressions/expr-regex.js +42 -0
  97. package/dist/lang/ast/expressions/expr-string.d.ts +9 -0
  98. package/dist/lang/ast/expressions/expr-string.js +50 -0
  99. package/dist/lang/ast/expressions/expr-sum.d.ts +6 -0
  100. package/dist/lang/ast/expressions/expr-sum.js +12 -0
  101. package/dist/lang/ast/expressions/expr-time-extract.d.ts +13 -0
  102. package/dist/lang/ast/expressions/expr-time-extract.js +117 -0
  103. package/dist/lang/ast/expressions/expr-time.d.ts +11 -0
  104. package/dist/lang/ast/expressions/expr-time.js +62 -0
  105. package/dist/lang/ast/expressions/expr-ungroup.d.ts +14 -0
  106. package/dist/lang/ast/expressions/expr-ungroup.js +83 -0
  107. package/dist/lang/ast/expressions/for-range.d.ts +19 -0
  108. package/dist/lang/ast/expressions/for-range.js +101 -0
  109. package/dist/lang/ast/expressions/granular-literal.d.ts +20 -0
  110. package/dist/lang/ast/expressions/granular-literal.js +148 -0
  111. package/dist/lang/ast/expressions/partial-compare.d.ts +14 -0
  112. package/dist/lang/ast/expressions/partial-compare.js +50 -0
  113. package/dist/lang/ast/expressions/pick-when.d.ts +19 -0
  114. package/dist/lang/ast/expressions/pick-when.js +156 -0
  115. package/dist/lang/ast/expressions/range.d.ts +12 -0
  116. package/dist/lang/ast/expressions/range.js +80 -0
  117. package/dist/lang/ast/expressions/time-frame.d.ts +7 -0
  118. package/dist/lang/ast/expressions/time-frame.js +40 -0
  119. package/dist/lang/ast/expressions/top-by.d.ts +10 -0
  120. package/dist/lang/ast/expressions/top-by.js +51 -0
  121. package/dist/lang/ast/expressions/unary.d.ts +5 -0
  122. package/dist/lang/ast/expressions/unary.js +34 -0
  123. package/dist/lang/ast/expressions/utils.d.ts +12 -0
  124. package/dist/lang/ast/expressions/utils.js +87 -0
  125. package/dist/lang/ast/field-space/column-space-field.d.ts +9 -0
  126. package/dist/lang/ast/field-space/column-space-field.js +40 -0
  127. package/dist/lang/ast/field-space/dynamic-space.d.ts +22 -0
  128. package/dist/lang/ast/field-space/dynamic-space.js +140 -0
  129. package/dist/lang/ast/field-space/field-definition-value.d.ts +16 -0
  130. package/dist/lang/ast/field-space/field-definition-value.js +55 -0
  131. package/dist/lang/ast/field-space/index-field-space.d.ts +10 -0
  132. package/dist/lang/ast/field-space/index-field-space.js +57 -0
  133. package/dist/lang/ast/field-space/join-space-field.d.ts +8 -0
  134. package/dist/lang/ast/field-space/join-space-field.js +35 -0
  135. package/dist/lang/ast/field-space/project-field-space.d.ts +6 -0
  136. package/dist/lang/ast/field-space/project-field-space.js +51 -0
  137. package/dist/lang/ast/field-space/query-field-struct.d.ts +10 -0
  138. package/dist/lang/ast/field-space/query-field-struct.js +46 -0
  139. package/dist/lang/ast/field-space/query-space-field.d.ts +11 -0
  140. package/dist/lang/ast/field-space/query-space-field.js +37 -0
  141. package/dist/lang/ast/field-space/query-spaces.d.ts +50 -0
  142. package/dist/lang/ast/field-space/query-spaces.js +233 -0
  143. package/dist/lang/ast/field-space/reference-field.d.ts +11 -0
  144. package/dist/lang/ast/field-space/reference-field.js +45 -0
  145. package/dist/lang/ast/field-space/refined-space.d.ts +13 -0
  146. package/dist/lang/ast/field-space/refined-space.js +100 -0
  147. package/dist/lang/ast/field-space/rename-space-field.d.ts +11 -0
  148. package/dist/lang/ast/field-space/rename-space-field.js +50 -0
  149. package/dist/lang/ast/field-space/static-space.d.ts +29 -0
  150. package/dist/lang/ast/field-space/static-space.js +156 -0
  151. package/dist/lang/ast/field-space/struct-space-field-base.d.ts +11 -0
  152. package/dist/lang/ast/field-space/struct-space-field-base.js +40 -0
  153. package/dist/lang/ast/field-space/wild-space-field.d.ts +10 -0
  154. package/dist/lang/ast/field-space/wild-space-field.js +40 -0
  155. package/dist/lang/ast/fragtype-utils.d.ts +39 -0
  156. package/dist/lang/ast/fragtype-utils.js +100 -0
  157. package/dist/lang/ast/index.d.ts +90 -0
  158. package/dist/lang/ast/index.js +129 -0
  159. package/dist/lang/ast/parameters/constant-parameter.d.ts +8 -0
  160. package/dist/lang/ast/parameters/constant-parameter.js +54 -0
  161. package/dist/lang/ast/parameters/has-parameter.d.ts +19 -0
  162. package/dist/lang/ast/parameters/has-parameter.js +64 -0
  163. package/dist/lang/ast/query-elements/anonymous-query.d.ts +9 -0
  164. package/dist/lang/ast/query-elements/anonymous-query.js +41 -0
  165. package/dist/lang/ast/query-elements/existing-query.d.ts +11 -0
  166. package/dist/lang/ast/query-elements/existing-query.js +79 -0
  167. package/dist/lang/ast/query-elements/full-query.d.ts +10 -0
  168. package/dist/lang/ast/query-elements/full-query.js +85 -0
  169. package/dist/lang/ast/query-elements/query-head-struct.d.ts +9 -0
  170. package/dist/lang/ast/query-elements/query-head-struct.js +48 -0
  171. package/dist/lang/ast/query-items/field-declaration.d.ts +31 -0
  172. package/dist/lang/ast/query-items/field-declaration.js +137 -0
  173. package/dist/lang/ast/query-items/field-references.d.ts +25 -0
  174. package/dist/lang/ast/query-items/field-references.js +80 -0
  175. package/dist/lang/ast/query-properties/aggregate.d.ts +5 -0
  176. package/dist/lang/ast/query-properties/aggregate.js +39 -0
  177. package/dist/lang/ast/query-properties/declare-fields.d.ts +5 -0
  178. package/dist/lang/ast/query-properties/declare-fields.js +33 -0
  179. package/dist/lang/ast/query-properties/dimmensions.d.ts +5 -0
  180. package/dist/lang/ast/query-properties/dimmensions.js +36 -0
  181. package/dist/lang/ast/query-properties/filters.d.ts +18 -0
  182. package/dist/lang/ast/query-properties/filters.js +89 -0
  183. package/dist/lang/ast/query-properties/group-by.d.ts +5 -0
  184. package/dist/lang/ast/query-properties/group-by.js +39 -0
  185. package/dist/lang/ast/query-properties/indexing.d.ts +10 -0
  186. package/dist/lang/ast/query-properties/indexing.js +39 -0
  187. package/dist/lang/ast/query-properties/joins.d.ts +36 -0
  188. package/dist/lang/ast/query-properties/joins.js +143 -0
  189. package/dist/lang/ast/query-properties/limit.d.ts +6 -0
  190. package/dist/lang/ast/query-properties/limit.js +35 -0
  191. package/dist/lang/ast/query-properties/measures.d.ts +5 -0
  192. package/dist/lang/ast/query-properties/measures.js +36 -0
  193. package/dist/lang/ast/query-properties/nest-reference.d.ts +7 -0
  194. package/dist/lang/ast/query-properties/nest-reference.js +35 -0
  195. package/dist/lang/ast/query-properties/nest.d.ts +31 -0
  196. package/dist/lang/ast/query-properties/nest.js +133 -0
  197. package/dist/lang/ast/query-properties/nests.d.ts +5 -0
  198. package/dist/lang/ast/query-properties/nests.js +33 -0
  199. package/dist/lang/ast/query-properties/ordering.d.ts +15 -0
  200. package/dist/lang/ast/query-properties/ordering.js +66 -0
  201. package/dist/lang/ast/query-properties/project-statement.d.ts +5 -0
  202. package/dist/lang/ast/query-properties/project-statement.js +33 -0
  203. package/dist/lang/ast/query-properties/qop-desc.d.ts +17 -0
  204. package/dist/lang/ast/query-properties/qop-desc.js +124 -0
  205. package/dist/lang/ast/query-properties/sampling.d.ts +8 -0
  206. package/dist/lang/ast/query-properties/sampling.js +38 -0
  207. package/dist/lang/ast/query-properties/top.d.ts +13 -0
  208. package/dist/lang/ast/query-properties/top.js +60 -0
  209. package/dist/lang/ast/source-properties/field-list-edit.d.ts +8 -0
  210. package/dist/lang/ast/source-properties/field-list-edit.js +36 -0
  211. package/dist/lang/ast/source-properties/primary-key.d.ts +7 -0
  212. package/dist/lang/ast/source-properties/primary-key.js +35 -0
  213. package/dist/lang/ast/source-properties/renames.d.ts +11 -0
  214. package/dist/lang/ast/source-properties/renames.js +43 -0
  215. package/dist/lang/ast/source-properties/turtles.d.ts +5 -0
  216. package/dist/lang/ast/source-properties/turtles.js +33 -0
  217. package/dist/lang/ast/sources/named-source.d.ts +19 -0
  218. package/dist/lang/ast/sources/named-source.js +147 -0
  219. package/dist/lang/ast/sources/query-source.d.ts +9 -0
  220. package/dist/lang/ast/sources/query-source.js +41 -0
  221. package/dist/lang/ast/sources/sql-source.d.ts +7 -0
  222. package/dist/lang/ast/sources/sql-source.js +54 -0
  223. package/dist/lang/ast/sources/table-source.d.ts +8 -0
  224. package/dist/lang/ast/sources/table-source.js +60 -0
  225. package/dist/lang/ast/space-seed.d.ts +16 -0
  226. package/dist/lang/ast/space-seed.js +59 -0
  227. package/dist/lang/ast/sql-elements/sql-statement.d.ts +19 -0
  228. package/dist/lang/ast/sql-elements/sql-statement.js +80 -0
  229. package/dist/lang/ast/sql-elements/sql-string.d.ts +12 -0
  230. package/dist/lang/ast/sql-elements/sql-string.js +60 -0
  231. package/dist/lang/ast/struct-utils.d.ts +4 -0
  232. package/dist/lang/ast/struct-utils.js +48 -0
  233. package/dist/lang/ast/time-utils.d.ts +12 -0
  234. package/dist/lang/ast/time-utils.js +140 -0
  235. package/dist/lang/ast/types/comparison.d.ts +11 -0
  236. package/dist/lang/ast/types/comparison.js +41 -0
  237. package/dist/lang/ast/types/document-compile-result.d.ts +8 -0
  238. package/dist/lang/ast/types/document-compile-result.js +25 -0
  239. package/dist/lang/ast/types/equality.d.ts +7 -0
  240. package/dist/lang/ast/types/equality.js +37 -0
  241. package/dist/lang/ast/types/executor.d.ts +9 -0
  242. package/dist/lang/ast/types/executor.js +25 -0
  243. package/dist/lang/ast/types/explore-desc.d.ts +5 -0
  244. package/dist/lang/ast/types/explore-desc.js +33 -0
  245. package/dist/lang/ast/types/explore-field.d.ts +5 -0
  246. package/dist/lang/ast/types/explore-field.js +32 -0
  247. package/dist/lang/ast/types/expr-result.d.ts +5 -0
  248. package/dist/lang/ast/types/expr-result.js +25 -0
  249. package/dist/lang/ast/types/expr-value.d.ts +3 -0
  250. package/dist/lang/ast/types/expr-value.js +25 -0
  251. package/dist/lang/ast/types/expression-def.d.ts +69 -0
  252. package/dist/lang/ast/types/expression-def.js +346 -0
  253. package/dist/lang/ast/types/field-collection-member.d.ts +5 -0
  254. package/dist/lang/ast/types/field-collection-member.js +34 -0
  255. package/dist/lang/ast/types/field-decl.d.ts +7 -0
  256. package/dist/lang/ast/types/field-decl.js +37 -0
  257. package/dist/lang/ast/types/field-space.d.ts +24 -0
  258. package/dist/lang/ast/types/field-space.js +44 -0
  259. package/dist/lang/ast/types/granular-result.d.ts +7 -0
  260. package/dist/lang/ast/types/granular-result.js +11 -0
  261. package/dist/lang/ast/types/lookup-result.d.ts +10 -0
  262. package/dist/lang/ast/types/lookup-result.js +25 -0
  263. package/dist/lang/ast/types/malloy-element.d.ts +106 -0
  264. package/dist/lang/ast/types/malloy-element.js +398 -0
  265. package/dist/lang/ast/types/model-entry.d.ts +6 -0
  266. package/dist/lang/ast/types/model-entry.js +25 -0
  267. package/dist/lang/ast/types/name-space.d.ts +5 -0
  268. package/dist/lang/ast/types/name-space.js +25 -0
  269. package/dist/lang/ast/types/nested-query.d.ts +3 -0
  270. package/dist/lang/ast/types/nested-query.js +25 -0
  271. package/dist/lang/ast/types/op-desc.d.ts +6 -0
  272. package/dist/lang/ast/types/op-desc.js +25 -0
  273. package/dist/lang/ast/types/query-comp.d.ts +5 -0
  274. package/dist/lang/ast/types/query-comp.js +25 -0
  275. package/dist/lang/ast/types/query-element.d.ts +5 -0
  276. package/dist/lang/ast/types/query-element.js +32 -0
  277. package/dist/lang/ast/types/query-item.d.ts +5 -0
  278. package/dist/lang/ast/types/query-item.js +25 -0
  279. package/dist/lang/ast/types/query-property.d.ts +17 -0
  280. package/dist/lang/ast/types/query-property.js +55 -0
  281. package/dist/lang/ast/types/source-property.d.ts +10 -0
  282. package/dist/lang/ast/types/source-property.js +43 -0
  283. package/dist/lang/ast/types/space-entry.d.ts +5 -0
  284. package/dist/lang/ast/types/space-entry.js +29 -0
  285. package/dist/lang/ast/types/space-field.d.ts +10 -0
  286. package/dist/lang/ast/types/space-field.js +48 -0
  287. package/dist/lang/ast/types/space-param.d.ts +20 -0
  288. package/dist/lang/ast/types/space-param.js +61 -0
  289. package/dist/lang/ast/types/time-result.d.ts +6 -0
  290. package/dist/lang/ast/types/time-result.js +25 -0
  291. package/dist/lang/ast/types/turtle-headed-pipe.d.ts +7 -0
  292. package/dist/lang/ast/types/turtle-headed-pipe.js +37 -0
  293. package/dist/lang/ast/types/type-desc.d.ts +7 -0
  294. package/dist/lang/ast/types/type-desc.js +25 -0
  295. package/dist/lang/field-utils.d.ts +5 -0
  296. package/dist/lang/field-utils.js +43 -0
  297. package/dist/lang/index.d.ts +10 -0
  298. package/dist/lang/index.js +32 -0
  299. package/dist/lang/lib/Malloy/MalloyLexer.d.ts +165 -0
  300. package/dist/lang/lib/Malloy/MalloyLexer.js +1232 -0
  301. package/dist/lang/lib/Malloy/MalloyParser.d.ts +1947 -0
  302. package/dist/lang/lib/Malloy/MalloyParser.js +11909 -0
  303. package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +2022 -0
  304. package/dist/lang/lib/Malloy/MalloyParserListener.js +4 -0
  305. package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +1274 -0
  306. package/dist/lang/lib/Malloy/MalloyParserVisitor.js +4 -0
  307. package/dist/lang/malloy-to-ast.d.ts +155 -0
  308. package/dist/lang/malloy-to-ast.js +990 -0
  309. package/dist/lang/parse-error-handler.d.ts +9 -0
  310. package/dist/lang/parse-error-handler.js +44 -0
  311. package/dist/lang/parse-log.d.ts +27 -0
  312. package/dist/lang/parse-log.js +51 -0
  313. package/dist/lang/parse-malloy.d.ts +182 -0
  314. package/dist/lang/parse-malloy.js +728 -0
  315. package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +10 -0
  316. package/dist/lang/parse-tree-walkers/document-completion-walker.js +148 -0
  317. package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +9 -0
  318. package/dist/lang/parse-tree-walkers/document-help-context-walker.js +107 -0
  319. package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +83 -0
  320. package/dist/lang/parse-tree-walkers/document-highlight-walker.js +385 -0
  321. package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +11 -0
  322. package/dist/lang/parse-tree-walkers/document-symbol-walker.js +182 -0
  323. package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +34 -0
  324. package/dist/lang/parse-tree-walkers/explore-query-walker.js +74 -0
  325. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +11 -0
  326. package/dist/lang/parse-tree-walkers/find-external-references.js +61 -0
  327. package/dist/lang/reference-list.d.ts +10 -0
  328. package/dist/lang/reference-list.js +90 -0
  329. package/dist/lang/test/document-help-context-walker.spec.d.ts +1 -0
  330. package/dist/lang/test/document-help-context-walker.spec.js +55 -0
  331. package/dist/lang/test/document-symbol-walker.spec.d.ts +1 -0
  332. package/dist/lang/test/document-symbol-walker.spec.js +110 -0
  333. package/dist/lang/test/field-symbols.spec.d.ts +1 -0
  334. package/dist/lang/test/field-symbols.spec.js +184 -0
  335. package/dist/lang/test/parse.spec.d.ts +14 -0
  336. package/dist/lang/test/parse.spec.js +2135 -0
  337. package/dist/lang/test/test-translator.d.ts +41 -0
  338. package/dist/lang/test/test-translator.js +344 -0
  339. package/dist/lang/translate-response.d.ts +59 -0
  340. package/dist/lang/translate-response.js +30 -0
  341. package/dist/lang/zone.d.ts +57 -0
  342. package/dist/lang/zone.js +107 -0
  343. package/dist/malloy.d.ts +1146 -0
  344. package/dist/malloy.js +2413 -0
  345. package/dist/model/index.d.ts +2 -0
  346. package/dist/model/index.js +45 -0
  347. package/dist/model/malloy_query.d.ts +351 -0
  348. package/dist/model/malloy_query.js +3174 -0
  349. package/dist/model/malloy_types.d.ts +551 -0
  350. package/dist/model/malloy_types.js +378 -0
  351. package/dist/model/sql_block.d.ts +7 -0
  352. package/dist/model/sql_block.js +56 -0
  353. package/dist/model/utils.d.ts +22 -0
  354. package/dist/model/utils.js +102 -0
  355. package/dist/run_sql_options.d.ts +3 -0
  356. package/dist/run_sql_options.js +25 -0
  357. package/dist/runtime_types.d.ts +105 -0
  358. package/dist/runtime_types.js +25 -0
  359. package/package.json +2 -2
@@ -0,0 +1,68 @@
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.ProjectExecutor = void 0;
26
+ const malloy_types_1 = require("../../../model/malloy_types");
27
+ const error_factory_1 = require("../error-factory");
28
+ const measures_1 = require("../query-properties/measures");
29
+ const filters_1 = require("../query-properties/filters");
30
+ const group_by_1 = require("../query-properties/group-by");
31
+ const project_statement_1 = require("../query-properties/project-statement");
32
+ const project_field_space_1 = require("../field-space/project-field-space");
33
+ const reduce_executor_1 = require("./reduce-executor");
34
+ class ProjectExecutor extends reduce_executor_1.ReduceExecutor {
35
+ getResultSpace(fs) {
36
+ return new project_field_space_1.ProjectFieldSpace(fs);
37
+ }
38
+ execute(qp) {
39
+ if (qp instanceof project_statement_1.ProjectStatement) {
40
+ this.resultFS.addMembers(qp.list);
41
+ }
42
+ else if ((qp instanceof filters_1.Filter && qp.elementType === "having") ||
43
+ qp instanceof measures_1.Measures ||
44
+ qp instanceof group_by_1.GroupBy) {
45
+ qp.log("Illegal statement in a project query operation");
46
+ }
47
+ else {
48
+ super.execute(qp);
49
+ }
50
+ }
51
+ finalize(fromSeg) {
52
+ let from;
53
+ if (fromSeg) {
54
+ if ((0, malloy_types_1.isProjectSegment)(fromSeg)) {
55
+ from = fromSeg;
56
+ }
57
+ else {
58
+ this.resultFS.log(`Can't refine project with ${fromSeg.type}`);
59
+ return error_factory_1.ErrorFactory.projectSegment;
60
+ }
61
+ }
62
+ const projectSegment = this.resultFS.getQuerySegment(from);
63
+ this.refineFrom(from, projectSegment);
64
+ return projectSegment;
65
+ }
66
+ }
67
+ exports.ProjectExecutor = ProjectExecutor;
68
+ //# sourceMappingURL=project-executor.js.map
@@ -0,0 +1,21 @@
1
+ import { FilterExpression, PipeSegment, QuerySegment } from "../../../model/malloy_types";
2
+ import { FieldSpace } from "../types/field-space";
3
+ import { Ordering } from "../query-properties/ordering";
4
+ import { Top } from "../query-properties/top";
5
+ import { QueryProperty } from "../types/query-property";
6
+ import { Executor } from "../types/executor";
7
+ import { QueryInputSpace, QuerySpace } from "../field-space/query-spaces";
8
+ import { DynamicSpace } from "../field-space/dynamic-space";
9
+ export declare class ReduceExecutor implements Executor {
10
+ inputFS: QueryInputSpace;
11
+ resultFS: QuerySpace;
12
+ filters: FilterExpression[];
13
+ order?: Top | Ordering;
14
+ limit?: number;
15
+ refinedInputFS?: DynamicSpace;
16
+ constructor(baseFS: FieldSpace);
17
+ getResultSpace(fs: FieldSpace): QuerySpace;
18
+ execute(qp: QueryProperty): void;
19
+ refineFrom(from: PipeSegment | undefined, to: QuerySegment): void;
20
+ finalize(fromSeg: PipeSegment | undefined): PipeSegment;
21
+ }
@@ -0,0 +1,149 @@
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.ReduceExecutor = void 0;
26
+ const malloy_types_1 = require("../../../model/malloy_types");
27
+ const error_factory_1 = require("../error-factory");
28
+ const aggregate_1 = require("../query-properties/aggregate");
29
+ const declare_fields_1 = require("../query-properties/declare-fields");
30
+ const filters_1 = require("../query-properties/filters");
31
+ const group_by_1 = require("../query-properties/group-by");
32
+ const joins_1 = require("../query-properties/joins");
33
+ const limit_1 = require("../query-properties/limit");
34
+ const ordering_1 = require("../query-properties/ordering");
35
+ const top_1 = require("../query-properties/top");
36
+ const nests_1 = require("../query-properties/nests");
37
+ const nest_1 = require("../query-properties/nest");
38
+ const query_spaces_1 = require("../field-space/query-spaces");
39
+ class ReduceExecutor {
40
+ constructor(baseFS) {
41
+ this.filters = [];
42
+ this.resultFS = this.getResultSpace(baseFS);
43
+ this.inputFS = this.resultFS.exprSpace;
44
+ }
45
+ getResultSpace(fs) {
46
+ return new query_spaces_1.ReduceFieldSpace(fs);
47
+ }
48
+ execute(qp) {
49
+ if (qp instanceof group_by_1.GroupBy ||
50
+ qp instanceof aggregate_1.Aggregate ||
51
+ qp instanceof nests_1.Nests) {
52
+ this.resultFS.addQueryItems(...qp.list);
53
+ }
54
+ else if ((0, nest_1.isNestedQuery)(qp)) {
55
+ this.resultFS.addQueryItems(qp);
56
+ }
57
+ else if (qp instanceof filters_1.Filter) {
58
+ this.filters.push(...qp.getFilterList(this.inputFS));
59
+ }
60
+ else if (qp instanceof top_1.Top) {
61
+ if (this.limit) {
62
+ qp.log("Query operation already limited");
63
+ }
64
+ else {
65
+ this.limit = qp.limit;
66
+ }
67
+ if (qp.by) {
68
+ if (this.order) {
69
+ qp.log("Query operation is already sorted");
70
+ }
71
+ else {
72
+ this.order = qp;
73
+ }
74
+ }
75
+ }
76
+ else if (qp instanceof limit_1.Limit) {
77
+ if (this.limit) {
78
+ qp.log("Query operation already limited");
79
+ }
80
+ else {
81
+ this.limit = qp.limit;
82
+ }
83
+ }
84
+ else if (qp instanceof ordering_1.Ordering) {
85
+ if (this.order) {
86
+ qp.log("Query operation already sorted");
87
+ }
88
+ else {
89
+ this.order = qp;
90
+ }
91
+ }
92
+ else if (qp instanceof joins_1.Joins || qp instanceof declare_fields_1.DeclareFields) {
93
+ for (const qel of qp.list) {
94
+ this.inputFS.extendSource(qel);
95
+ }
96
+ }
97
+ }
98
+ refineFrom(from, to) {
99
+ if (from && from.type !== "index") {
100
+ if (!this.order) {
101
+ if (from.orderBy) {
102
+ to.orderBy = from.orderBy;
103
+ }
104
+ else if (from.by) {
105
+ to.by = from.by;
106
+ }
107
+ }
108
+ if (!this.limit && from.limit) {
109
+ to.limit = from.limit;
110
+ }
111
+ }
112
+ if (this.limit) {
113
+ to.limit = this.limit;
114
+ }
115
+ if (this.order instanceof top_1.Top) {
116
+ const topBy = this.order.getBy(this.inputFS);
117
+ if (topBy) {
118
+ to.by = topBy;
119
+ }
120
+ }
121
+ if (this.order instanceof ordering_1.Ordering) {
122
+ to.orderBy = this.order.getOrderBy(this.inputFS);
123
+ }
124
+ const oldFilters = (from === null || from === void 0 ? void 0 : from.filterList) || [];
125
+ if (this.filters.length > 0 && !oldFilters) {
126
+ to.filterList = this.filters;
127
+ }
128
+ else if (oldFilters) {
129
+ to.filterList = [...oldFilters, ...this.filters];
130
+ }
131
+ }
132
+ finalize(fromSeg) {
133
+ let from;
134
+ if (fromSeg) {
135
+ if ((0, malloy_types_1.isReduceSegment)(fromSeg)) {
136
+ from = fromSeg;
137
+ }
138
+ else {
139
+ this.inputFS.result.log(`Can't refine reduce with ${fromSeg.type}`);
140
+ return error_factory_1.ErrorFactory.reduceSegment;
141
+ }
142
+ }
143
+ const reduceSegment = this.resultFS.getQuerySegment(from);
144
+ this.refineFrom(from, reduceSegment);
145
+ return reduceSegment;
146
+ }
147
+ }
148
+ exports.ReduceExecutor = ReduceExecutor;
149
+ //# sourceMappingURL=reduce-executor.js.map
@@ -0,0 +1,8 @@
1
+ import { ExprCompare } from "./expr-compare";
2
+ import { ExpressionDef } from "../types/expression-def";
3
+ export declare class Apply extends ExprCompare {
4
+ readonly left: ExpressionDef;
5
+ readonly right: ExpressionDef;
6
+ elementType: string;
7
+ constructor(left: ExpressionDef, right: ExpressionDef);
8
+ }
@@ -0,0 +1,37 @@
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.Apply = void 0;
26
+ const comparison_1 = require("../types/comparison");
27
+ const expr_compare_1 = require("./expr-compare");
28
+ class Apply extends expr_compare_1.ExprCompare {
29
+ constructor(left, right) {
30
+ super(left, comparison_1.Comparison.EqualTo, right);
31
+ this.left = left;
32
+ this.right = right;
33
+ this.elementType = "apply";
34
+ }
35
+ }
36
+ exports.Apply = Apply;
37
+ //# sourceMappingURL=apply.js.map
@@ -0,0 +1,12 @@
1
+ import { FieldSpace } from "../types/field-space";
2
+ import { ExprValue } from "../types/expr-value";
3
+ import { ExpressionDef } from "../types/expression-def";
4
+ export declare abstract class BinaryBoolean<opType extends string> extends ExpressionDef {
5
+ readonly left: ExpressionDef;
6
+ readonly op: opType;
7
+ readonly right: ExpressionDef;
8
+ elementType: string;
9
+ legalChildTypes: import("../types/type-desc").TypeDesc[];
10
+ constructor(left: ExpressionDef, op: opType, right: ExpressionDef);
11
+ getExpression(fs: FieldSpace): ExprValue;
12
+ }
@@ -0,0 +1,54 @@
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.BinaryBoolean = void 0;
26
+ const malloy_types_1 = require("../../../model/malloy_types");
27
+ const ast_utils_1 = require("../ast-utils");
28
+ const fragtype_utils_1 = require("../fragtype-utils");
29
+ const expression_def_1 = require("../types/expression-def");
30
+ const utils_1 = require("./utils");
31
+ class BinaryBoolean extends expression_def_1.ExpressionDef {
32
+ constructor(left, op, right) {
33
+ super({ left, right });
34
+ this.left = left;
35
+ this.op = op;
36
+ this.right = right;
37
+ this.elementType = "abstract boolean binary";
38
+ this.legalChildTypes = [fragtype_utils_1.FT.boolT];
39
+ }
40
+ getExpression(fs) {
41
+ const left = this.left.getExpression(fs);
42
+ const right = this.right.getExpression(fs);
43
+ if (this.typeCheck(this.left, left) && this.typeCheck(this.right, right)) {
44
+ return {
45
+ dataType: "boolean",
46
+ expressionType: (0, malloy_types_1.maxExpressionType)(left.expressionType, right.expressionType),
47
+ value: (0, utils_1.compose)(left.value, this.op, right.value),
48
+ };
49
+ }
50
+ return (0, ast_utils_1.errorFor)("logial required boolean");
51
+ }
52
+ }
53
+ exports.BinaryBoolean = BinaryBoolean;
54
+ //# sourceMappingURL=binary-boolean.js.map
@@ -0,0 +1,11 @@
1
+ import { ExprValue } from "../types/expr-value";
2
+ import { FieldSpace } from "../types/field-space";
3
+ import { ExpressionDef } from "../types/expression-def";
4
+ export declare abstract class BinaryNumeric<opType extends string> extends ExpressionDef {
5
+ readonly left: ExpressionDef;
6
+ readonly op: opType;
7
+ readonly right: ExpressionDef;
8
+ elementType: string;
9
+ constructor(left: ExpressionDef, op: opType, right: ExpressionDef);
10
+ getExpression(fs: FieldSpace): ExprValue;
11
+ }
@@ -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.BinaryNumeric = void 0;
26
+ const fragtype_utils_1 = require("../fragtype-utils");
27
+ const expression_def_1 = require("../types/expression-def");
28
+ class BinaryNumeric extends expression_def_1.ExpressionDef {
29
+ constructor(left, op, right) {
30
+ super({ left, right });
31
+ this.left = left;
32
+ this.op = op;
33
+ this.right = right;
34
+ this.elementType = "numeric binary abstract";
35
+ this.legalChildTypes = [fragtype_utils_1.FT.numberT];
36
+ }
37
+ getExpression(fs) {
38
+ return this.right.apply(fs, this.op, this.left);
39
+ }
40
+ }
41
+ exports.BinaryNumeric = BinaryNumeric;
42
+ //# sourceMappingURL=binary-numeric.js.map
@@ -0,0 +1,8 @@
1
+ import { ExprValue } from "../types/expr-value";
2
+ import { ExpressionDef } from "../types/expression-def";
3
+ export declare class Boolean extends ExpressionDef {
4
+ readonly value: "true" | "false";
5
+ elementType: string;
6
+ constructor(value: "true" | "false");
7
+ getExpression(): ExprValue;
8
+ }
@@ -0,0 +1,39 @@
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.Boolean = void 0;
26
+ const expression_def_1 = require("../types/expression-def");
27
+ const fragtype_utils_1 = require("../fragtype-utils");
28
+ class Boolean extends expression_def_1.ExpressionDef {
29
+ constructor(value) {
30
+ super();
31
+ this.value = value;
32
+ this.elementType = "boolean literal";
33
+ }
34
+ getExpression() {
35
+ return { ...fragtype_utils_1.FT.boolT, value: [this.value] };
36
+ }
37
+ }
38
+ exports.Boolean = Boolean;
39
+ //# sourceMappingURL=boolean.js.map
@@ -0,0 +1,16 @@
1
+ import { AtomicFieldType } from "../../../model/malloy_types";
2
+ import { ExprValue } from "../types/expr-value";
3
+ import { ExpressionDef } from "../types/expression-def";
4
+ import { FieldSpace } from "../types/field-space";
5
+ export declare class ConstantSubExpression extends ExpressionDef {
6
+ readonly expr: ExpressionDef;
7
+ elementType: string;
8
+ private cfs?;
9
+ constructor(expr: ExpressionDef);
10
+ getExpression(_fs: FieldSpace): ExprValue;
11
+ private get constantFs();
12
+ constantValue(): ExprValue;
13
+ constantCondition(type: AtomicFieldType): ExprValue;
14
+ apply(fs: FieldSpace, op: string, expr: ExpressionDef): ExprValue;
15
+ requestExpression(fs: FieldSpace): ExprValue | undefined;
16
+ }
@@ -0,0 +1,98 @@
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.ConstantSubExpression = void 0;
26
+ const comparison_1 = require("../types/comparison");
27
+ const expr_compare_1 = require("./expr-compare");
28
+ const expression_def_1 = require("../types/expression-def");
29
+ const utils_1 = require("./utils");
30
+ class ConstantFieldSpace {
31
+ constructor() {
32
+ this.type = "fieldSpace";
33
+ }
34
+ structDef() {
35
+ throw new Error("ConstantFieldSpace cannot generate a structDef");
36
+ }
37
+ emptyStructDef() {
38
+ throw new Error("ConstantFieldSpace cannot generate a structDef");
39
+ }
40
+ lookup(_name) {
41
+ return {
42
+ error: "Only constants allowed in parameter expressions",
43
+ found: undefined,
44
+ };
45
+ }
46
+ dialectObj() {
47
+ return undefined;
48
+ }
49
+ whenComplete(step) {
50
+ step();
51
+ }
52
+ }
53
+ class DollarReference extends expression_def_1.ExpressionDef {
54
+ constructor(refType) {
55
+ super();
56
+ this.refType = refType;
57
+ this.elementType = "$";
58
+ }
59
+ getExpression(_fs) {
60
+ return {
61
+ dataType: this.refType,
62
+ value: [{ type: "applyVal" }],
63
+ expressionType: "scalar",
64
+ };
65
+ }
66
+ }
67
+ class ConstantSubExpression extends expression_def_1.ExpressionDef {
68
+ constructor(expr) {
69
+ super({ expr });
70
+ this.expr = expr;
71
+ this.elementType = "constantExpression";
72
+ }
73
+ getExpression(_fs) {
74
+ return this.constantValue();
75
+ }
76
+ get constantFs() {
77
+ if (!this.cfs) {
78
+ this.cfs = new ConstantFieldSpace();
79
+ }
80
+ return this.cfs;
81
+ }
82
+ constantValue() {
83
+ return this.expr.getExpression(this.constantFs);
84
+ }
85
+ constantCondition(type) {
86
+ const compareAndContrast = new expr_compare_1.ExprCompare(new DollarReference(type), comparison_1.Comparison.EqualTo, this.expr);
87
+ const application = compareAndContrast.getExpression(this.constantFs);
88
+ return { ...application, value: (0, utils_1.compressExpr)(application.value) };
89
+ }
90
+ apply(fs, op, expr) {
91
+ return this.expr.apply(fs, op, expr);
92
+ }
93
+ requestExpression(fs) {
94
+ return this.expr.requestExpression(fs);
95
+ }
96
+ }
97
+ exports.ConstantSubExpression = ConstantSubExpression;
98
+ //# sourceMappingURL=constant-sub-expression.js.map
@@ -0,0 +1,4 @@
1
+ import { BinaryNumeric } from "./binary-numeric";
2
+ export declare class ExprAddSub extends BinaryNumeric<"+" | "-"> {
3
+ elementType: string;
4
+ }
@@ -0,0 +1,34 @@
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.ExprAddSub = void 0;
26
+ const binary_numeric_1 = require("./binary-numeric");
27
+ class ExprAddSub extends binary_numeric_1.BinaryNumeric {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.elementType = "+-";
31
+ }
32
+ }
33
+ exports.ExprAddSub = ExprAddSub;
34
+ //# sourceMappingURL=expr-add-sub.js.map
@@ -0,0 +1,15 @@
1
+ import { ExprValue } from "../types/expr-value";
2
+ import { FieldValueType } from "../types/type-desc";
3
+ import { FieldReference } from "../query-items/field-references";
4
+ import { FieldSpace } from "../types/field-space";
5
+ import { ExpressionDef } from "../types/expression-def";
6
+ export declare abstract class ExprAggregateFunction extends ExpressionDef {
7
+ readonly func: string;
8
+ elementType: string;
9
+ source?: FieldReference;
10
+ expr?: ExpressionDef;
11
+ legalChildTypes: import("../types/type-desc").TypeDesc[];
12
+ constructor(func: string, expr?: ExpressionDef);
13
+ returns(_forExpression: ExprValue): FieldValueType;
14
+ getExpression(fs: FieldSpace): ExprValue;
15
+ }