Community
Participate
Working Groups
Xtext Complete SDK: 2.9.0.v201509210904 Steps to reproduce - Create new domainmodel example projects - Open FormatterTest.xtend and add following new test method @Test def void example4() { assertFormatted[ toBeFormatted = ''' entity Foo { op x() { 1+1 > 0 } } ''' ] } Running the test you will get the assertion error org.junit.ComparisonFailure: expected:<...inaryOperation X[AdditiveExpression:{XBinaryOperation.leftOperand=} path:XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] B XNumberLiteral XAdditiveExpression:{XBinaryOperation.leftOperand=} path:XBinaryOperation/leftOperand=XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] 27 1 S "1" XNumberLiteral:value=Number E XNumberLiteral XAdditiveExpression:{XBinaryOperation.leftOperand=} path:XBinaryOperation/leftOperand=XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] 28 0 H 28 1 S "+" XAdditiveExpression:feature=[JvmIdentifiableElement|OpAdd] 29 0 H B XNumberLiteral XAdditiveExpression:rightOperand=XMultiplicativeExpression path:XBinaryOperation/rightOperand=XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] 29 1 S "1" XNumberLiteral:value=Number E XNumberLiteral XAdditiveExpression:rightOperand=XMultiplicativeExpression path:XBinaryOperation/rightOperand=XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] E XBinaryOperation XAdditive]Expression:{XBinaryO...> but was:<...inaryOperation X[RelationalExpression:{XBinaryOperation.leftOperand=} path:XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] B XNumberLiteral XAdditiveExpression:{XBinaryOperation.leftOperand=} path:XBinaryOperation/leftOperand=XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] 27 1 S "1" XNumberLiteral:value=Number E XNumberLiteral XAdditiveExpression:{XBinaryOperation.leftOperand=} path:XBinaryOperation/leftOperand=XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] 28 0 H 28 1 S "+" XAdditiveExpression:feature=[JvmIdentifiableElement|OpAdd] 29 0 H B XNumberLiteral XAdditiveExpression:rightOperand=XMultiplicativeExpression path:XBinaryOperation/rightOperand=XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] 29 1 S "1" XNumberLiteral:value=Number E XNumberLiteral XAdditiveExpression:rightOperand=XMultiplicativeExpression path:XBinaryOperation/rightOperand=XBinaryOperation/leftOperand=XBlockExpression/expressions[0]=Operation'x'/body=Entity'Foo'/features[0]=DomainModel/elements[0] E XBinaryOperation XRelational]Expression:{XBinaryO...> at org.junit.Assert.assertEquals(Assert.java:115) at org.junit.Assert.assertEquals(Assert.java:144) Extracting the sense out of it (first unmatched region): Expected: 23 4 H "\r\n\t\t" Whitespace:TerminalRule'WS' B XBinaryOperation XBlockExpression:expressions+=XExpressionOrVarDeclaration B XBinaryOperation XAdditiveExpression:{XBinaryOperation.leftOperand=} B XNumberLiteral XAdditiveExpression:{XBinaryOperation.leftOperand=} Got: 23 4 H "\r\n\t\t" Whitespace:TerminalRule'WS' B XBinaryOperation XBlockExpression:expressions+=XExpressionOrVarDeclaration B XBinaryOperation XRelationalExpression:{XBinaryOperation.leftOperand=} B XNumberLiteral XAdditiveExpression:{XBinaryOperation.leftOperand=} As you may notice, XRelationalExpression was substituted by XAdditiveExpression.