// a non-conditional expression for a FIELD_VALIDATOR treats the result
// as an equality comparison with the field in question. so, transform
// the expression accordingly
- expr = new ECompOp(CompOp.EQ, THIS_COL_VALUE, expr);
+ expr = new EImplicitCompOp(expr);
}
return (expr.isConstant() ?
}
}
+ private static class EImplicitCompOp extends ECompOp
+ {
+ private EImplicitCompOp(Expr right) {
+ super(CompOp.EQ, THIS_COL_VALUE, right);
+ }
+
+ @Override
+ protected void toExprString(StringBuilder sb, boolean isDebug) {
+ // only output the full "implicit" comparison in debug mode
+ if(isDebug) {
+ super.toExprString(sb, isDebug);
+ } else {
+ // just output the explicit part of the expression
+ _right.toString(sb, isDebug);
+ }
+ }
+ }
+
private static class ELogicalOp extends EBaseBinaryOp
{
private ELogicalOp(LogOp op, Expr left, Expr right) {
String cleanStr) {
Expression expr = Expressionator.parse(
Expressionator.Type.FIELD_VALIDATOR, exprStr, null);
- assertEquals(debugStr, expr.toDebugString());
+ String foundDebugStr = expr.toDebugString();
+ if(foundDebugStr.startsWith("<EImplicitCompOp>")) {
+ assertEquals("<EImplicitCompOp>{<EThisValue>{<THIS_COL>} = " +
+ debugStr + "}", foundDebugStr);
+ } else {
+ assertEquals(debugStr, foundDebugStr);
+ }
assertEquals(cleanStr, expr.toString());
}