diff --git a/src/main/java/de/tla2b/output/ASTPrettyPrinter.java b/src/main/java/de/tla2b/output/ASTPrettyPrinter.java index 450e4cb0453b5472272d5873e015a50af041cc5e..5ad97b0e06348ea8a2ee6ff6a292f468332cca9b 100644 --- a/src/main/java/de/tla2b/output/ASTPrettyPrinter.java +++ b/src/main/java/de/tla2b/output/ASTPrettyPrinter.java @@ -685,15 +685,15 @@ public class ASTPrettyPrinter extends ExtendedDFAdapter { @Override public void caseAIfThenElseExpression(AIfThenElseExpression node) { - sb.append("(%t_.( t_ = 0 & "); + sb.append("IF "); // (%t_.( t_ = 0 & "); node.getCondition().apply(this); - sb.append(" | "); + sb.append(" THEN "); // | "); node.getThen().apply(this); - sb.append(")\\/%t_.( t_ = 0 & not("); - node.getCondition().apply(this); - sb.append(") | "); + sb.append(" ELSE "); // )\\/%t_.( t_ = 0 & not("); + //node.getCondition().apply(this); + //sb.append(") | "); node.getElse().apply(this); - sb.append(" ))(0)"); + sb.append(" END"); // "))(0)"); } @Override diff --git a/src/test/java/de/tla2b/expression/SimpleExpressionTest.java b/src/test/java/de/tla2b/expression/SimpleExpressionTest.java index a914b2bde4bc72a80324f7938f332794cf85c11d..391b8cda47a117a3d0e5fba55795a918f8f160bc 100644 --- a/src/test/java/de/tla2b/expression/SimpleExpressionTest.java +++ b/src/test/java/de/tla2b/expression/SimpleExpressionTest.java @@ -34,7 +34,7 @@ public class SimpleExpressionTest { @Test public void testIfThenElse() throws Exception { compareExpr( - "(%t_.( t_ = 0 & 1 = 1 | 1 )\\/%t_.( t_ = 0 & not(1 = 1) | 2 ))(0)", + "IF 1 = 1 THEN 1 ELSE 2 END", //"(%t_.( t_ = 0 & 1 = 1 | 1 )\\/%t_.( t_ = 0 & not(1 = 1) | 2 ))(0)", "IF 1 = 1 THEN 1 ELSE 2"); }