@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.
- package/dist/connection_utils.js +10 -10
- package/dist/dialect/dialect.d.ts +2 -2
- package/dist/dialect/dialect.js +13 -13
- package/dist/dialect/dialect_map.d.ts +1 -1
- package/dist/dialect/duckdb.d.ts +3 -3
- package/dist/dialect/duckdb.js +44 -44
- package/dist/dialect/index.d.ts +6 -6
- package/dist/dialect/postgres.d.ts +3 -3
- package/dist/dialect/postgres.js +46 -46
- package/dist/dialect/standardsql.d.ts +4 -4
- package/dist/dialect/standardsql.js +51 -51
- package/dist/index.d.ts +10 -10
- package/dist/lang/ast/ast-utils.d.ts +1 -1
- package/dist/lang/ast/ast-utils.js +3 -3
- package/dist/lang/ast/elements/define-query.d.ts +3 -3
- package/dist/lang/ast/elements/define-query.js +6 -6
- package/dist/lang/ast/elements/define-source.d.ts +4 -4
- package/dist/lang/ast/elements/define-source.js +8 -8
- package/dist/lang/ast/elements/import-statement.d.ts +2 -2
- package/dist/lang/ast/elements/import-statement.js +7 -7
- package/dist/lang/ast/elements/pipeline-desc.d.ts +5 -5
- package/dist/lang/ast/elements/pipeline-desc.js +11 -11
- package/dist/lang/ast/elements/refined-source.d.ts +4 -4
- package/dist/lang/ast/elements/refined-source.js +6 -6
- package/dist/lang/ast/elements/source.d.ts +3 -3
- package/dist/lang/ast/elements/source.js +1 -1
- package/dist/lang/ast/error-factory.d.ts +1 -1
- package/dist/lang/ast/error-factory.js +15 -15
- package/dist/lang/ast/executors/index-executor.d.ts +7 -7
- package/dist/lang/ast/executors/index-executor.js +4 -4
- package/dist/lang/ast/executors/project-executor.d.ts +5 -5
- package/dist/lang/ast/executors/project-executor.js +2 -2
- package/dist/lang/ast/executors/reduce-executor.d.ts +8 -8
- package/dist/lang/ast/executors/reduce-executor.js +5 -5
- package/dist/lang/ast/expressions/apply.d.ts +2 -2
- package/dist/lang/ast/expressions/apply.js +1 -1
- package/dist/lang/ast/expressions/binary-boolean.d.ts +3 -3
- package/dist/lang/ast/expressions/binary-boolean.js +6 -6
- package/dist/lang/ast/expressions/binary-numeric.d.ts +3 -3
- package/dist/lang/ast/expressions/binary-numeric.js +2 -2
- package/dist/lang/ast/expressions/boolean.d.ts +4 -4
- package/dist/lang/ast/expressions/boolean.js +2 -2
- package/dist/lang/ast/expressions/constant-sub-expression.d.ts +4 -4
- package/dist/lang/ast/expressions/constant-sub-expression.js +12 -12
- package/dist/lang/ast/expressions/expr-add-sub.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-add-sub.js +1 -1
- package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-aggregate-function.js +15 -15
- package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +6 -6
- package/dist/lang/ast/expressions/expr-alternation-tree.js +6 -6
- package/dist/lang/ast/expressions/expr-asymmetric.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-asymmetric.js +3 -3
- package/dist/lang/ast/expressions/expr-avg.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-avg.js +2 -2
- package/dist/lang/ast/expressions/expr-cast.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-cast.js +6 -6
- package/dist/lang/ast/expressions/expr-compare.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-compare.js +9 -9
- package/dist/lang/ast/expressions/expr-count-distinct.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-count-distinct.js +1 -1
- package/dist/lang/ast/expressions/expr-count.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-count.js +10 -10
- package/dist/lang/ast/expressions/expr-filter.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-filter.js +13 -13
- package/dist/lang/ast/expressions/expr-func.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-func.js +8 -8
- package/dist/lang/ast/expressions/expr-granular-time.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-granular-time.js +17 -17
- package/dist/lang/ast/expressions/expr-id-reference.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-id-reference.js +11 -11
- package/dist/lang/ast/expressions/expr-logical-op.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-logical-op.js +1 -1
- package/dist/lang/ast/expressions/expr-max.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-max.js +1 -1
- package/dist/lang/ast/expressions/expr-min.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-min.js +1 -1
- package/dist/lang/ast/expressions/expr-minus.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-minus.js +5 -5
- package/dist/lang/ast/expressions/expr-mul-div.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-mul-div.js +1 -1
- package/dist/lang/ast/expressions/expr-not.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-not.js +3 -3
- package/dist/lang/ast/expressions/expr-now.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-now.js +8 -8
- package/dist/lang/ast/expressions/expr-null.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-null.js +4 -4
- package/dist/lang/ast/expressions/expr-number.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-number.js +2 -2
- package/dist/lang/ast/expressions/expr-parens.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-parens.js +3 -3
- package/dist/lang/ast/expressions/expr-regex.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-regex.js +4 -4
- package/dist/lang/ast/expressions/expr-string.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-string.js +8 -8
- package/dist/lang/ast/expressions/expr-sum.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-sum.js +2 -2
- package/dist/lang/ast/expressions/expr-time-extract.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-time-extract.js +30 -30
- package/dist/lang/ast/expressions/expr-time.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-time.js +10 -10
- package/dist/lang/ast/expressions/expr-ungroup.d.ts +6 -6
- package/dist/lang/ast/expressions/expr-ungroup.js +13 -13
- package/dist/lang/ast/expressions/for-range.d.ts +4 -4
- package/dist/lang/ast/expressions/for-range.js +17 -17
- package/dist/lang/ast/expressions/granular-literal.d.ts +4 -4
- package/dist/lang/ast/expressions/granular-literal.js +34 -34
- package/dist/lang/ast/expressions/partial-compare.d.ts +4 -4
- package/dist/lang/ast/expressions/partial-compare.js +4 -4
- package/dist/lang/ast/expressions/pick-when.d.ts +4 -4
- package/dist/lang/ast/expressions/pick-when.js +32 -32
- package/dist/lang/ast/expressions/range.d.ts +3 -3
- package/dist/lang/ast/expressions/range.js +20 -20
- package/dist/lang/ast/expressions/time-frame.d.ts +2 -2
- package/dist/lang/ast/expressions/time-frame.js +3 -3
- package/dist/lang/ast/expressions/top-by.d.ts +4 -4
- package/dist/lang/ast/expressions/top-by.js +5 -5
- package/dist/lang/ast/expressions/unary.d.ts +1 -1
- package/dist/lang/ast/expressions/unary.js +1 -1
- package/dist/lang/ast/expressions/utils.d.ts +2 -2
- package/dist/lang/ast/expressions/utils.js +6 -6
- package/dist/lang/ast/field-space/column-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/dynamic-space.d.ts +7 -7
- package/dist/lang/ast/field-space/dynamic-space.js +2 -2
- package/dist/lang/ast/field-space/field-definition-value.d.ts +5 -5
- package/dist/lang/ast/field-space/index-field-space.d.ts +3 -3
- package/dist/lang/ast/field-space/index-field-space.js +4 -4
- package/dist/lang/ast/field-space/join-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/project-field-space.d.ts +2 -2
- package/dist/lang/ast/field-space/project-field-space.js +5 -5
- package/dist/lang/ast/field-space/query-field-struct.d.ts +3 -3
- package/dist/lang/ast/field-space/query-field-struct.js +1 -1
- package/dist/lang/ast/field-space/query-space-field.d.ts +4 -4
- package/dist/lang/ast/field-space/query-space-field.js +1 -1
- package/dist/lang/ast/field-space/query-spaces.d.ts +11 -11
- package/dist/lang/ast/field-space/query-spaces.js +8 -8
- package/dist/lang/ast/field-space/reference-field.d.ts +5 -5
- package/dist/lang/ast/field-space/reference-field.js +1 -1
- package/dist/lang/ast/field-space/refined-space.d.ts +4 -4
- package/dist/lang/ast/field-space/refined-space.js +2 -2
- package/dist/lang/ast/field-space/rename-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/rename-space-field.js +2 -2
- package/dist/lang/ast/field-space/static-space.d.ts +7 -7
- package/dist/lang/ast/field-space/static-space.js +12 -12
- package/dist/lang/ast/field-space/struct-space-field-base.d.ts +4 -4
- package/dist/lang/ast/field-space/struct-space-field-base.js +1 -1
- package/dist/lang/ast/field-space/wild-space-field.d.ts +4 -4
- package/dist/lang/ast/field-space/wild-space-field.js +1 -1
- package/dist/lang/ast/fragtype-utils.d.ts +1 -1
- package/dist/lang/ast/fragtype-utils.js +15 -15
- package/dist/lang/ast/index.d.ts +90 -90
- package/dist/lang/ast/parameters/constant-parameter.d.ts +3 -3
- package/dist/lang/ast/parameters/constant-parameter.js +10 -10
- package/dist/lang/ast/parameters/has-parameter.d.ts +3 -3
- package/dist/lang/ast/parameters/has-parameter.js +7 -7
- package/dist/lang/ast/query-elements/anonymous-query.d.ts +3 -3
- package/dist/lang/ast/query-elements/anonymous-query.js +2 -2
- package/dist/lang/ast/query-elements/existing-query.d.ts +4 -4
- package/dist/lang/ast/query-elements/existing-query.js +10 -10
- package/dist/lang/ast/query-elements/full-query.d.ts +4 -4
- package/dist/lang/ast/query-elements/full-query.js +10 -10
- package/dist/lang/ast/query-elements/query-head-struct.d.ts +2 -2
- package/dist/lang/ast/query-elements/query-head-struct.js +2 -2
- package/dist/lang/ast/query-items/field-declaration.d.ts +6 -6
- package/dist/lang/ast/query-items/field-declaration.js +14 -14
- package/dist/lang/ast/query-items/field-references.d.ts +6 -6
- package/dist/lang/ast/query-items/field-references.js +9 -9
- package/dist/lang/ast/query-properties/aggregate.d.ts +2 -2
- package/dist/lang/ast/query-properties/aggregate.js +1 -1
- package/dist/lang/ast/query-properties/declare-fields.d.ts +2 -2
- package/dist/lang/ast/query-properties/declare-fields.js +1 -1
- package/dist/lang/ast/query-properties/dimmensions.d.ts +2 -2
- package/dist/lang/ast/query-properties/dimmensions.js +1 -1
- package/dist/lang/ast/query-properties/filters.d.ts +4 -4
- package/dist/lang/ast/query-properties/filters.js +16 -16
- package/dist/lang/ast/query-properties/group-by.d.ts +2 -2
- package/dist/lang/ast/query-properties/group-by.js +1 -1
- package/dist/lang/ast/query-properties/indexing.d.ts +3 -3
- package/dist/lang/ast/query-properties/indexing.js +3 -3
- package/dist/lang/ast/query-properties/joins.d.ts +6 -6
- package/dist/lang/ast/query-properties/joins.js +27 -27
- package/dist/lang/ast/query-properties/limit.d.ts +1 -1
- package/dist/lang/ast/query-properties/limit.js +1 -1
- package/dist/lang/ast/query-properties/measures.d.ts +2 -2
- package/dist/lang/ast/query-properties/measures.js +1 -1
- package/dist/lang/ast/query-properties/nest-reference.d.ts +2 -2
- package/dist/lang/ast/query-properties/nest-reference.js +1 -1
- package/dist/lang/ast/query-properties/nest.d.ts +7 -7
- package/dist/lang/ast/query-properties/nest.js +7 -7
- package/dist/lang/ast/query-properties/nests.d.ts +2 -2
- package/dist/lang/ast/query-properties/nests.js +1 -1
- package/dist/lang/ast/query-properties/ordering.d.ts +3 -3
- package/dist/lang/ast/query-properties/ordering.js +6 -6
- package/dist/lang/ast/query-properties/project-statement.d.ts +2 -2
- package/dist/lang/ast/query-properties/project-statement.js +1 -1
- package/dist/lang/ast/query-properties/qop-desc.d.ts +7 -7
- package/dist/lang/ast/query-properties/qop-desc.js +20 -20
- package/dist/lang/ast/query-properties/sampling.d.ts +2 -2
- package/dist/lang/ast/query-properties/sampling.js +1 -1
- package/dist/lang/ast/query-properties/top.d.ts +4 -4
- package/dist/lang/ast/query-properties/top.js +5 -5
- package/dist/lang/ast/source-properties/field-list-edit.d.ts +4 -4
- package/dist/lang/ast/source-properties/field-list-edit.js +2 -2
- package/dist/lang/ast/source-properties/primary-key.d.ts +2 -2
- package/dist/lang/ast/source-properties/primary-key.js +2 -2
- package/dist/lang/ast/source-properties/renames.d.ts +2 -2
- package/dist/lang/ast/source-properties/renames.js +3 -3
- package/dist/lang/ast/source-properties/turtles.d.ts +2 -2
- package/dist/lang/ast/source-properties/turtles.js +1 -1
- package/dist/lang/ast/sources/named-source.d.ts +4 -4
- package/dist/lang/ast/sources/named-source.js +5 -5
- package/dist/lang/ast/sources/query-source.d.ts +3 -3
- package/dist/lang/ast/sources/query-source.js +3 -3
- package/dist/lang/ast/sources/sql-source.d.ts +2 -2
- package/dist/lang/ast/sources/sql-source.js +2 -2
- package/dist/lang/ast/sources/table-source.d.ts +2 -2
- package/dist/lang/ast/sources/table-source.js +7 -7
- package/dist/lang/ast/space-seed.d.ts +2 -2
- package/dist/lang/ast/space-seed.js +1 -1
- package/dist/lang/ast/sql-elements/sql-statement.d.ts +4 -4
- package/dist/lang/ast/sql-elements/sql-statement.js +9 -9
- package/dist/lang/ast/sql-elements/sql-string.d.ts +3 -3
- package/dist/lang/ast/sql-elements/sql-string.js +6 -6
- package/dist/lang/ast/struct-utils.d.ts +2 -2
- package/dist/lang/ast/struct-utils.js +3 -3
- package/dist/lang/ast/time-utils.d.ts +6 -6
- package/dist/lang/ast/time-utils.js +46 -46
- package/dist/lang/ast/types/document-compile-result.d.ts +2 -2
- package/dist/lang/ast/types/executor.d.ts +3 -3
- package/dist/lang/ast/types/explore-desc.d.ts +2 -2
- package/dist/lang/ast/types/explore-desc.js +1 -1
- package/dist/lang/ast/types/explore-field.d.ts +3 -3
- package/dist/lang/ast/types/expr-result.d.ts +2 -2
- package/dist/lang/ast/types/expr-value.d.ts +2 -2
- package/dist/lang/ast/types/expression-def.d.ts +4 -4
- package/dist/lang/ast/types/expression-def.js +86 -86
- package/dist/lang/ast/types/field-collection-member.d.ts +3 -3
- package/dist/lang/ast/types/field-decl.d.ts +5 -5
- package/dist/lang/ast/types/field-space.d.ts +5 -5
- package/dist/lang/ast/types/field-space.js +1 -1
- package/dist/lang/ast/types/granular-result.d.ts +3 -3
- package/dist/lang/ast/types/granular-result.js +1 -1
- package/dist/lang/ast/types/lookup-result.d.ts +1 -1
- package/dist/lang/ast/types/malloy-element.d.ts +6 -6
- package/dist/lang/ast/types/malloy-element.js +49 -49
- package/dist/lang/ast/types/model-entry.d.ts +1 -1
- package/dist/lang/ast/types/name-space.d.ts +1 -1
- package/dist/lang/ast/types/nested-query.d.ts +2 -2
- package/dist/lang/ast/types/op-desc.d.ts +2 -2
- package/dist/lang/ast/types/query-comp.d.ts +1 -1
- package/dist/lang/ast/types/query-element.d.ts +3 -3
- package/dist/lang/ast/types/query-item.d.ts +4 -4
- package/dist/lang/ast/types/query-property.d.ts +15 -15
- package/dist/lang/ast/types/source-property.d.ts +8 -8
- package/dist/lang/ast/types/space-entry.d.ts +2 -2
- package/dist/lang/ast/types/space-field.d.ts +4 -4
- package/dist/lang/ast/types/space-field.js +4 -4
- package/dist/lang/ast/types/space-param.d.ts +4 -4
- package/dist/lang/ast/types/space-param.js +4 -4
- package/dist/lang/ast/types/time-result.d.ts +2 -2
- package/dist/lang/ast/types/turtle-headed-pipe.d.ts +2 -2
- package/dist/lang/ast/types/turtle-headed-pipe.js +1 -1
- package/dist/lang/ast/types/type-desc.d.ts +3 -3
- package/dist/lang/field-utils.d.ts +1 -1
- package/dist/lang/field-utils.js +4 -4
- package/dist/lang/index.d.ts +10 -10
- package/dist/lang/malloy-to-ast.d.ts +8 -8
- package/dist/lang/malloy-to-ast.js +68 -68
- package/dist/lang/parse-error-handler.d.ts +3 -3
- package/dist/lang/parse-error-handler.js +4 -4
- package/dist/lang/parse-log.d.ts +2 -2
- package/dist/lang/parse-log.js +1 -1
- package/dist/lang/parse-malloy.d.ts +7 -7
- package/dist/lang/parse-malloy.js +81 -81
- package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +2 -2
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +38 -38
- package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +1 -1
- package/dist/lang/parse-tree-walkers/document-help-context-walker.js +14 -14
- package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +3 -3
- package/dist/lang/parse-tree-walkers/document-highlight-walker.js +85 -85
- package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +4 -4
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +40 -40
- package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +3 -3
- package/dist/lang/parse-tree-walkers/explore-query-walker.js +3 -3
- package/dist/lang/parse-tree-walkers/find-external-references.d.ts +4 -4
- package/dist/lang/parse-tree-walkers/find-external-references.js +2 -2
- package/dist/lang/reference-list.d.ts +1 -1
- package/dist/lang/test/document-help-context-walker.spec.js +9 -9
- package/dist/lang/test/document-symbol-walker.spec.js +32 -32
- package/dist/lang/test/field-symbols.spec.js +87 -87
- package/dist/lang/test/parse.spec.d.ts +1 -1
- package/dist/lang/test/parse.spec.js +768 -768
- package/dist/lang/test/test-translator.d.ts +6 -6
- package/dist/lang/test/test-translator.js +159 -159
- package/dist/lang/translate-response.d.ts +7 -7
- package/dist/lang/translate-response.js +1 -1
- package/dist/lang/zone.d.ts +5 -5
- package/dist/lang/zone.js +8 -8
- package/dist/malloy.d.ts +7 -7
- package/dist/malloy.js +192 -192
- package/dist/model/index.d.ts +2 -2
- package/dist/model/malloy_query.d.ts +12 -12
- package/dist/model/malloy_query.js +497 -502
- package/dist/model/malloy_types.d.ts +68 -68
- package/dist/model/malloy_types.js +102 -102
- package/dist/model/sql_block.d.ts +1 -1
- package/dist/model/sql_block.js +4 -4
- package/dist/model/utils.d.ts +1 -1
- package/dist/model/utils.js +10 -10
- package/dist/runtime_types.d.ts +2 -2
- 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
|
-
|
|
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 !==
|
|
99
|
-
if (srcEnt.status ===
|
|
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 {
|
|
108
|
+
return { urls: [that.sourceURL] };
|
|
109
109
|
}
|
|
110
|
-
const source = 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
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
|
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
|
-
|
|
154
|
-
|
|
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({
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
root: parseFunc.call(malloyParser),
|
|
184
|
+
tokenStream: tokenStream,
|
|
185
|
+
sourceStream: inputStream,
|
|
186
186
|
// TODO put the real version here
|
|
187
|
-
|
|
188
|
-
|
|
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
|
|
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
|
-
|
|
209
|
-
|
|
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
|
-
|
|
221
|
-
|
|
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
|
-
|
|
230
|
-
|
|
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 = {
|
|
244
|
+
allMissing = { tables: missingTables };
|
|
245
245
|
}
|
|
246
246
|
const missingImports = that.root.importZone.getUndefined();
|
|
247
247
|
if (missingImports) {
|
|
248
|
-
allMissing = { ...allMissing,
|
|
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(
|
|
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 ===
|
|
292
|
-
throw new Error(
|
|
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(
|
|
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
|
-
|
|
341
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 ===
|
|
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
|
-
|
|
476
|
-
|
|
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
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
485
|
+
translated: {
|
|
486
|
+
modelDef: that.modelDef,
|
|
487
|
+
queryList: that.queryList,
|
|
488
|
+
sqlBlocks: that.sqlBlocks,
|
|
489
489
|
},
|
|
490
490
|
...that.errors(),
|
|
491
|
-
|
|
491
|
+
final: true,
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
494
|
return this.response;
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
class MalloyTranslation {
|
|
498
|
-
constructor(sourceURL, grammarRule =
|
|
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
|
-
|
|
506
|
-
|
|
507
|
-
|
|
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
|
-
|
|
539
|
-
|
|
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 {
|
|
548
|
+
return { errors: [...errors] };
|
|
549
549
|
}
|
|
550
550
|
getLineMap(url) {
|
|
551
551
|
var _a, _b;
|
|
552
|
-
if (url
|
|
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 | ${
|
|
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
|
-
|
|
602
|
-
|
|
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 ===
|
|
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
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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
|
-
|
|
658
|
-
|
|
657
|
+
line: startToken.line - 1,
|
|
658
|
+
character: startToken.charPositionInLine,
|
|
659
659
|
};
|
|
660
|
-
if (this.parseStep.sourceInfo && stopToken.stopIndex
|
|
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
|
-
|
|
669
|
-
|
|
670
|
-
|
|
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
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}
|
|
679
|
+
end: {
|
|
680
|
+
line: lastLine,
|
|
681
|
+
character: this.parseStep.sourceInfo.lines[lastLine].length,
|
|
682
|
+
},
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
|
-
return { start,
|
|
685
|
+
return { start, end: start };
|
|
686
686
|
}
|
|
687
687
|
rangeFromToken(token) {
|
|
688
688
|
return this.rangeFromTokens(token, token);
|
|
@@ -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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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 = [
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
start: {
|
|
65
|
+
line: pcx.start.line - 1,
|
|
66
|
+
character: pcx.start.charPositionInLine,
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
98
|
-
|
|
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
|
-
|
|
116
|
-
|
|
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
|
-
|
|
134
|
-
|
|
133
|
+
type: 'model_property',
|
|
134
|
+
text: `${property}: `,
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
}
|
|
@@ -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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
start: {
|
|
37
|
+
line: ctx.start.line - 1,
|
|
38
|
+
character: ctx.start.charPositionInLine,
|
|
39
39
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
64
|
-
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
2
|
-
import { ParseTree } from
|
|
3
|
-
import { DocumentRange } from
|
|
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;
|