auto-sync
This commit is contained in:
parent
b644e52379
commit
047fdb72f3
|
@ -59,6 +59,7 @@ public class BracerParserTest {
|
|||
assertParse("2 1 >", "2 > 1");
|
||||
assertParse("rpm 0 >", "rpm > false");
|
||||
assertParse("rpm 0 >", "(rpm > false)");
|
||||
assertParse("rpm user0 > clt user2 > |", "(rpm > user0) or (clt > user2)");
|
||||
assertParse("rpm user0 > clt user2 > | vbatt user1 > |", "(rpm > user0) or (clt > user2) or (vbatt > user1)");
|
||||
}
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ public abstract class AbstractEvaluator<T> {
|
|||
if (sc.isOperator()
|
||||
&& ((token.getAssociativity().equals(Operator.Associativity.LEFT) && (token.getPrecedence() <= sc.getPrecedence())) ||
|
||||
(token.getPrecedence() < sc.getPrecedence()))) {
|
||||
stackRPN.push(sc.getLiteral());
|
||||
stackRPN.push(sc.getOperator().getRpnSymbol());
|
||||
// Pop o2 off the stack, onto the output queue;
|
||||
output(values, stack.pop(), evaluationContext);
|
||||
} else {
|
||||
|
|
|
@ -13,7 +13,8 @@ public class ParserTest {
|
|||
assertParse("2 1 >", "2 > 1");
|
||||
assertParse("rpm 0 >", "rpm > false");
|
||||
assertParse("rpm 0 >", "(rpm > false)");
|
||||
// assertParse("rpm user0 > clt user2 > | vbatt user1 > |", "(rpm > user0) or (clt > user2) or (vbatt > user1)");
|
||||
assertParse("rpm user0 > clt user2 > |", "(rpm > user0) or (clt > user2)");
|
||||
//todo assertParse("rpm user0 > clt user2 > | vbatt user1 > |", "(rpm > user0) or (clt > user2) or (vbatt > user1)");
|
||||
}
|
||||
|
||||
private void assertParse(String rpn, String expression) {
|
||||
|
|
Loading…
Reference in New Issue