@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.
- package/dist/connection_utils.d.ts +1 -0
- package/dist/connection_utils.js +66 -0
- package/dist/dialect/dialect.d.ts +66 -0
- package/dist/dialect/dialect.js +85 -0
- package/dist/dialect/dialect_map.d.ts +3 -0
- package/dist/dialect/dialect_map.js +45 -0
- package/dist/dialect/duckdb.d.ts +52 -0
- package/dist/dialect/duckdb.js +364 -0
- package/dist/dialect/index.d.ts +6 -0
- package/dist/dialect/index.js +37 -0
- package/dist/dialect/postgres.d.ts +52 -0
- package/dist/dialect/postgres.js +330 -0
- package/dist/dialect/standardsql.d.ts +49 -0
- package/dist/dialect/standardsql.js +381 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +59 -0
- package/dist/lang/ast/ast-utils.d.ts +10 -0
- package/dist/lang/ast/ast-utils.js +42 -0
- package/dist/lang/ast/elements/define-query.d.ts +14 -0
- package/dist/lang/ast/elements/define-query.js +56 -0
- package/dist/lang/ast/elements/define-source.d.ts +17 -0
- package/dist/lang/ast/elements/define-source.js +79 -0
- package/dist/lang/ast/elements/import-statement.d.ts +9 -0
- package/dist/lang/ast/elements/import-statement.js +78 -0
- package/dist/lang/ast/elements/pipeline-desc.d.ts +30 -0
- package/dist/lang/ast/elements/pipeline-desc.js +102 -0
- package/dist/lang/ast/elements/refined-source.d.ts +15 -0
- package/dist/lang/ast/elements/refined-source.js +121 -0
- package/dist/lang/ast/elements/source.d.ts +12 -0
- package/dist/lang/ast/elements/source.js +53 -0
- package/dist/lang/ast/error-factory.d.ts +9 -0
- package/dist/lang/ast/error-factory.js +61 -0
- package/dist/lang/ast/executors/index-executor.d.ts +18 -0
- package/dist/lang/ast/executors/index-executor.js +96 -0
- package/dist/lang/ast/executors/project-executor.d.ts +10 -0
- package/dist/lang/ast/executors/project-executor.js +68 -0
- package/dist/lang/ast/executors/reduce-executor.d.ts +21 -0
- package/dist/lang/ast/executors/reduce-executor.js +149 -0
- package/dist/lang/ast/expressions/apply.d.ts +8 -0
- package/dist/lang/ast/expressions/apply.js +37 -0
- package/dist/lang/ast/expressions/binary-boolean.d.ts +12 -0
- package/dist/lang/ast/expressions/binary-boolean.js +54 -0
- package/dist/lang/ast/expressions/binary-numeric.d.ts +11 -0
- package/dist/lang/ast/expressions/binary-numeric.js +42 -0
- package/dist/lang/ast/expressions/boolean.d.ts +8 -0
- package/dist/lang/ast/expressions/boolean.js +39 -0
- package/dist/lang/ast/expressions/constant-sub-expression.d.ts +16 -0
- package/dist/lang/ast/expressions/constant-sub-expression.js +98 -0
- package/dist/lang/ast/expressions/expr-add-sub.d.ts +4 -0
- package/dist/lang/ast/expressions/expr-add-sub.js +34 -0
- package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +15 -0
- package/dist/lang/ast/expressions/expr-aggregate-function.js +99 -0
- package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +11 -0
- package/dist/lang/ast/expressions/expr-alternation-tree.js +54 -0
- package/dist/lang/ast/expressions/expr-asymmetric.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-asymmetric.js +27 -0
- package/dist/lang/ast/expressions/expr-avg.d.ts +6 -0
- package/dist/lang/ast/expressions/expr-avg.js +34 -0
- package/dist/lang/ast/expressions/expr-cast.d.ts +13 -0
- package/dist/lang/ast/expressions/expr-cast.js +29 -0
- package/dist/lang/ast/expressions/expr-compare.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-compare.js +58 -0
- package/dist/lang/ast/expressions/expr-count-distinct.d.ts +6 -0
- package/dist/lang/ast/expressions/expr-count-distinct.js +35 -0
- package/dist/lang/ast/expressions/expr-count.d.ts +11 -0
- package/dist/lang/ast/expressions/expr-count.js +57 -0
- package/dist/lang/ast/expressions/expr-filter.d.ts +12 -0
- package/dist/lang/ast/expressions/expr-filter.js +69 -0
- package/dist/lang/ast/expressions/expr-func.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-func.js +63 -0
- package/dist/lang/ast/expressions/expr-granular-time.d.ts +24 -0
- package/dist/lang/ast/expressions/expr-granular-time.js +117 -0
- package/dist/lang/ast/expressions/expr-id-reference.d.ts +12 -0
- package/dist/lang/ast/expressions/expr-id-reference.js +75 -0
- package/dist/lang/ast/expressions/expr-logical-op.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-logical-op.js +36 -0
- package/dist/lang/ast/expressions/expr-max.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-max.js +16 -0
- package/dist/lang/ast/expressions/expr-min.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-min.js +16 -0
- package/dist/lang/ast/expressions/expr-minus.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-minus.js +48 -0
- package/dist/lang/ast/expressions/expr-mul-div.d.ts +4 -0
- package/dist/lang/ast/expressions/expr-mul-div.js +34 -0
- package/dist/lang/ast/expressions/expr-not.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-not.js +49 -0
- package/dist/lang/ast/expressions/expr-now.d.ts +7 -0
- package/dist/lang/ast/expressions/expr-now.js +46 -0
- package/dist/lang/ast/expressions/expr-null.d.ts +6 -0
- package/dist/lang/ast/expressions/expr-null.js +41 -0
- package/dist/lang/ast/expressions/expr-number.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-number.js +42 -0
- package/dist/lang/ast/expressions/expr-parens.d.ts +10 -0
- package/dist/lang/ast/expressions/expr-parens.js +42 -0
- package/dist/lang/ast/expressions/expr-regex.d.ts +8 -0
- package/dist/lang/ast/expressions/expr-regex.js +42 -0
- package/dist/lang/ast/expressions/expr-string.d.ts +9 -0
- package/dist/lang/ast/expressions/expr-string.js +50 -0
- package/dist/lang/ast/expressions/expr-sum.d.ts +6 -0
- package/dist/lang/ast/expressions/expr-sum.js +12 -0
- package/dist/lang/ast/expressions/expr-time-extract.d.ts +13 -0
- package/dist/lang/ast/expressions/expr-time-extract.js +117 -0
- package/dist/lang/ast/expressions/expr-time.d.ts +11 -0
- package/dist/lang/ast/expressions/expr-time.js +62 -0
- package/dist/lang/ast/expressions/expr-ungroup.d.ts +14 -0
- package/dist/lang/ast/expressions/expr-ungroup.js +83 -0
- package/dist/lang/ast/expressions/for-range.d.ts +19 -0
- package/dist/lang/ast/expressions/for-range.js +101 -0
- package/dist/lang/ast/expressions/granular-literal.d.ts +20 -0
- package/dist/lang/ast/expressions/granular-literal.js +148 -0
- package/dist/lang/ast/expressions/partial-compare.d.ts +14 -0
- package/dist/lang/ast/expressions/partial-compare.js +50 -0
- package/dist/lang/ast/expressions/pick-when.d.ts +19 -0
- package/dist/lang/ast/expressions/pick-when.js +156 -0
- package/dist/lang/ast/expressions/range.d.ts +12 -0
- package/dist/lang/ast/expressions/range.js +80 -0
- package/dist/lang/ast/expressions/time-frame.d.ts +7 -0
- package/dist/lang/ast/expressions/time-frame.js +40 -0
- package/dist/lang/ast/expressions/top-by.d.ts +10 -0
- package/dist/lang/ast/expressions/top-by.js +51 -0
- package/dist/lang/ast/expressions/unary.d.ts +5 -0
- package/dist/lang/ast/expressions/unary.js +34 -0
- package/dist/lang/ast/expressions/utils.d.ts +12 -0
- package/dist/lang/ast/expressions/utils.js +87 -0
- package/dist/lang/ast/field-space/column-space-field.d.ts +9 -0
- package/dist/lang/ast/field-space/column-space-field.js +40 -0
- package/dist/lang/ast/field-space/dynamic-space.d.ts +22 -0
- package/dist/lang/ast/field-space/dynamic-space.js +140 -0
- package/dist/lang/ast/field-space/field-definition-value.d.ts +16 -0
- package/dist/lang/ast/field-space/field-definition-value.js +55 -0
- package/dist/lang/ast/field-space/index-field-space.d.ts +10 -0
- package/dist/lang/ast/field-space/index-field-space.js +57 -0
- package/dist/lang/ast/field-space/join-space-field.d.ts +8 -0
- package/dist/lang/ast/field-space/join-space-field.js +35 -0
- package/dist/lang/ast/field-space/project-field-space.d.ts +6 -0
- package/dist/lang/ast/field-space/project-field-space.js +51 -0
- package/dist/lang/ast/field-space/query-field-struct.d.ts +10 -0
- package/dist/lang/ast/field-space/query-field-struct.js +46 -0
- package/dist/lang/ast/field-space/query-space-field.d.ts +11 -0
- package/dist/lang/ast/field-space/query-space-field.js +37 -0
- package/dist/lang/ast/field-space/query-spaces.d.ts +50 -0
- package/dist/lang/ast/field-space/query-spaces.js +233 -0
- package/dist/lang/ast/field-space/reference-field.d.ts +11 -0
- package/dist/lang/ast/field-space/reference-field.js +45 -0
- package/dist/lang/ast/field-space/refined-space.d.ts +13 -0
- package/dist/lang/ast/field-space/refined-space.js +100 -0
- package/dist/lang/ast/field-space/rename-space-field.d.ts +11 -0
- package/dist/lang/ast/field-space/rename-space-field.js +50 -0
- package/dist/lang/ast/field-space/static-space.d.ts +29 -0
- package/dist/lang/ast/field-space/static-space.js +156 -0
- package/dist/lang/ast/field-space/struct-space-field-base.d.ts +11 -0
- package/dist/lang/ast/field-space/struct-space-field-base.js +40 -0
- package/dist/lang/ast/field-space/wild-space-field.d.ts +10 -0
- package/dist/lang/ast/field-space/wild-space-field.js +40 -0
- package/dist/lang/ast/fragtype-utils.d.ts +39 -0
- package/dist/lang/ast/fragtype-utils.js +100 -0
- package/dist/lang/ast/index.d.ts +90 -0
- package/dist/lang/ast/index.js +129 -0
- package/dist/lang/ast/parameters/constant-parameter.d.ts +8 -0
- package/dist/lang/ast/parameters/constant-parameter.js +54 -0
- package/dist/lang/ast/parameters/has-parameter.d.ts +19 -0
- package/dist/lang/ast/parameters/has-parameter.js +64 -0
- package/dist/lang/ast/query-elements/anonymous-query.d.ts +9 -0
- package/dist/lang/ast/query-elements/anonymous-query.js +41 -0
- package/dist/lang/ast/query-elements/existing-query.d.ts +11 -0
- package/dist/lang/ast/query-elements/existing-query.js +79 -0
- package/dist/lang/ast/query-elements/full-query.d.ts +10 -0
- package/dist/lang/ast/query-elements/full-query.js +85 -0
- package/dist/lang/ast/query-elements/query-head-struct.d.ts +9 -0
- package/dist/lang/ast/query-elements/query-head-struct.js +48 -0
- package/dist/lang/ast/query-items/field-declaration.d.ts +31 -0
- package/dist/lang/ast/query-items/field-declaration.js +137 -0
- package/dist/lang/ast/query-items/field-references.d.ts +25 -0
- package/dist/lang/ast/query-items/field-references.js +80 -0
- package/dist/lang/ast/query-properties/aggregate.d.ts +5 -0
- package/dist/lang/ast/query-properties/aggregate.js +39 -0
- package/dist/lang/ast/query-properties/declare-fields.d.ts +5 -0
- package/dist/lang/ast/query-properties/declare-fields.js +33 -0
- package/dist/lang/ast/query-properties/dimmensions.d.ts +5 -0
- package/dist/lang/ast/query-properties/dimmensions.js +36 -0
- package/dist/lang/ast/query-properties/filters.d.ts +18 -0
- package/dist/lang/ast/query-properties/filters.js +89 -0
- package/dist/lang/ast/query-properties/group-by.d.ts +5 -0
- package/dist/lang/ast/query-properties/group-by.js +39 -0
- package/dist/lang/ast/query-properties/indexing.d.ts +10 -0
- package/dist/lang/ast/query-properties/indexing.js +39 -0
- package/dist/lang/ast/query-properties/joins.d.ts +36 -0
- package/dist/lang/ast/query-properties/joins.js +143 -0
- package/dist/lang/ast/query-properties/limit.d.ts +6 -0
- package/dist/lang/ast/query-properties/limit.js +35 -0
- package/dist/lang/ast/query-properties/measures.d.ts +5 -0
- package/dist/lang/ast/query-properties/measures.js +36 -0
- package/dist/lang/ast/query-properties/nest-reference.d.ts +7 -0
- package/dist/lang/ast/query-properties/nest-reference.js +35 -0
- package/dist/lang/ast/query-properties/nest.d.ts +31 -0
- package/dist/lang/ast/query-properties/nest.js +133 -0
- package/dist/lang/ast/query-properties/nests.d.ts +5 -0
- package/dist/lang/ast/query-properties/nests.js +33 -0
- package/dist/lang/ast/query-properties/ordering.d.ts +15 -0
- package/dist/lang/ast/query-properties/ordering.js +66 -0
- package/dist/lang/ast/query-properties/project-statement.d.ts +5 -0
- package/dist/lang/ast/query-properties/project-statement.js +33 -0
- package/dist/lang/ast/query-properties/qop-desc.d.ts +17 -0
- package/dist/lang/ast/query-properties/qop-desc.js +124 -0
- package/dist/lang/ast/query-properties/sampling.d.ts +8 -0
- package/dist/lang/ast/query-properties/sampling.js +38 -0
- package/dist/lang/ast/query-properties/top.d.ts +13 -0
- package/dist/lang/ast/query-properties/top.js +60 -0
- package/dist/lang/ast/source-properties/field-list-edit.d.ts +8 -0
- package/dist/lang/ast/source-properties/field-list-edit.js +36 -0
- package/dist/lang/ast/source-properties/primary-key.d.ts +7 -0
- package/dist/lang/ast/source-properties/primary-key.js +35 -0
- package/dist/lang/ast/source-properties/renames.d.ts +11 -0
- package/dist/lang/ast/source-properties/renames.js +43 -0
- package/dist/lang/ast/source-properties/turtles.d.ts +5 -0
- package/dist/lang/ast/source-properties/turtles.js +33 -0
- package/dist/lang/ast/sources/named-source.d.ts +19 -0
- package/dist/lang/ast/sources/named-source.js +147 -0
- package/dist/lang/ast/sources/query-source.d.ts +9 -0
- package/dist/lang/ast/sources/query-source.js +41 -0
- package/dist/lang/ast/sources/sql-source.d.ts +7 -0
- package/dist/lang/ast/sources/sql-source.js +54 -0
- package/dist/lang/ast/sources/table-source.d.ts +8 -0
- package/dist/lang/ast/sources/table-source.js +60 -0
- package/dist/lang/ast/space-seed.d.ts +16 -0
- package/dist/lang/ast/space-seed.js +59 -0
- package/dist/lang/ast/sql-elements/sql-statement.d.ts +19 -0
- package/dist/lang/ast/sql-elements/sql-statement.js +80 -0
- package/dist/lang/ast/sql-elements/sql-string.d.ts +12 -0
- package/dist/lang/ast/sql-elements/sql-string.js +60 -0
- package/dist/lang/ast/struct-utils.d.ts +4 -0
- package/dist/lang/ast/struct-utils.js +48 -0
- package/dist/lang/ast/time-utils.d.ts +12 -0
- package/dist/lang/ast/time-utils.js +140 -0
- package/dist/lang/ast/types/comparison.d.ts +11 -0
- package/dist/lang/ast/types/comparison.js +41 -0
- package/dist/lang/ast/types/document-compile-result.d.ts +8 -0
- package/dist/lang/ast/types/document-compile-result.js +25 -0
- package/dist/lang/ast/types/equality.d.ts +7 -0
- package/dist/lang/ast/types/equality.js +37 -0
- package/dist/lang/ast/types/executor.d.ts +9 -0
- package/dist/lang/ast/types/executor.js +25 -0
- package/dist/lang/ast/types/explore-desc.d.ts +5 -0
- package/dist/lang/ast/types/explore-desc.js +33 -0
- package/dist/lang/ast/types/explore-field.d.ts +5 -0
- package/dist/lang/ast/types/explore-field.js +32 -0
- package/dist/lang/ast/types/expr-result.d.ts +5 -0
- package/dist/lang/ast/types/expr-result.js +25 -0
- package/dist/lang/ast/types/expr-value.d.ts +3 -0
- package/dist/lang/ast/types/expr-value.js +25 -0
- package/dist/lang/ast/types/expression-def.d.ts +69 -0
- package/dist/lang/ast/types/expression-def.js +346 -0
- package/dist/lang/ast/types/field-collection-member.d.ts +5 -0
- package/dist/lang/ast/types/field-collection-member.js +34 -0
- package/dist/lang/ast/types/field-decl.d.ts +7 -0
- package/dist/lang/ast/types/field-decl.js +37 -0
- package/dist/lang/ast/types/field-space.d.ts +24 -0
- package/dist/lang/ast/types/field-space.js +44 -0
- package/dist/lang/ast/types/granular-result.d.ts +7 -0
- package/dist/lang/ast/types/granular-result.js +11 -0
- package/dist/lang/ast/types/lookup-result.d.ts +10 -0
- package/dist/lang/ast/types/lookup-result.js +25 -0
- package/dist/lang/ast/types/malloy-element.d.ts +106 -0
- package/dist/lang/ast/types/malloy-element.js +398 -0
- package/dist/lang/ast/types/model-entry.d.ts +6 -0
- package/dist/lang/ast/types/model-entry.js +25 -0
- package/dist/lang/ast/types/name-space.d.ts +5 -0
- package/dist/lang/ast/types/name-space.js +25 -0
- package/dist/lang/ast/types/nested-query.d.ts +3 -0
- package/dist/lang/ast/types/nested-query.js +25 -0
- package/dist/lang/ast/types/op-desc.d.ts +6 -0
- package/dist/lang/ast/types/op-desc.js +25 -0
- package/dist/lang/ast/types/query-comp.d.ts +5 -0
- package/dist/lang/ast/types/query-comp.js +25 -0
- package/dist/lang/ast/types/query-element.d.ts +5 -0
- package/dist/lang/ast/types/query-element.js +32 -0
- package/dist/lang/ast/types/query-item.d.ts +5 -0
- package/dist/lang/ast/types/query-item.js +25 -0
- package/dist/lang/ast/types/query-property.d.ts +17 -0
- package/dist/lang/ast/types/query-property.js +55 -0
- package/dist/lang/ast/types/source-property.d.ts +10 -0
- package/dist/lang/ast/types/source-property.js +43 -0
- package/dist/lang/ast/types/space-entry.d.ts +5 -0
- package/dist/lang/ast/types/space-entry.js +29 -0
- package/dist/lang/ast/types/space-field.d.ts +10 -0
- package/dist/lang/ast/types/space-field.js +48 -0
- package/dist/lang/ast/types/space-param.d.ts +20 -0
- package/dist/lang/ast/types/space-param.js +61 -0
- package/dist/lang/ast/types/time-result.d.ts +6 -0
- package/dist/lang/ast/types/time-result.js +25 -0
- package/dist/lang/ast/types/turtle-headed-pipe.d.ts +7 -0
- package/dist/lang/ast/types/turtle-headed-pipe.js +37 -0
- package/dist/lang/ast/types/type-desc.d.ts +7 -0
- package/dist/lang/ast/types/type-desc.js +25 -0
- package/dist/lang/field-utils.d.ts +5 -0
- package/dist/lang/field-utils.js +43 -0
- package/dist/lang/index.d.ts +10 -0
- package/dist/lang/index.js +32 -0
- package/dist/lang/lib/Malloy/MalloyLexer.d.ts +165 -0
- package/dist/lang/lib/Malloy/MalloyLexer.js +1232 -0
- package/dist/lang/lib/Malloy/MalloyParser.d.ts +1947 -0
- package/dist/lang/lib/Malloy/MalloyParser.js +11909 -0
- package/dist/lang/lib/Malloy/MalloyParserListener.d.ts +2022 -0
- package/dist/lang/lib/Malloy/MalloyParserListener.js +4 -0
- package/dist/lang/lib/Malloy/MalloyParserVisitor.d.ts +1274 -0
- package/dist/lang/lib/Malloy/MalloyParserVisitor.js +4 -0
- package/dist/lang/malloy-to-ast.d.ts +155 -0
- package/dist/lang/malloy-to-ast.js +990 -0
- package/dist/lang/parse-error-handler.d.ts +9 -0
- package/dist/lang/parse-error-handler.js +44 -0
- package/dist/lang/parse-log.d.ts +27 -0
- package/dist/lang/parse-log.js +51 -0
- package/dist/lang/parse-malloy.d.ts +182 -0
- package/dist/lang/parse-malloy.js +728 -0
- package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +10 -0
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +148 -0
- package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +9 -0
- package/dist/lang/parse-tree-walkers/document-help-context-walker.js +107 -0
- package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +83 -0
- package/dist/lang/parse-tree-walkers/document-highlight-walker.js +385 -0
- package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +11 -0
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +182 -0
- package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +34 -0
- package/dist/lang/parse-tree-walkers/explore-query-walker.js +74 -0
- package/dist/lang/parse-tree-walkers/find-external-references.d.ts +11 -0
- package/dist/lang/parse-tree-walkers/find-external-references.js +61 -0
- package/dist/lang/reference-list.d.ts +10 -0
- package/dist/lang/reference-list.js +90 -0
- package/dist/lang/test/document-help-context-walker.spec.d.ts +1 -0
- package/dist/lang/test/document-help-context-walker.spec.js +55 -0
- package/dist/lang/test/document-symbol-walker.spec.d.ts +1 -0
- package/dist/lang/test/document-symbol-walker.spec.js +110 -0
- package/dist/lang/test/field-symbols.spec.d.ts +1 -0
- package/dist/lang/test/field-symbols.spec.js +184 -0
- package/dist/lang/test/parse.spec.d.ts +14 -0
- package/dist/lang/test/parse.spec.js +2135 -0
- package/dist/lang/test/test-translator.d.ts +41 -0
- package/dist/lang/test/test-translator.js +344 -0
- package/dist/lang/translate-response.d.ts +59 -0
- package/dist/lang/translate-response.js +30 -0
- package/dist/lang/zone.d.ts +57 -0
- package/dist/lang/zone.js +107 -0
- package/dist/malloy.d.ts +1146 -0
- package/dist/malloy.js +2413 -0
- package/dist/model/index.d.ts +2 -0
- package/dist/model/index.js +45 -0
- package/dist/model/malloy_query.d.ts +351 -0
- package/dist/model/malloy_query.js +3174 -0
- package/dist/model/malloy_types.d.ts +551 -0
- package/dist/model/malloy_types.js +378 -0
- package/dist/model/sql_block.d.ts +7 -0
- package/dist/model/sql_block.js +56 -0
- package/dist/model/utils.d.ts +22 -0
- package/dist/model/utils.js +102 -0
- package/dist/run_sql_options.d.ts +3 -0
- package/dist/run_sql_options.js +25 -0
- package/dist/runtime_types.d.ts +105 -0
- package/dist/runtime_types.js +25 -0
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ANTLRErrorListener, Token } from "antlr4ts";
|
|
2
|
+
import { MessageLogger } from "./parse-log";
|
|
3
|
+
import { MalloyTranslation } from "./parse-malloy";
|
|
4
|
+
export declare class MalloyParserErrorHandler implements ANTLRErrorListener<Token> {
|
|
5
|
+
readonly translator: MalloyTranslation;
|
|
6
|
+
readonly messages: MessageLogger;
|
|
7
|
+
constructor(translator: MalloyTranslation, messages: MessageLogger);
|
|
8
|
+
syntaxError(recognizer: unknown, offendingSymbol: Token | undefined, line: number, charPositionInLine: number, msg: string, _e: unknown): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.MalloyParserErrorHandler = void 0;
|
|
26
|
+
class MalloyParserErrorHandler {
|
|
27
|
+
constructor(translator, messages) {
|
|
28
|
+
this.translator = translator;
|
|
29
|
+
this.messages = messages;
|
|
30
|
+
}
|
|
31
|
+
syntaxError(recognizer, offendingSymbol, line, charPositionInLine, msg, _e) {
|
|
32
|
+
const errAt = { line: line - 1, character: charPositionInLine };
|
|
33
|
+
const range = offendingSymbol
|
|
34
|
+
? this.translator.rangeFromToken(offendingSymbol)
|
|
35
|
+
: { start: errAt, end: errAt };
|
|
36
|
+
const error = {
|
|
37
|
+
message: msg,
|
|
38
|
+
at: { url: this.translator.sourceURL, range },
|
|
39
|
+
};
|
|
40
|
+
this.messages.log(error);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.MalloyParserErrorHandler = MalloyParserErrorHandler;
|
|
44
|
+
//# sourceMappingURL=parse-error-handler.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DocumentLocation } from "../model/malloy_types";
|
|
2
|
+
export declare type LogSeverity = "error" | "warn" | "debug";
|
|
3
|
+
/**
|
|
4
|
+
* Default severity is "error"
|
|
5
|
+
*/
|
|
6
|
+
export interface LogMessage {
|
|
7
|
+
message: string;
|
|
8
|
+
at?: DocumentLocation;
|
|
9
|
+
severity?: LogSeverity;
|
|
10
|
+
}
|
|
11
|
+
export interface MessageLogger {
|
|
12
|
+
log(logMsg: LogMessage): void;
|
|
13
|
+
reset(): void;
|
|
14
|
+
getLog(): LogMessage[];
|
|
15
|
+
hasErrors(): boolean;
|
|
16
|
+
noErrors(): boolean;
|
|
17
|
+
empty(): boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class MessageLog implements MessageLogger {
|
|
20
|
+
private rawLog;
|
|
21
|
+
getLog(): LogMessage[];
|
|
22
|
+
log(logMsg: LogMessage): void;
|
|
23
|
+
reset(): void;
|
|
24
|
+
noErrors(): boolean;
|
|
25
|
+
hasErrors(): boolean;
|
|
26
|
+
empty(): boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.MessageLog = void 0;
|
|
26
|
+
class MessageLog {
|
|
27
|
+
constructor() {
|
|
28
|
+
this.rawLog = [];
|
|
29
|
+
}
|
|
30
|
+
getLog() {
|
|
31
|
+
return this.rawLog;
|
|
32
|
+
}
|
|
33
|
+
log(logMsg) {
|
|
34
|
+
this.rawLog.push(logMsg);
|
|
35
|
+
}
|
|
36
|
+
reset() {
|
|
37
|
+
this.rawLog.length = 0;
|
|
38
|
+
}
|
|
39
|
+
noErrors() {
|
|
40
|
+
return !this.hasErrors();
|
|
41
|
+
}
|
|
42
|
+
hasErrors() {
|
|
43
|
+
const firstError = this.rawLog.find((l) => l.severity !== "warn");
|
|
44
|
+
return firstError !== undefined;
|
|
45
|
+
}
|
|
46
|
+
empty() {
|
|
47
|
+
return this.rawLog.length === 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.MessageLog = MessageLog;
|
|
51
|
+
//# sourceMappingURL=parse-log.js.map
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Token, CommonTokenStream, ParserRuleContext, CodePointCharStream } from "antlr4ts";
|
|
2
|
+
import type { ParseTree } from "antlr4ts/tree";
|
|
3
|
+
import { Query, NamedStructDefs, StructDef, ModelDef, DocumentReference, DocumentPosition, DocumentLocation, DocumentRange, SQLBlockStructDef } from "../model/malloy_types";
|
|
4
|
+
import { MessageLog } from "./parse-log";
|
|
5
|
+
import { Zone, ZoneData } from "./zone";
|
|
6
|
+
import { ReferenceList } from "./reference-list";
|
|
7
|
+
import { ErrorResponse, NeedURLData, FinalResponse, DataRequestResponse, ASTResponse, MetadataResponse, CompletionsResponse, HelpContextResponse, TranslateResponse, FatalResponse, ModelDataRequest } from "./translate-response";
|
|
8
|
+
export declare type StepResponses = DataRequestResponse | ASTResponse | TranslateResponse | ParseResponse | MetadataResponse;
|
|
9
|
+
/**
|
|
10
|
+
* A Translation is a series of translation steps. Each step can depend
|
|
11
|
+
* on other steps, in which case the preceeding steps will be passed
|
|
12
|
+
* to the constructor. The translator methods will then ask the final
|
|
13
|
+
* step for the answer, and it will call up the chain asking all the
|
|
14
|
+
* steps that it depends on for their answers.
|
|
15
|
+
*
|
|
16
|
+
* Any step can return a result which will be ...
|
|
17
|
+
* "I had errors, go no further"
|
|
18
|
+
* "I hit a spot where I need more data before I can continue"
|
|
19
|
+
* "I am done, here is the result of this step"
|
|
20
|
+
*/
|
|
21
|
+
interface TranslationStep {
|
|
22
|
+
step(that: MalloyTranslation): StepResponses;
|
|
23
|
+
}
|
|
24
|
+
export interface MalloyParseRoot {
|
|
25
|
+
root: ParseTree;
|
|
26
|
+
tokenStream: CommonTokenStream;
|
|
27
|
+
sourceStream: CodePointCharStream;
|
|
28
|
+
subTranslator: MalloyTranslation;
|
|
29
|
+
malloyVersion: string;
|
|
30
|
+
}
|
|
31
|
+
interface ParseData extends ErrorResponse, NeedURLData, FinalResponse {
|
|
32
|
+
parse: MalloyParseRoot;
|
|
33
|
+
}
|
|
34
|
+
export declare type ParseResponse = Partial<ParseData>;
|
|
35
|
+
/**
|
|
36
|
+
* ParseStep -- Parse the source URL
|
|
37
|
+
*/
|
|
38
|
+
interface SourceInfo {
|
|
39
|
+
lines: string[];
|
|
40
|
+
at: {
|
|
41
|
+
begin: number;
|
|
42
|
+
end: number;
|
|
43
|
+
}[];
|
|
44
|
+
length: number;
|
|
45
|
+
}
|
|
46
|
+
declare class ParseStep implements TranslationStep {
|
|
47
|
+
response?: ParseResponse;
|
|
48
|
+
sourceInfo?: SourceInfo;
|
|
49
|
+
step(that: MalloyTranslation): ParseResponse;
|
|
50
|
+
/**
|
|
51
|
+
* Split the source up into lines so we can correctly compute offset
|
|
52
|
+
* to the line/char positions favored by LSP and VSCode.
|
|
53
|
+
*/
|
|
54
|
+
private getSourceInfo;
|
|
55
|
+
private runParser;
|
|
56
|
+
}
|
|
57
|
+
declare class ImportsAndTablesStep implements TranslationStep {
|
|
58
|
+
readonly parseStep: ParseStep;
|
|
59
|
+
private alreadyLooked;
|
|
60
|
+
constructor(parseStep: ParseStep);
|
|
61
|
+
step(that: MalloyTranslation): DataRequestResponse | ParseResponse;
|
|
62
|
+
}
|
|
63
|
+
declare class ASTStep implements TranslationStep {
|
|
64
|
+
readonly importStep: ImportsAndTablesStep;
|
|
65
|
+
response?: ASTResponse;
|
|
66
|
+
private walked;
|
|
67
|
+
constructor(importStep: ImportsAndTablesStep);
|
|
68
|
+
step(that: MalloyTranslation): ASTResponse;
|
|
69
|
+
}
|
|
70
|
+
declare class MetadataStep implements TranslationStep {
|
|
71
|
+
readonly parseStep: ParseStep;
|
|
72
|
+
response?: MetadataResponse;
|
|
73
|
+
constructor(parseStep: ParseStep);
|
|
74
|
+
step(that: MalloyTranslation): MetadataResponse;
|
|
75
|
+
}
|
|
76
|
+
declare class CompletionsStep implements TranslationStep {
|
|
77
|
+
readonly parseStep: ParseStep;
|
|
78
|
+
constructor(parseStep: ParseStep);
|
|
79
|
+
step(that: MalloyTranslation, position?: {
|
|
80
|
+
line: number;
|
|
81
|
+
character: number;
|
|
82
|
+
}): CompletionsResponse;
|
|
83
|
+
}
|
|
84
|
+
declare class HelpContextStep implements TranslationStep {
|
|
85
|
+
readonly parseStep: ParseStep;
|
|
86
|
+
constructor(parseStep: ParseStep);
|
|
87
|
+
step(that: MalloyTranslation, position?: {
|
|
88
|
+
line: number;
|
|
89
|
+
character: number;
|
|
90
|
+
}): HelpContextResponse;
|
|
91
|
+
}
|
|
92
|
+
declare class TranslateStep implements TranslationStep {
|
|
93
|
+
readonly astStep: ASTStep;
|
|
94
|
+
response?: TranslateResponse;
|
|
95
|
+
constructor(astStep: ASTStep);
|
|
96
|
+
step(that: MalloyTranslation, extendingModel?: ModelDef): TranslateResponse;
|
|
97
|
+
}
|
|
98
|
+
export declare abstract class MalloyTranslation {
|
|
99
|
+
readonly sourceURL: string;
|
|
100
|
+
grammarRule: string;
|
|
101
|
+
abstract root: MalloyTranslator;
|
|
102
|
+
childTranslators: Map<string, MalloyTranslation>;
|
|
103
|
+
urlIsFullPath?: boolean;
|
|
104
|
+
queryList: Query[];
|
|
105
|
+
sqlBlocks: SQLBlockStructDef[];
|
|
106
|
+
modelDef: ModelDef;
|
|
107
|
+
readonly parseStep: ParseStep;
|
|
108
|
+
readonly importsAndTablesStep: ImportsAndTablesStep;
|
|
109
|
+
readonly astStep: ASTStep;
|
|
110
|
+
readonly metadataStep: MetadataStep;
|
|
111
|
+
readonly completionsStep: CompletionsStep;
|
|
112
|
+
readonly helpContextStep: HelpContextStep;
|
|
113
|
+
readonly translateStep: TranslateStep;
|
|
114
|
+
readonly references: ReferenceList;
|
|
115
|
+
constructor(sourceURL: string, grammarRule?: string);
|
|
116
|
+
addChild(url: string): void;
|
|
117
|
+
addReference(reference: DocumentReference): void;
|
|
118
|
+
referenceAt(position: DocumentPosition): DocumentReference | undefined;
|
|
119
|
+
fatalErrors(): FatalResponse;
|
|
120
|
+
/**
|
|
121
|
+
* The error log can grow as progressively deeper questions are asked.
|
|
122
|
+
* When returning "errors so far", make a snapshot.
|
|
123
|
+
*/
|
|
124
|
+
errors(): ErrorResponse;
|
|
125
|
+
getLineMap(url: string): string[] | undefined;
|
|
126
|
+
prettyErrors(): string;
|
|
127
|
+
childRequest(importURL: string): ModelDataRequest;
|
|
128
|
+
getChildExports(importURL: string): NamedStructDefs;
|
|
129
|
+
private finalAnswer?;
|
|
130
|
+
translate(extendingModel?: ModelDef): TranslateResponse;
|
|
131
|
+
metadata(): MetadataResponse;
|
|
132
|
+
completions(position: {
|
|
133
|
+
line: number;
|
|
134
|
+
character: number;
|
|
135
|
+
}): CompletionsResponse;
|
|
136
|
+
helpContext(position: {
|
|
137
|
+
line: number;
|
|
138
|
+
character: number;
|
|
139
|
+
}): HelpContextResponse;
|
|
140
|
+
defaultLocation(): DocumentLocation;
|
|
141
|
+
rangeFromContext(pcx: ParserRuleContext): DocumentRange;
|
|
142
|
+
rangeFromTokens(startToken: Token, stopToken: Token): DocumentRange;
|
|
143
|
+
rangeFromToken(token: Token): DocumentRange;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The main interface to Malloy tranlsation. It has a call pattern
|
|
147
|
+
* similar to a server. Once a translator is instantiated
|
|
148
|
+
* you can request tralnsations repeatedly. Responses to that request
|
|
149
|
+
* will either be "NeedResponse" or "TranslateResponse" objects. The
|
|
150
|
+
* correct pattern is to call "translation" in a loop, calling
|
|
151
|
+
* "update" in response to each "NeedResponse" until a "TranslateResponse"
|
|
152
|
+
* is returned. If you get a response with "final:true", there is
|
|
153
|
+
* no need to call again, the translation is finished or error'd.
|
|
154
|
+
*/
|
|
155
|
+
export declare class MalloyTranslator extends MalloyTranslation {
|
|
156
|
+
schemaZone: Zone<StructDef>;
|
|
157
|
+
importZone: Zone<string>;
|
|
158
|
+
sqlQueryZone: Zone<SQLBlockStructDef>;
|
|
159
|
+
logger: MessageLog;
|
|
160
|
+
readonly root: MalloyTranslator;
|
|
161
|
+
constructor(rootURL: string, preload?: ParseUpdate | null);
|
|
162
|
+
update(dd: ParseUpdate): void;
|
|
163
|
+
}
|
|
164
|
+
interface ErrorData {
|
|
165
|
+
tables: Record<string, string>;
|
|
166
|
+
urls: Record<string, string>;
|
|
167
|
+
compileSQL: Record<string, string>;
|
|
168
|
+
}
|
|
169
|
+
export interface URLData {
|
|
170
|
+
urls: ZoneData<string>;
|
|
171
|
+
}
|
|
172
|
+
export interface SchemaData {
|
|
173
|
+
tables: ZoneData<StructDef>;
|
|
174
|
+
}
|
|
175
|
+
export interface SQLBlockData {
|
|
176
|
+
compileSQL: ZoneData<SQLBlockStructDef>;
|
|
177
|
+
}
|
|
178
|
+
export interface UpdateData extends URLData, SchemaData, SQLBlockData {
|
|
179
|
+
errors: Partial<ErrorData>;
|
|
180
|
+
}
|
|
181
|
+
export declare type ParseUpdate = Partial<UpdateData>;
|
|
182
|
+
export {};
|