@malloydata/malloy 0.0.218-dev241120182108 → 0.0.218-dev241120184958
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.
|
@@ -175,9 +175,9 @@ export declare class MalloyChildTranslator extends MalloyTranslation {
|
|
|
175
175
|
constructor(rootURL: string, root: MalloyTranslator);
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
|
-
* The main interface to Malloy
|
|
178
|
+
* The main interface to Malloy translation. It has a call pattern
|
|
179
179
|
* similar to a server. Once a translator is instantiated
|
|
180
|
-
* you can request
|
|
180
|
+
* you can request translations repeatedly. Responses to that request
|
|
181
181
|
* will either be "NeedResponse" or "TranslateResponse" objects. The
|
|
182
182
|
* correct pattern is to call "translation" in a loop, calling
|
|
183
183
|
* "update" in response to each "NeedResponse" until a "TranslateResponse"
|
|
@@ -747,7 +747,7 @@ class MalloyTranslation {
|
|
|
747
747
|
const lastLine = this.parseStep.sourceInfo.lines.length - 1;
|
|
748
748
|
for (let lineNo = startToken.line - 1; lineNo <= lastLine; lineNo++) {
|
|
749
749
|
const at = this.parseStep.sourceInfo.at[lineNo];
|
|
750
|
-
if (stopToken.stopIndex >= at.begin && stopToken.stopIndex
|
|
750
|
+
if (stopToken.stopIndex >= at.begin && stopToken.stopIndex < at.end) {
|
|
751
751
|
return {
|
|
752
752
|
start,
|
|
753
753
|
end: {
|
|
@@ -797,9 +797,9 @@ class MalloyChildTranslator extends MalloyTranslation {
|
|
|
797
797
|
}
|
|
798
798
|
exports.MalloyChildTranslator = MalloyChildTranslator;
|
|
799
799
|
/**
|
|
800
|
-
* The main interface to Malloy
|
|
800
|
+
* The main interface to Malloy translation. It has a call pattern
|
|
801
801
|
* similar to a server. Once a translator is instantiated
|
|
802
|
-
* you can request
|
|
802
|
+
* you can request translations repeatedly. Responses to that request
|
|
803
803
|
* will either be "NeedResponse" or "TranslateResponse" objects. The
|
|
804
804
|
* correct pattern is to call "translation" in a loop, calling
|
|
805
805
|
* "update" in response to each "NeedResponse" until a "TranslateResponse"
|
|
@@ -187,6 +187,18 @@ test('run lenses go before block annotations', () => {
|
|
|
187
187
|
# tag3
|
|
188
188
|
flights -> by_carrier`}`, [0]);
|
|
189
189
|
});
|
|
190
|
+
test('multiline unnamed queries include last line', () => {
|
|
191
|
+
// The trailing } being in column 0 is significant
|
|
192
|
+
testLens((0, test_translator_1.markSource) `${`run: flights -> {
|
|
193
|
+
group_by: carrier
|
|
194
|
+
}`}`, [0]);
|
|
195
|
+
});
|
|
196
|
+
test('multiline named queries include last line', () => {
|
|
197
|
+
// The trailing } being in column 0 is significant
|
|
198
|
+
testLens((0, test_translator_1.markSource) `${`query: by_carrier is flights -> {
|
|
199
|
+
group_by: carrier
|
|
200
|
+
}`}`, [0]);
|
|
201
|
+
});
|
|
190
202
|
test('(regression) query does not use source block range', () => {
|
|
191
203
|
testLens((0, test_translator_1.markSource) `source: a is DB.table('b') extend {
|
|
192
204
|
query:
|