@malloydata/malloy 0.0.56-dev230710210433 → 0.0.56-dev230710212813

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.
@@ -382,7 +382,11 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
382
382
  visitQuerySource(pcx) {
383
383
  const query = this.visit(pcx.query());
384
384
  if (ast.isQueryElement(query)) {
385
- return this.astAt(new ast.QuerySource(query), pcx);
385
+ const el = this.astAt(new ast.QuerySource(query), pcx);
386
+ if (this.m4WarningsEnabled()) {
387
+ this.astError(el, '`from(some_query)` is deprecated; use `some_query` directly', 'warn');
388
+ }
389
+ return el;
386
390
  }
387
391
  throw this.internalError(pcx, `Expect query definition, got a '${query.elementType}'`);
388
392
  }
@@ -3208,6 +3208,20 @@ describe('extend and refine', () => {
3208
3208
  });
3209
3209
  });
3210
3210
  describe('miscellaneous m4 warnings', () => {
3211
+ test('from() is deprecated', () => {
3212
+ expect(`
3213
+ ##! m4warnings
3214
+ query: q is a -> { project: * }
3215
+ source: c is from(q) extend {
3216
+ dimension: x is 1
3217
+ }`).toTranslateWithWarnings('`from(some_query)` is deprecated; use `some_query` directly');
3218
+ expect(`
3219
+ ##! m4warnings
3220
+ query: q is a -> { project: * }
3221
+ source: c is q extend {
3222
+ dimension: x is 1
3223
+ }`).toTranslate();
3224
+ });
3211
3225
  test('query leading arrow', () => {
3212
3226
  expect(`
3213
3227
  ##! m4warnings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.56-dev230710210433",
3
+ "version": "0.0.56-dev230710212813",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",