@malloydata/malloy 0.0.56-dev230710205111 → 0.0.56-dev230710210339

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.
@@ -278,7 +278,11 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
278
278
  visitQueryByName(pcx) {
279
279
  const query = new ast.ExistingQuery();
280
280
  query.head = this.getModelEntryName(pcx);
281
- return this.astAt(query, pcx);
281
+ const res = this.astAt(query, pcx);
282
+ if (this.m4WarningsEnabled() && pcx.ARROW()) {
283
+ this.astError(res, 'Leading arrow (`->`) when referencing a query is deprecated; remove the arrow', 'warn');
284
+ }
285
+ return res;
282
286
  }
283
287
  getSourceExtensions(pcx) {
284
288
  const extensions = pcx === null || pcx === void 0 ? void 0 : pcx.exploreProperties();
@@ -2969,6 +2969,16 @@ describe('sql expressions', () => {
2969
2969
  }
2970
2970
  });
2971
2971
  });
2972
+ describe('turtle with leading arrow', () => {
2973
+ test('optional leading arrow for defining a turtle', () => {
2974
+ expect(`
2975
+ source: c is a extend {
2976
+ query: x is -> { project: * }
2977
+ query: y is { project: * }
2978
+ }
2979
+ `).toTranslate();
2980
+ });
2981
+ });
2972
2982
  describe('extend and refine', () => {
2973
2983
  describe('extend and refine, new syntax', () => {
2974
2984
  test('query name with query refinements', () => {
@@ -3156,4 +3166,28 @@ describe('extend and refine', () => {
3156
3166
  });
3157
3167
  });
3158
3168
  });
3169
+ describe('miscellaneous m4 warnings', () => {
3170
+ test('query leading arrow', () => {
3171
+ expect(`
3172
+ ##! m4warnings
3173
+ query: x is a -> { project: * }
3174
+ run: x
3175
+ `).toTranslate();
3176
+ expect(`
3177
+ ##! m4warnings
3178
+ query: x is a -> { project: * }
3179
+ run: x -> { project: * }
3180
+ `).toTranslate();
3181
+ expect(`
3182
+ ##! m4warnings
3183
+ query: x is a -> { project: * }
3184
+ run: -> x
3185
+ `).toTranslateWithWarnings('Leading arrow (`->`) when referencing a query is deprecated; remove the arrow');
3186
+ expect(`
3187
+ ##! m4warnings
3188
+ query: x is a -> { project: * }
3189
+ run: -> x -> { project: * }
3190
+ `).toTranslateWithWarnings('Leading arrow (`->`) when referencing a query is deprecated; remove the arrow');
3191
+ });
3192
+ });
3159
3193
  //# sourceMappingURL=parse.spec.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.56-dev230710205111",
3
+ "version": "0.0.56-dev230710210339",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",