Skip to content

Commit

Permalink
remove m4 filter shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoy-googly-moogly committed Oct 29, 2024
1 parent 337cdd2 commit 8943574
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
8 changes: 1 addition & 7 deletions packages/malloy/src/lang/grammar/MalloyParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ connectionId
: id;

queryProperties
: filterShortcut
| OCURLY (queryStatement | SEMI)* closeCurly
;

filterShortcut
: OCURLY QMARK fieldExpr closeCurly
: OCURLY (queryStatement | SEMI)* closeCurly
;

queryName : id;
Expand Down Expand Up @@ -169,7 +164,6 @@ sourceNameDef: id;

exploreProperties
: OCURLY (exploreStatement | SEMI)* closeCurly
| filterShortcut
;

exploreStatement
Expand Down
18 changes: 0 additions & 18 deletions packages/malloy/src/lang/malloy-to-ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,6 @@ export class MalloyToAST
);
}

protected getFilterShortcut(cx: parse.FilterShortcutContext): ast.Filter {
const el = this.getFilterElement(cx.fieldExpr());
this.m4advisory(
cx,
'filter-shortcut',
'Filter shortcut `{? condition }` is deprecated; use `{ where: condition } instead'
);
return new ast.Filter([el]);
}

protected getPlainStringFrom(cx: HasString): string {
const [result, errors] = getPlainString(cx);
for (const error of errors) {
Expand Down Expand Up @@ -442,16 +432,12 @@ export class MalloyToAST
}

visitExploreProperties(pcx: parse.ExplorePropertiesContext): ast.SourceDesc {
const filterCx = pcx.filterShortcut();
const visited = this.only<ast.SourceProperty>(
pcx.exploreStatement().map(ecx => this.visit(ecx)),
x => ast.isSourceProperty(x) && x,
'source property'
);
const propList = new ast.SourceDesc(visited);
if (filterCx) {
propList.push(this.getFilterShortcut(filterCx));
}
return propList;
}

Expand Down Expand Up @@ -804,10 +790,6 @@ export class MalloyToAST
x => ast.isQueryProperty(x) && x,
'query statement'
);
const fcx = pcx.filterShortcut();
if (fcx) {
qProps.push(this.getFilterShortcut(fcx));
}
return new ast.QOpDesc(qProps);
}

Expand Down
1 change: 0 additions & 1 deletion packages/malloy/src/lang/parse-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ type MessageParameterTypes = {
'foreign-key-in-join-cross': string;
'expression-type-error': string;
'unexpected-statement-in-translation': string;
'filter-shortcut': string;
'illegal-query-interpolation-outside-sql-block': string;
'percent-terminated-query-interpolation': string;
'failed-to-parse-time-literal': string;
Expand Down

0 comments on commit 8943574

Please sign in to comment.