@malloydata/malloy 0.0.24-dev230224184907 → 0.0.24-dev230228224434

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 (310) hide show
  1. package/dist/connection_utils.js +10 -10
  2. package/dist/dialect/dialect.d.ts +2 -2
  3. package/dist/dialect/dialect.js +13 -13
  4. package/dist/dialect/dialect_map.d.ts +1 -1
  5. package/dist/dialect/duckdb.d.ts +3 -3
  6. package/dist/dialect/duckdb.js +44 -44
  7. package/dist/dialect/index.d.ts +6 -6
  8. package/dist/dialect/postgres.d.ts +3 -3
  9. package/dist/dialect/postgres.js +46 -46
  10. package/dist/dialect/standardsql.d.ts +4 -4
  11. package/dist/dialect/standardsql.js +51 -51
  12. package/dist/index.d.ts +10 -10
  13. package/dist/lang/ast/ast-utils.d.ts +1 -1
  14. package/dist/lang/ast/ast-utils.js +3 -3
  15. package/dist/lang/ast/elements/define-query.d.ts +3 -3
  16. package/dist/lang/ast/elements/define-query.js +6 -6
  17. package/dist/lang/ast/elements/define-source.d.ts +4 -4
  18. package/dist/lang/ast/elements/define-source.js +8 -8
  19. package/dist/lang/ast/elements/import-statement.d.ts +2 -2
  20. package/dist/lang/ast/elements/import-statement.js +7 -7
  21. package/dist/lang/ast/elements/pipeline-desc.d.ts +5 -5
  22. package/dist/lang/ast/elements/pipeline-desc.js +11 -11
  23. package/dist/lang/ast/elements/refined-source.d.ts +4 -4
  24. package/dist/lang/ast/elements/refined-source.js +6 -6
  25. package/dist/lang/ast/elements/source.d.ts +3 -3
  26. package/dist/lang/ast/elements/source.js +1 -1
  27. package/dist/lang/ast/error-factory.d.ts +1 -1
  28. package/dist/lang/ast/error-factory.js +15 -15
  29. package/dist/lang/ast/executors/index-executor.d.ts +7 -7
  30. package/dist/lang/ast/executors/index-executor.js +4 -4
  31. package/dist/lang/ast/executors/project-executor.d.ts +5 -5
  32. package/dist/lang/ast/executors/project-executor.js +2 -2
  33. package/dist/lang/ast/executors/reduce-executor.d.ts +8 -8
  34. package/dist/lang/ast/executors/reduce-executor.js +5 -5
  35. package/dist/lang/ast/expressions/apply.d.ts +2 -2
  36. package/dist/lang/ast/expressions/apply.js +1 -1
  37. package/dist/lang/ast/expressions/binary-boolean.d.ts +3 -3
  38. package/dist/lang/ast/expressions/binary-boolean.js +6 -6
  39. package/dist/lang/ast/expressions/binary-numeric.d.ts +3 -3
  40. package/dist/lang/ast/expressions/binary-numeric.js +2 -2
  41. package/dist/lang/ast/expressions/boolean.d.ts +4 -4
  42. package/dist/lang/ast/expressions/boolean.js +2 -2
  43. package/dist/lang/ast/expressions/constant-sub-expression.d.ts +4 -4
  44. package/dist/lang/ast/expressions/constant-sub-expression.js +12 -12
  45. package/dist/lang/ast/expressions/expr-add-sub.d.ts +2 -2
  46. package/dist/lang/ast/expressions/expr-add-sub.js +1 -1
  47. package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +5 -5
  48. package/dist/lang/ast/expressions/expr-aggregate-function.js +15 -15
  49. package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +6 -6
  50. package/dist/lang/ast/expressions/expr-alternation-tree.js +6 -6
  51. package/dist/lang/ast/expressions/expr-asymmetric.d.ts +5 -5
  52. package/dist/lang/ast/expressions/expr-asymmetric.js +3 -3
  53. package/dist/lang/ast/expressions/expr-avg.d.ts +3 -3
  54. package/dist/lang/ast/expressions/expr-avg.js +2 -2
  55. package/dist/lang/ast/expressions/expr-cast.d.ts +4 -4
  56. package/dist/lang/ast/expressions/expr-cast.js +6 -6
  57. package/dist/lang/ast/expressions/expr-compare.d.ts +5 -5
  58. package/dist/lang/ast/expressions/expr-compare.js +9 -9
  59. package/dist/lang/ast/expressions/expr-count-distinct.d.ts +2 -2
  60. package/dist/lang/ast/expressions/expr-count-distinct.js +1 -1
  61. package/dist/lang/ast/expressions/expr-count.d.ts +4 -4
  62. package/dist/lang/ast/expressions/expr-count.js +10 -10
  63. package/dist/lang/ast/expressions/expr-filter.d.ts +4 -4
  64. package/dist/lang/ast/expressions/expr-filter.js +13 -13
  65. package/dist/lang/ast/expressions/expr-func.d.ts +3 -3
  66. package/dist/lang/ast/expressions/expr-func.js +8 -8
  67. package/dist/lang/ast/expressions/expr-granular-time.d.ts +4 -4
  68. package/dist/lang/ast/expressions/expr-granular-time.js +17 -17
  69. package/dist/lang/ast/expressions/expr-id-reference.d.ts +4 -4
  70. package/dist/lang/ast/expressions/expr-id-reference.js +11 -11
  71. package/dist/lang/ast/expressions/expr-logical-op.d.ts +2 -2
  72. package/dist/lang/ast/expressions/expr-logical-op.js +1 -1
  73. package/dist/lang/ast/expressions/expr-max.d.ts +4 -4
  74. package/dist/lang/ast/expressions/expr-max.js +1 -1
  75. package/dist/lang/ast/expressions/expr-min.d.ts +4 -4
  76. package/dist/lang/ast/expressions/expr-min.js +1 -1
  77. package/dist/lang/ast/expressions/expr-minus.d.ts +3 -3
  78. package/dist/lang/ast/expressions/expr-minus.js +5 -5
  79. package/dist/lang/ast/expressions/expr-mul-div.d.ts +2 -2
  80. package/dist/lang/ast/expressions/expr-mul-div.js +1 -1
  81. package/dist/lang/ast/expressions/expr-not.d.ts +4 -4
  82. package/dist/lang/ast/expressions/expr-not.js +3 -3
  83. package/dist/lang/ast/expressions/expr-now.d.ts +3 -3
  84. package/dist/lang/ast/expressions/expr-now.js +8 -8
  85. package/dist/lang/ast/expressions/expr-null.d.ts +2 -2
  86. package/dist/lang/ast/expressions/expr-null.js +4 -4
  87. package/dist/lang/ast/expressions/expr-number.d.ts +3 -3
  88. package/dist/lang/ast/expressions/expr-number.js +2 -2
  89. package/dist/lang/ast/expressions/expr-parens.d.ts +3 -3
  90. package/dist/lang/ast/expressions/expr-parens.js +3 -3
  91. package/dist/lang/ast/expressions/expr-regex.d.ts +2 -2
  92. package/dist/lang/ast/expressions/expr-regex.js +4 -4
  93. package/dist/lang/ast/expressions/expr-string.d.ts +3 -3
  94. package/dist/lang/ast/expressions/expr-string.js +8 -8
  95. package/dist/lang/ast/expressions/expr-sum.d.ts +3 -3
  96. package/dist/lang/ast/expressions/expr-sum.js +2 -2
  97. package/dist/lang/ast/expressions/expr-time-extract.d.ts +4 -4
  98. package/dist/lang/ast/expressions/expr-time-extract.js +30 -30
  99. package/dist/lang/ast/expressions/expr-time.d.ts +4 -4
  100. package/dist/lang/ast/expressions/expr-time.js +10 -10
  101. package/dist/lang/ast/expressions/expr-ungroup.d.ts +6 -6
  102. package/dist/lang/ast/expressions/expr-ungroup.js +13 -13
  103. package/dist/lang/ast/expressions/for-range.d.ts +4 -4
  104. package/dist/lang/ast/expressions/for-range.js +17 -17
  105. package/dist/lang/ast/expressions/granular-literal.d.ts +4 -4
  106. package/dist/lang/ast/expressions/granular-literal.js +34 -34
  107. package/dist/lang/ast/expressions/partial-compare.d.ts +4 -4
  108. package/dist/lang/ast/expressions/partial-compare.js +4 -4
  109. package/dist/lang/ast/expressions/pick-when.d.ts +4 -4
  110. package/dist/lang/ast/expressions/pick-when.js +32 -32
  111. package/dist/lang/ast/expressions/range.d.ts +3 -3
  112. package/dist/lang/ast/expressions/range.js +20 -20
  113. package/dist/lang/ast/expressions/time-frame.d.ts +2 -2
  114. package/dist/lang/ast/expressions/time-frame.js +3 -3
  115. package/dist/lang/ast/expressions/top-by.d.ts +4 -4
  116. package/dist/lang/ast/expressions/top-by.js +5 -5
  117. package/dist/lang/ast/expressions/unary.d.ts +1 -1
  118. package/dist/lang/ast/expressions/unary.js +1 -1
  119. package/dist/lang/ast/expressions/utils.d.ts +2 -2
  120. package/dist/lang/ast/expressions/utils.js +6 -6
  121. package/dist/lang/ast/field-space/column-space-field.d.ts +3 -3
  122. package/dist/lang/ast/field-space/dynamic-space.d.ts +7 -7
  123. package/dist/lang/ast/field-space/dynamic-space.js +2 -2
  124. package/dist/lang/ast/field-space/field-definition-value.d.ts +5 -5
  125. package/dist/lang/ast/field-space/index-field-space.d.ts +3 -3
  126. package/dist/lang/ast/field-space/index-field-space.js +4 -4
  127. package/dist/lang/ast/field-space/join-space-field.d.ts +3 -3
  128. package/dist/lang/ast/field-space/project-field-space.d.ts +2 -2
  129. package/dist/lang/ast/field-space/project-field-space.js +5 -5
  130. package/dist/lang/ast/field-space/query-field-struct.d.ts +3 -3
  131. package/dist/lang/ast/field-space/query-field-struct.js +1 -1
  132. package/dist/lang/ast/field-space/query-space-field.d.ts +4 -4
  133. package/dist/lang/ast/field-space/query-space-field.js +1 -1
  134. package/dist/lang/ast/field-space/query-spaces.d.ts +11 -11
  135. package/dist/lang/ast/field-space/query-spaces.js +8 -8
  136. package/dist/lang/ast/field-space/reference-field.d.ts +5 -5
  137. package/dist/lang/ast/field-space/reference-field.js +1 -1
  138. package/dist/lang/ast/field-space/refined-space.d.ts +4 -4
  139. package/dist/lang/ast/field-space/refined-space.js +2 -2
  140. package/dist/lang/ast/field-space/rename-space-field.d.ts +3 -3
  141. package/dist/lang/ast/field-space/rename-space-field.js +2 -2
  142. package/dist/lang/ast/field-space/static-space.d.ts +7 -7
  143. package/dist/lang/ast/field-space/static-space.js +12 -12
  144. package/dist/lang/ast/field-space/struct-space-field-base.d.ts +4 -4
  145. package/dist/lang/ast/field-space/struct-space-field-base.js +1 -1
  146. package/dist/lang/ast/field-space/wild-space-field.d.ts +4 -4
  147. package/dist/lang/ast/field-space/wild-space-field.js +1 -1
  148. package/dist/lang/ast/fragtype-utils.d.ts +1 -1
  149. package/dist/lang/ast/fragtype-utils.js +15 -15
  150. package/dist/lang/ast/index.d.ts +90 -90
  151. package/dist/lang/ast/parameters/constant-parameter.d.ts +3 -3
  152. package/dist/lang/ast/parameters/constant-parameter.js +10 -10
  153. package/dist/lang/ast/parameters/has-parameter.d.ts +3 -3
  154. package/dist/lang/ast/parameters/has-parameter.js +7 -7
  155. package/dist/lang/ast/query-elements/anonymous-query.d.ts +3 -3
  156. package/dist/lang/ast/query-elements/anonymous-query.js +2 -2
  157. package/dist/lang/ast/query-elements/existing-query.d.ts +4 -4
  158. package/dist/lang/ast/query-elements/existing-query.js +10 -10
  159. package/dist/lang/ast/query-elements/full-query.d.ts +4 -4
  160. package/dist/lang/ast/query-elements/full-query.js +10 -10
  161. package/dist/lang/ast/query-elements/query-head-struct.d.ts +2 -2
  162. package/dist/lang/ast/query-elements/query-head-struct.js +2 -2
  163. package/dist/lang/ast/query-items/field-declaration.d.ts +6 -6
  164. package/dist/lang/ast/query-items/field-declaration.js +14 -14
  165. package/dist/lang/ast/query-items/field-references.d.ts +6 -6
  166. package/dist/lang/ast/query-items/field-references.js +9 -9
  167. package/dist/lang/ast/query-properties/aggregate.d.ts +2 -2
  168. package/dist/lang/ast/query-properties/aggregate.js +1 -1
  169. package/dist/lang/ast/query-properties/declare-fields.d.ts +2 -2
  170. package/dist/lang/ast/query-properties/declare-fields.js +1 -1
  171. package/dist/lang/ast/query-properties/dimmensions.d.ts +2 -2
  172. package/dist/lang/ast/query-properties/dimmensions.js +1 -1
  173. package/dist/lang/ast/query-properties/filters.d.ts +4 -4
  174. package/dist/lang/ast/query-properties/filters.js +16 -16
  175. package/dist/lang/ast/query-properties/group-by.d.ts +2 -2
  176. package/dist/lang/ast/query-properties/group-by.js +1 -1
  177. package/dist/lang/ast/query-properties/indexing.d.ts +3 -3
  178. package/dist/lang/ast/query-properties/indexing.js +3 -3
  179. package/dist/lang/ast/query-properties/joins.d.ts +6 -6
  180. package/dist/lang/ast/query-properties/joins.js +27 -27
  181. package/dist/lang/ast/query-properties/limit.d.ts +1 -1
  182. package/dist/lang/ast/query-properties/limit.js +1 -1
  183. package/dist/lang/ast/query-properties/measures.d.ts +2 -2
  184. package/dist/lang/ast/query-properties/measures.js +1 -1
  185. package/dist/lang/ast/query-properties/nest-reference.d.ts +2 -2
  186. package/dist/lang/ast/query-properties/nest-reference.js +1 -1
  187. package/dist/lang/ast/query-properties/nest.d.ts +7 -7
  188. package/dist/lang/ast/query-properties/nest.js +7 -7
  189. package/dist/lang/ast/query-properties/nests.d.ts +2 -2
  190. package/dist/lang/ast/query-properties/nests.js +1 -1
  191. package/dist/lang/ast/query-properties/ordering.d.ts +3 -3
  192. package/dist/lang/ast/query-properties/ordering.js +6 -6
  193. package/dist/lang/ast/query-properties/project-statement.d.ts +2 -2
  194. package/dist/lang/ast/query-properties/project-statement.js +1 -1
  195. package/dist/lang/ast/query-properties/qop-desc.d.ts +7 -7
  196. package/dist/lang/ast/query-properties/qop-desc.js +20 -20
  197. package/dist/lang/ast/query-properties/sampling.d.ts +2 -2
  198. package/dist/lang/ast/query-properties/sampling.js +1 -1
  199. package/dist/lang/ast/query-properties/top.d.ts +4 -4
  200. package/dist/lang/ast/query-properties/top.js +5 -5
  201. package/dist/lang/ast/source-properties/field-list-edit.d.ts +4 -4
  202. package/dist/lang/ast/source-properties/field-list-edit.js +2 -2
  203. package/dist/lang/ast/source-properties/primary-key.d.ts +2 -2
  204. package/dist/lang/ast/source-properties/primary-key.js +2 -2
  205. package/dist/lang/ast/source-properties/renames.d.ts +2 -2
  206. package/dist/lang/ast/source-properties/renames.js +3 -3
  207. package/dist/lang/ast/source-properties/turtles.d.ts +2 -2
  208. package/dist/lang/ast/source-properties/turtles.js +1 -1
  209. package/dist/lang/ast/sources/named-source.d.ts +4 -4
  210. package/dist/lang/ast/sources/named-source.js +5 -5
  211. package/dist/lang/ast/sources/query-source.d.ts +3 -3
  212. package/dist/lang/ast/sources/query-source.js +3 -3
  213. package/dist/lang/ast/sources/sql-source.d.ts +2 -2
  214. package/dist/lang/ast/sources/sql-source.js +2 -2
  215. package/dist/lang/ast/sources/table-source.d.ts +2 -2
  216. package/dist/lang/ast/sources/table-source.js +7 -7
  217. package/dist/lang/ast/space-seed.d.ts +2 -2
  218. package/dist/lang/ast/space-seed.js +1 -1
  219. package/dist/lang/ast/sql-elements/sql-statement.d.ts +4 -4
  220. package/dist/lang/ast/sql-elements/sql-statement.js +9 -9
  221. package/dist/lang/ast/sql-elements/sql-string.d.ts +3 -3
  222. package/dist/lang/ast/sql-elements/sql-string.js +6 -6
  223. package/dist/lang/ast/struct-utils.d.ts +2 -2
  224. package/dist/lang/ast/struct-utils.js +3 -3
  225. package/dist/lang/ast/time-utils.d.ts +6 -6
  226. package/dist/lang/ast/time-utils.js +46 -46
  227. package/dist/lang/ast/types/document-compile-result.d.ts +2 -2
  228. package/dist/lang/ast/types/executor.d.ts +3 -3
  229. package/dist/lang/ast/types/explore-desc.d.ts +2 -2
  230. package/dist/lang/ast/types/explore-desc.js +1 -1
  231. package/dist/lang/ast/types/explore-field.d.ts +3 -3
  232. package/dist/lang/ast/types/expr-result.d.ts +2 -2
  233. package/dist/lang/ast/types/expr-value.d.ts +2 -2
  234. package/dist/lang/ast/types/expression-def.d.ts +4 -4
  235. package/dist/lang/ast/types/expression-def.js +86 -86
  236. package/dist/lang/ast/types/field-collection-member.d.ts +3 -3
  237. package/dist/lang/ast/types/field-decl.d.ts +5 -5
  238. package/dist/lang/ast/types/field-space.d.ts +5 -5
  239. package/dist/lang/ast/types/field-space.js +1 -1
  240. package/dist/lang/ast/types/granular-result.d.ts +3 -3
  241. package/dist/lang/ast/types/granular-result.js +1 -1
  242. package/dist/lang/ast/types/lookup-result.d.ts +1 -1
  243. package/dist/lang/ast/types/malloy-element.d.ts +6 -6
  244. package/dist/lang/ast/types/malloy-element.js +49 -49
  245. package/dist/lang/ast/types/model-entry.d.ts +1 -1
  246. package/dist/lang/ast/types/name-space.d.ts +1 -1
  247. package/dist/lang/ast/types/nested-query.d.ts +2 -2
  248. package/dist/lang/ast/types/op-desc.d.ts +2 -2
  249. package/dist/lang/ast/types/query-comp.d.ts +1 -1
  250. package/dist/lang/ast/types/query-element.d.ts +3 -3
  251. package/dist/lang/ast/types/query-item.d.ts +4 -4
  252. package/dist/lang/ast/types/query-property.d.ts +15 -15
  253. package/dist/lang/ast/types/source-property.d.ts +8 -8
  254. package/dist/lang/ast/types/space-entry.d.ts +2 -2
  255. package/dist/lang/ast/types/space-field.d.ts +4 -4
  256. package/dist/lang/ast/types/space-field.js +4 -4
  257. package/dist/lang/ast/types/space-param.d.ts +4 -4
  258. package/dist/lang/ast/types/space-param.js +4 -4
  259. package/dist/lang/ast/types/time-result.d.ts +2 -2
  260. package/dist/lang/ast/types/turtle-headed-pipe.d.ts +2 -2
  261. package/dist/lang/ast/types/turtle-headed-pipe.js +1 -1
  262. package/dist/lang/ast/types/type-desc.d.ts +3 -3
  263. package/dist/lang/field-utils.d.ts +1 -1
  264. package/dist/lang/field-utils.js +4 -4
  265. package/dist/lang/index.d.ts +10 -10
  266. package/dist/lang/malloy-to-ast.d.ts +8 -8
  267. package/dist/lang/malloy-to-ast.js +68 -68
  268. package/dist/lang/parse-error-handler.d.ts +3 -3
  269. package/dist/lang/parse-error-handler.js +4 -4
  270. package/dist/lang/parse-log.d.ts +2 -2
  271. package/dist/lang/parse-log.js +1 -1
  272. package/dist/lang/parse-malloy.d.ts +7 -7
  273. package/dist/lang/parse-malloy.js +81 -81
  274. package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +2 -2
  275. package/dist/lang/parse-tree-walkers/document-completion-walker.js +38 -38
  276. package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +1 -1
  277. package/dist/lang/parse-tree-walkers/document-help-context-walker.js +14 -14
  278. package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +3 -3
  279. package/dist/lang/parse-tree-walkers/document-highlight-walker.js +85 -85
  280. package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +4 -4
  281. package/dist/lang/parse-tree-walkers/document-symbol-walker.js +40 -40
  282. package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +3 -3
  283. package/dist/lang/parse-tree-walkers/explore-query-walker.js +3 -3
  284. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +4 -4
  285. package/dist/lang/parse-tree-walkers/find-external-references.js +2 -2
  286. package/dist/lang/reference-list.d.ts +1 -1
  287. package/dist/lang/test/document-help-context-walker.spec.js +9 -9
  288. package/dist/lang/test/document-symbol-walker.spec.js +32 -32
  289. package/dist/lang/test/field-symbols.spec.js +87 -87
  290. package/dist/lang/test/parse.spec.d.ts +1 -1
  291. package/dist/lang/test/parse.spec.js +768 -768
  292. package/dist/lang/test/test-translator.d.ts +6 -6
  293. package/dist/lang/test/test-translator.js +159 -159
  294. package/dist/lang/translate-response.d.ts +7 -7
  295. package/dist/lang/translate-response.js +1 -1
  296. package/dist/lang/zone.d.ts +5 -5
  297. package/dist/lang/zone.js +8 -8
  298. package/dist/malloy.d.ts +7 -7
  299. package/dist/malloy.js +192 -192
  300. package/dist/model/index.d.ts +2 -2
  301. package/dist/model/malloy_query.d.ts +12 -12
  302. package/dist/model/malloy_query.js +497 -502
  303. package/dist/model/malloy_types.d.ts +68 -68
  304. package/dist/model/malloy_types.js +102 -102
  305. package/dist/model/sql_block.d.ts +1 -1
  306. package/dist/model/sql_block.js +4 -4
  307. package/dist/model/utils.d.ts +1 -1
  308. package/dist/model/utils.js +10 -10
  309. package/dist/runtime_types.d.ts +2 -2
  310. package/package.json +4 -1
@@ -84,10 +84,10 @@ class ParseStep {
84
84
  that.urlIsFullPath = true;
85
85
  }
86
86
  catch (e) {
87
- const msg = e instanceof Error ? e.message : "";
87
+ const msg = e instanceof Error ? e.message : '';
88
88
  that.urlIsFullPath = false;
89
89
  that.root.logger.log({
90
- "message": `Could not compute full path URL: ${msg}`
90
+ message: `Could not compute full path URL: ${msg}`,
91
91
  });
92
92
  }
93
93
  }
@@ -95,8 +95,8 @@ class ParseStep {
95
95
  return that.fatalErrors();
96
96
  }
97
97
  const srcEnt = that.root.importZone.getEntry(that.sourceURL);
98
- if (srcEnt.status !== "present") {
99
- if (srcEnt.status === "error") {
98
+ if (srcEnt.status !== 'present') {
99
+ if (srcEnt.status === 'error') {
100
100
  const message = srcEnt.message.includes(that.sourceURL)
101
101
  ? `import error: ${srcEnt.message}`
102
102
  : `import '${that.sourceURL}' error: ${srcEnt.message}`;
@@ -105,9 +105,9 @@ class ParseStep {
105
105
  this.response = that.fatalErrors();
106
106
  return this.response;
107
107
  }
108
- return { "urls": [that.sourceURL] };
108
+ return { urls: [that.sourceURL] };
109
109
  }
110
- const source = srcEnt.value == "" ? "\n" : srcEnt.value;
110
+ const source = srcEnt.value === '' ? '\n' : srcEnt.value;
111
111
  this.sourceInfo = this.getSourceInfo(source);
112
112
  let parse;
113
113
  try {
@@ -115,14 +115,14 @@ class ParseStep {
115
115
  }
116
116
  catch (parseException) {
117
117
  that.root.logger.log({
118
- "message": `Malloy internal parser exception [${parseException.message}]`
118
+ message: `Malloy internal parser exception [${parseException.message}]`,
119
119
  });
120
120
  parse = undefined;
121
121
  }
122
122
  if (that.root.logger.hasErrors()) {
123
123
  this.response = {
124
124
  parse,
125
- ...that.fatalErrors()
125
+ ...that.fatalErrors(),
126
126
  };
127
127
  }
128
128
  else {
@@ -137,21 +137,21 @@ class ParseStep {
137
137
  getSourceInfo(code) {
138
138
  const eolRegex = /\r?\n/;
139
139
  const info = {
140
- "at": [],
141
- "lines": [],
142
- "length": code.length
140
+ at: [],
141
+ lines: [],
142
+ length: code.length,
143
143
  };
144
144
  let src = code;
145
145
  let lineStart = 0;
146
- while (src !== "") {
146
+ while (src !== '') {
147
147
  const eol = src.match(eolRegex);
148
- if (eol && eol.index != undefined) {
148
+ if (eol && eol.index !== undefined) {
149
149
  // line text DOES NOT include the EOL
150
150
  info.lines.push(src.slice(0, eol.index));
151
151
  const lineLength = eol.index + eol[0].length;
152
152
  info.at.push({
153
- "begin": lineStart,
154
- "end": lineStart + lineLength
153
+ begin: lineStart,
154
+ end: lineStart + lineLength,
155
155
  });
156
156
  lineStart += lineLength;
157
157
  src = src.slice(lineLength);
@@ -159,7 +159,7 @@ class ParseStep {
159
159
  else {
160
160
  // last line, does not have a line end
161
161
  info.lines.push(src);
162
- info.at.push({ "begin": lineStart, "end": lineStart + src.length });
162
+ info.at.push({ begin: lineStart, end: lineStart + src.length });
163
163
  break;
164
164
  }
165
165
  }
@@ -180,12 +180,12 @@ class ParseStep {
180
180
  throw new Error(`No such parse rule as ${that.grammarRule}`);
181
181
  }
182
182
  return {
183
- "root": parseFunc.call(malloyParser),
184
- "tokenStream": tokenStream,
185
- "sourceStream": inputStream,
183
+ root: parseFunc.call(malloyParser),
184
+ tokenStream: tokenStream,
185
+ sourceStream: inputStream,
186
186
  // TODO put the real version here
187
- "malloyVersion": "?.?.?-????",
188
- "subTranslator": that
187
+ malloyVersion: '?.?.?-????',
188
+ subTranslator: that,
189
189
  };
190
190
  }
191
191
  }
@@ -196,7 +196,7 @@ class ImportsAndTablesStep {
196
196
  }
197
197
  step(that) {
198
198
  const parseReq = this.parseStep.step(that);
199
- if (parseReq.parse == undefined) {
199
+ if (parseReq.parse === undefined) {
200
200
  return parseReq;
201
201
  }
202
202
  if (!this.alreadyLooked) {
@@ -205,8 +205,8 @@ class ImportsAndTablesStep {
205
205
  if (parseRefs === null || parseRefs === void 0 ? void 0 : parseRefs.tables) {
206
206
  for (const ref in parseRefs.tables) {
207
207
  that.root.schemaZone.reference(ref, {
208
- "url": that.sourceURL,
209
- "range": parseRefs.tables[ref]
208
+ url: that.sourceURL,
209
+ range: parseRefs.tables[ref],
210
210
  });
211
211
  }
212
212
  }
@@ -217,8 +217,8 @@ class ImportsAndTablesStep {
217
217
  const ref = decodeURI(new URL(relativeRef, that.sourceURL).toString());
218
218
  that.addChild(ref);
219
219
  that.root.importZone.reference(ref, {
220
- "url": that.sourceURL,
221
- "range": firstRef
220
+ url: that.sourceURL,
221
+ range: firstRef,
222
222
  });
223
223
  }
224
224
  catch (err) {
@@ -226,8 +226,8 @@ class ImportsAndTablesStep {
226
226
  // may be impossible, because it will append any garbage
227
227
  // to the known good rootURL assuming it is relative
228
228
  that.root.logger.log({
229
- "message": `Malformed URL '${relativeRef}'"`,
230
- "at": { "url": that.sourceURL, "range": firstRef }
229
+ message: `Malformed URL '${relativeRef}'"`,
230
+ at: { url: that.sourceURL, range: firstRef },
231
231
  });
232
232
  }
233
233
  }
@@ -241,11 +241,11 @@ class ImportsAndTablesStep {
241
241
  let allMissing = {};
242
242
  const missingTables = that.root.schemaZone.getUndefined();
243
243
  if (missingTables) {
244
- allMissing = { "tables": missingTables };
244
+ allMissing = { tables: missingTables };
245
245
  }
246
246
  const missingImports = that.root.importZone.getUndefined();
247
247
  if (missingImports) {
248
- allMissing = { ...allMissing, "urls": missingImports };
248
+ allMissing = { ...allMissing, urls: missingImports };
249
249
  }
250
250
  if ((0, translate_response_1.isNeedResponse)(allMissing)) {
251
251
  return allMissing;
@@ -280,7 +280,7 @@ class ASTStep {
280
280
  }
281
281
  const parse = parseResponse === null || parseResponse === void 0 ? void 0 : parseResponse.parse;
282
282
  if (!parse) {
283
- throw new Error("TRANSLATOR INTERNAL ERROR: Translator parse response had no errors, but also no parser");
283
+ throw new Error('TRANSLATOR INTERNAL ERROR: Translator parse response had no errors, but also no parser');
284
284
  }
285
285
  const secondPass = new malloy_to_ast_1.MalloyToAST(parse, that.root.logger);
286
286
  const newAst = secondPass.visit(parse.root);
@@ -288,8 +288,8 @@ class ASTStep {
288
288
  this.response = that.fatalErrors();
289
289
  return this.response;
290
290
  }
291
- if (newAst.elementType === "unimplemented") {
292
- throw new Error("TRANSLATOR INTERNAL ERROR: Unimplemented AST node");
291
+ if (newAst.elementType === 'unimplemented') {
292
+ throw new Error('TRANSLATOR INTERNAL ERROR: Unimplemented AST node');
293
293
  }
294
294
  // I kind of think table refs should probably also be collected here
295
295
  // instead of in the parse step. Note to myself, do that someday.
@@ -309,7 +309,7 @@ class ASTStep {
309
309
  sqlExplores[walkedTo.is].def = walkedTo;
310
310
  }
311
311
  else if (walkedTo instanceof ast.Unimplemented) {
312
- walkedTo.log("INTERNAL COMPILER ERROR: Untranslated parse node");
312
+ walkedTo.log('INTERNAL COMPILER ERROR: Untranslated parse node');
313
313
  }
314
314
  });
315
315
  this.walked = true;
@@ -337,8 +337,8 @@ class ASTStep {
337
337
  newAst.setTranslator(that);
338
338
  this.response = {
339
339
  ...that.errors(),
340
- "ast": newAst,
341
- "final": true
340
+ ast: newAst,
341
+ final: true,
342
342
  };
343
343
  return this.response;
344
344
  }
@@ -374,11 +374,11 @@ class MetadataStep {
374
374
  }
375
375
  this.response = {
376
376
  symbols,
377
- "highlights": (0, document_highlight_walker_1.sortHighlights)([
377
+ highlights: (0, document_highlight_walker_1.sortHighlights)([
378
378
  ...(0, document_highlight_walker_1.passForHighlights)(tryParse.parse.tokenStream),
379
- ...walkHighlights
379
+ ...walkHighlights,
380
380
  ]),
381
- "final": true
381
+ final: true,
382
382
  };
383
383
  }
384
384
  }
@@ -406,7 +406,7 @@ class CompletionsStep {
406
406
  }
407
407
  return {
408
408
  ...tryParse,
409
- completions
409
+ completions,
410
410
  };
411
411
  }
412
412
  }
@@ -432,7 +432,7 @@ class HelpContextStep {
432
432
  }
433
433
  return {
434
434
  ...tryParse,
435
- helpContext
435
+ helpContext,
436
436
  };
437
437
  }
438
438
  }
@@ -453,7 +453,7 @@ class TranslateStep {
453
453
  this.response = astResponse;
454
454
  return this.response;
455
455
  }
456
- if (that.grammarRule === "malloyDocument") {
456
+ if (that.grammarRule === 'malloyDocument') {
457
457
  if (astResponse.ast instanceof ast.Document) {
458
458
  const doc = astResponse.ast;
459
459
  doc.initModelDef(extendingModel);
@@ -472,8 +472,8 @@ class TranslateStep {
472
472
  }
473
473
  else {
474
474
  that.root.logger.log({
475
- "message": `'${that.sourceURL}' did not parse to malloy document`,
476
- "at": that.defaultLocation()
475
+ message: `'${that.sourceURL}' did not parse to malloy document`,
476
+ at: that.defaultLocation(),
477
477
  });
478
478
  }
479
479
  }
@@ -482,29 +482,29 @@ class TranslateStep {
482
482
  }
483
483
  else {
484
484
  this.response = {
485
- "translated": {
486
- "modelDef": that.modelDef,
487
- "queryList": that.queryList,
488
- "sqlBlocks": that.sqlBlocks
485
+ translated: {
486
+ modelDef: that.modelDef,
487
+ queryList: that.queryList,
488
+ sqlBlocks: that.sqlBlocks,
489
489
  },
490
490
  ...that.errors(),
491
- "final": true
491
+ final: true,
492
492
  };
493
493
  }
494
494
  return this.response;
495
495
  }
496
496
  }
497
497
  class MalloyTranslation {
498
- constructor(sourceURL, grammarRule = "malloyDocument") {
498
+ constructor(sourceURL, grammarRule = 'malloyDocument') {
499
499
  this.sourceURL = sourceURL;
500
500
  this.grammarRule = grammarRule;
501
501
  this.queryList = [];
502
502
  this.sqlBlocks = [];
503
503
  this.childTranslators = new Map();
504
504
  this.modelDef = {
505
- "name": sourceURL,
506
- "exports": [],
507
- "contents": {}
505
+ name: sourceURL,
506
+ exports: [],
507
+ contents: {},
508
508
  };
509
509
  /**
510
510
  * This is sort of the makefile for the translation, all the steps
@@ -535,8 +535,8 @@ class MalloyTranslation {
535
535
  }
536
536
  fatalErrors() {
537
537
  return {
538
- "final": true,
539
- "errors": [...this.root.logger.getLog()]
538
+ final: true,
539
+ errors: [...this.root.logger.getLog()],
540
540
  };
541
541
  }
542
542
  /**
@@ -545,11 +545,11 @@ class MalloyTranslation {
545
545
  */
546
546
  errors() {
547
547
  const errors = this.root.logger.getLog();
548
- return { "errors": [...errors] };
548
+ return { errors: [...errors] };
549
549
  }
550
550
  getLineMap(url) {
551
551
  var _a, _b;
552
- if (url == this.sourceURL) {
552
+ if (url === this.sourceURL) {
553
553
  return (_a = this.parseStep.sourceInfo) === null || _a === void 0 ? void 0 : _a.lines;
554
554
  }
555
555
  const theChild = this.childTranslators.get(url);
@@ -558,8 +558,8 @@ class MalloyTranslation {
558
558
  }
559
559
  }
560
560
  prettyErrors() {
561
- let lovely = "";
562
- let inFile = "";
561
+ let lovely = '';
562
+ let inFile = '';
563
563
  for (const entry of this.root.logger.getLog()) {
564
564
  let cooked = entry.message;
565
565
  let errorURL = this.sourceURL;
@@ -572,7 +572,7 @@ class MalloyTranslation {
572
572
  const errorLine = lines[lineNo];
573
573
  cooked = `line ${lineNo + 1}: ${entry.message}\n | ${errorLine}`;
574
574
  if (charFrom > 0) {
575
- cooked = cooked + `\n | ${" ".repeat(charFrom)}^`;
575
+ cooked = cooked + `\n | ${' '.repeat(charFrom)}^`;
576
576
  }
577
577
  }
578
578
  else {
@@ -583,7 +583,7 @@ class MalloyTranslation {
583
583
  cooked = `FILE: ${errorURL}\n` + cooked;
584
584
  inFile = errorURL;
585
585
  }
586
- if (lovely !== "") {
586
+ if (lovely !== '') {
587
587
  lovely = `${lovely}\n${cooked}`;
588
588
  }
589
589
  else {
@@ -598,8 +598,8 @@ class MalloyTranslation {
598
598
  const ret = (_a = this.childTranslators.get(childURL)) === null || _a === void 0 ? void 0 : _a.translate();
599
599
  if (ret === null || ret === void 0 ? void 0 : ret.compileSQL) {
600
600
  return {
601
- "compileSQL": ret.compileSQL,
602
- "partialModel": ret.partialModel
601
+ compileSQL: ret.compileSQL,
602
+ partialModel: ret.partialModel,
603
603
  };
604
604
  }
605
605
  }
@@ -612,7 +612,7 @@ class MalloyTranslation {
612
612
  if (did.translated) {
613
613
  for (const fromChild of child.modelDef.exports) {
614
614
  const modelEntry = child.modelDef.contents[fromChild];
615
- if (modelEntry.type === "struct") {
615
+ if (modelEntry.type === 'struct') {
616
616
  exports[fromChild] = modelEntry;
617
617
  }
618
618
  }
@@ -642,11 +642,11 @@ class MalloyTranslation {
642
642
  }
643
643
  defaultLocation() {
644
644
  return {
645
- "url": this.sourceURL,
646
- "range": {
647
- "start": { "line": 0, "character": 0 },
648
- "end": { "line": 0, "character": 0 }
649
- }
645
+ url: this.sourceURL,
646
+ range: {
647
+ start: { line: 0, character: 0 },
648
+ end: { line: 0, character: 0 },
649
+ },
650
650
  };
651
651
  }
652
652
  rangeFromContext(pcx) {
@@ -654,10 +654,10 @@ class MalloyTranslation {
654
654
  }
655
655
  rangeFromTokens(startToken, stopToken) {
656
656
  const start = {
657
- "line": startToken.line - 1,
658
- "character": startToken.charPositionInLine
657
+ line: startToken.line - 1,
658
+ character: startToken.charPositionInLine,
659
659
  };
660
- if (this.parseStep.sourceInfo && stopToken.stopIndex != -1) {
660
+ if (this.parseStep.sourceInfo && stopToken.stopIndex !== -1) {
661
661
  // Find the line which contains the stopIndex
662
662
  const lastLine = this.parseStep.sourceInfo.lines.length - 1;
663
663
  for (let lineNo = startToken.line - 1; lineNo <= lastLine; lineNo++) {
@@ -665,10 +665,10 @@ class MalloyTranslation {
665
665
  if (stopToken.stopIndex >= at.begin && stopToken.stopIndex <= at.end) {
666
666
  return {
667
667
  start,
668
- "end": {
669
- "line": lineNo,
670
- "character": stopToken.stopIndex - at.begin + 1
671
- }
668
+ end: {
669
+ line: lineNo,
670
+ character: stopToken.stopIndex - at.begin + 1,
671
+ },
672
672
  };
673
673
  }
674
674
  }
@@ -676,13 +676,13 @@ class MalloyTranslation {
676
676
  // character of the last line of the file
677
677
  return {
678
678
  start,
679
- "end": {
680
- "line": lastLine,
681
- "character": this.parseStep.sourceInfo.lines[lastLine].length
682
- }
679
+ end: {
680
+ line: lastLine,
681
+ character: this.parseStep.sourceInfo.lines[lastLine].length,
682
+ },
683
683
  };
684
684
  }
685
- return { start, "end": start };
685
+ return { start, end: start };
686
686
  }
687
687
  rangeFromToken(token) {
688
688
  return this.rangeFromTokens(token, token);
@@ -1,5 +1,5 @@
1
- import { CommonTokenStream } from "antlr4ts";
2
- import { ParseTree } from "antlr4ts/tree";
1
+ import { CommonTokenStream } from 'antlr4ts';
2
+ import { ParseTree } from 'antlr4ts/tree';
3
3
  export interface DocumentCompletion {
4
4
  type: string;
5
5
  text: string;
@@ -25,33 +25,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.walkForDocumentCompletions = void 0;
26
26
  const ParseTreeWalker_1 = require("antlr4ts/tree/ParseTreeWalker");
27
27
  const EXPLORE_PROPERTIES = [
28
- "dimension",
29
- "measure",
30
- "join_one",
31
- "join_many",
32
- "join_cross",
33
- "where",
34
- "primary_key",
35
- "rename",
36
- "accept",
37
- "except",
38
- "query",
39
- "declare"
28
+ 'dimension',
29
+ 'measure',
30
+ 'join_one',
31
+ 'join_many',
32
+ 'join_cross',
33
+ 'where',
34
+ 'primary_key',
35
+ 'rename',
36
+ 'accept',
37
+ 'except',
38
+ 'query',
39
+ 'declare',
40
40
  ];
41
41
  const QUERY_PROPERTIES = [
42
- "group_by",
43
- "project",
44
- "index",
45
- "aggregate",
46
- "top",
47
- "limit",
48
- "order_by",
49
- "where",
50
- "having",
51
- "nest",
52
- "declare"
42
+ 'group_by',
43
+ 'project',
44
+ 'index',
45
+ 'aggregate',
46
+ 'top',
47
+ 'limit',
48
+ 'order_by',
49
+ 'where',
50
+ 'having',
51
+ 'nest',
52
+ 'declare',
53
53
  ];
54
- const MODEL_PROPERTIES = ["source", "explore", "query", "sql"];
54
+ const MODEL_PROPERTIES = ['source', 'explore', 'query', 'sql'];
55
55
  class DocumentCompletionWalker {
56
56
  constructor(tokens, completions, position) {
57
57
  this.tokens = tokens;
@@ -61,16 +61,16 @@ class DocumentCompletionWalker {
61
61
  rangeOf(pcx) {
62
62
  const stopToken = pcx.stop || pcx.start;
63
63
  return {
64
- "start": {
65
- "line": pcx.start.line - 1,
66
- "character": pcx.start.charPositionInLine
64
+ start: {
65
+ line: pcx.start.line - 1,
66
+ character: pcx.start.charPositionInLine,
67
67
  },
68
- "end": {
69
- "line": stopToken.line - 1,
70
- "character": stopToken.stopIndex -
68
+ end: {
69
+ line: stopToken.line - 1,
70
+ character: stopToken.stopIndex -
71
71
  (stopToken.startIndex - stopToken.charPositionInLine) +
72
- 1
73
- }
72
+ 1,
73
+ },
74
74
  };
75
75
  }
76
76
  inRange(range) {
@@ -94,8 +94,8 @@ class DocumentCompletionWalker {
94
94
  if (!insideStatement) {
95
95
  for (const property of EXPLORE_PROPERTIES) {
96
96
  this.completions.push({
97
- "type": "explore_property",
98
- "text": `${property}: `
97
+ type: 'explore_property',
98
+ text: `${property}: `,
99
99
  });
100
100
  }
101
101
  }
@@ -112,8 +112,8 @@ class DocumentCompletionWalker {
112
112
  if (!insideStatement) {
113
113
  for (const property of QUERY_PROPERTIES) {
114
114
  this.completions.push({
115
- "type": "query_property",
116
- "text": `${property}: `
115
+ type: 'query_property',
116
+ text: `${property}: `,
117
117
  });
118
118
  }
119
119
  }
@@ -130,8 +130,8 @@ class DocumentCompletionWalker {
130
130
  if (!insideStatement) {
131
131
  for (const property of MODEL_PROPERTIES) {
132
132
  this.completions.push({
133
- "type": "model_property",
134
- "text": `${property}: `
133
+ type: 'model_property',
134
+ text: `${property}: `,
135
135
  });
136
136
  }
137
137
  }
@@ -1,4 +1,4 @@
1
- import { ParseTree } from "antlr4ts/tree";
1
+ import { ParseTree } from 'antlr4ts/tree';
2
2
  export interface DocumentHelpContext {
3
3
  type: string;
4
4
  token: string | undefined;
@@ -28,21 +28,21 @@ class HelpContextVisitor extends tree_1.AbstractParseTreeVisitor {
28
28
  constructor(position) {
29
29
  super();
30
30
  this.position = position;
31
- this.type = "";
31
+ this.type = '';
32
32
  }
33
33
  rangeOf(ctx) {
34
34
  const stopToken = ctx.stop || ctx.start;
35
35
  return {
36
- "start": {
37
- "line": ctx.start.line - 1,
38
- "character": ctx.start.charPositionInLine
36
+ start: {
37
+ line: ctx.start.line - 1,
38
+ character: ctx.start.charPositionInLine,
39
39
  },
40
- "end": {
41
- "line": stopToken.line - 1,
42
- "character": stopToken.stopIndex -
40
+ end: {
41
+ line: stopToken.line - 1,
42
+ character: stopToken.stopIndex -
43
43
  (stopToken.startIndex - stopToken.charPositionInLine) +
44
- 1
45
- }
44
+ 1,
45
+ },
46
46
  };
47
47
  }
48
48
  inRange(range) {
@@ -60,8 +60,8 @@ class HelpContextVisitor extends tree_1.AbstractParseTreeVisitor {
60
60
  let result = this.defaultResult();
61
61
  if (this.inRange(this.rangeOf(ctx))) {
62
62
  result = {
63
- "type": this.type,
64
- "token": ctx.start.text
63
+ type: this.type,
64
+ token: ctx.start.text,
65
65
  };
66
66
  const n = ctx.childCount;
67
67
  for (let i = 0; i < n; i++) {
@@ -76,21 +76,21 @@ class HelpContextVisitor extends tree_1.AbstractParseTreeVisitor {
76
76
  }
77
77
  visitMalloyDocument(ctx) {
78
78
  if (this.inRange(this.rangeOf(ctx))) {
79
- this.type = "model_property";
79
+ this.type = 'model_property';
80
80
  return this.visitChildren(ctx);
81
81
  }
82
82
  return this.defaultResult();
83
83
  }
84
84
  visitExploreProperties(ctx) {
85
85
  if (this.inRange(this.rangeOf(ctx))) {
86
- this.type = "explore_property";
86
+ this.type = 'explore_property';
87
87
  return this.visitChildren(ctx);
88
88
  }
89
89
  return this.defaultResult();
90
90
  }
91
91
  visitQueryProperties(ctx) {
92
92
  if (this.inRange(this.rangeOf(ctx))) {
93
- this.type = "query_property";
93
+ this.type = 'query_property';
94
94
  return this.visitChildren(ctx);
95
95
  }
96
96
  return this.defaultResult();
@@ -1,6 +1,6 @@
1
- import { CommonTokenStream } from "antlr4ts";
2
- import { ParseTree } from "antlr4ts/tree";
3
- import { DocumentRange } from "../../model/malloy_types";
1
+ import { CommonTokenStream } from 'antlr4ts';
2
+ import { ParseTree } from 'antlr4ts/tree';
3
+ import { DocumentRange } from '../../model/malloy_types';
4
4
  export interface DocumentHighlight {
5
5
  range: DocumentRange;
6
6
  type: string;