tkobayas commented on code in PR #5855:
URL:
https://github.com/apache/incubator-kie-drools/pull/5855#discussion_r1573638340
##########
drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/DRLExprParserTest.java:
##########
@@ -387,13 +389,26 @@ public void testMismatchedInput() {
assertThat(parser.hasErrors()).isTrue();
assertThat(parser.getErrors()).hasSize(1);
DroolsParserException exception = parser.getErrors().get(0);
- assertThat(exception.getErrorCode()).isEqualTo("ERR 102");
- assertThat(exception.getLineNumber()).isEqualTo(1);
- assertThat(exception.getColumn()).isEqualTo(1);
- assertThat(exception.getOffset()).isEqualTo(1);
- assertThat(exception.getMessage())
- .startsWithIgnoringCase("[ERR 102] Line 1:1 mismatched input
'<EOF>' expecting ")
- .contains("TIME_INTERVAL", "DRL_STRING_LITERAL", "?/",
"boolean", "byte", "char", "double", "float", "int", "long", "new", "short",
"super", "DECIMAL_LITERAL", "HEX_LITERAL", "FLOAT_LITERAL", "BOOL_LITERAL",
"STRING_LITERAL", "null", "(", "[", ".", "<", "!", "~", "++", "--", "+", "-",
"*", "/", "IDENTIFIER");
+
+ // Backward Compatibility Notes:
+ // Antlr4 gives a different error code/message from antlr3 for this
case.
+ // Backward compatibility doesn't seem to be required in this case.
Review Comment:
I leave `Backward Compatibility Notes` when test results are different
between old and new parser. We can categorize the cases into:
A) The difference comes from Antrl3 and 4, so we cannot change.
B) Old parser seems to be wrong and if we mimic the old behaviour, it would
get unnecessarily complex. -> but, of course, we can discuss and look for
compromise.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]