Add explicit EOF and use assert instead of exception (#11041)

This commit is contained in:
Jihoon Son 2021-03-31 09:41:57 -07:00 committed by GitHub
parent 6789ed0a05
commit 43ea184b74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,8 @@
grammar Expr; grammar Expr;
start : expr EOF;
expr : NULL # null expr : NULL # null
| ('-'|'!') expr # unaryOpExpr | ('-'|'!') expr # unaryOpExpr
|<assoc=right> expr '^' expr # powOpExpr |<assoc=right> expr '^' expr # powOpExpr

View File

@ -36,7 +36,8 @@ public abstract class BottomUpTransform implements Function<Filtration, Filtrati
private DimFilter checkedProcess(final DimFilter filter) private DimFilter checkedProcess(final DimFilter filter)
{ {
final DimFilter retVal = process(Preconditions.checkNotNull(filter, "filter")); final DimFilter retVal = process(Preconditions.checkNotNull(filter, "filter"));
return Preconditions.checkNotNull(retVal, "process(filter) result in %s", getClass().getSimpleName()); assert retVal != null;
return retVal;
} }
@Override @Override