// incorrect). note, we only need to check precedence against "this",
// as all other precedence has been resolved in previous parsing
// rounds.
- if((leftOp._right == this) && isHigherPrecendence(leftOp._op, _op)) {
+ if((leftOp._right == this) && !isHigherPrecendence(_op, leftOp._op)) {
- // FIXME, need to move up if precedecne is the same!
-
- // doh, "this" is lower precedence, restore the original order of
- // things
+ // doh, "this" is lower (or the same) precedence, restore the
+ // original order of things
leftOp._right = _left;
_left = leftOp;
outerExpr = this;
Expressionator.Type.FIELD_VALIDATOR, "\"A\" Eqv \"B\" Xor \"C\" Or \"D\" And \"E\"", null);
assertEquals("<ELogicalOp>{<ELiteralValue>{\"A\"} Eqv <ELogicalOp>{<ELiteralValue>{\"B\"} Xor <ELogicalOp>{<ELiteralValue>{\"C\"} Or <ELogicalOp>{<ELiteralValue>{\"D\"} And <ELiteralValue>{\"E\"}}}}}",
expr.toDebugString());
+
+ expr = Expressionator.parse(
+ Expressionator.Type.FIELD_VALIDATOR, "\"A\" Or \"B\" Or \"C\"", null);
+ assertEquals("<ELogicalOp>{<ELogicalOp>{<ELiteralValue>{\"A\"} Or <ELiteralValue>{\"B\"}} Or <ELiteralValue>{\"C\"}}",
+ expr.toDebugString());
+
+
}
}