DrlParser parser = new DrlParser(LanguageLevelOption.DRL5);
PackageDescr descr = parser.parse(true, input);
parse(true, means that it's in Editor mode. When Editor mode:
parser method returns non-null PackageDescr even in case of parse error
parser provides information for Editor through parser.getEditorSentences(). e.g. the current position is at Location.LOCATION_RHS
Here "Editor" means Eclipse plugin and web workbench, which had already retired in Drools 8.
The next DRL Editor aims at LSP based ones. So I think there is no reason to implement the Editor mode and pass DRLIncompleteCodeTest. Implementing the Editor mode may not be a large effort, but it would pollute DRLVisitorImpl code.
Error output
DRLIncompleteCodeTest#testIncompleteCode3
java.lang.NullPointerException: Cannot invoke "java.util.List.get(int)" because the return value of "org.drools.drl.parser.DrlParser.getEditorSentences()" is null
at org.drools.mvel.compiler.lang.DRLIncompleteCodeTest.testIncompleteCode3(DRLIncompleteCodeTest.java:88)
Parent issue
5678
Failing tests
org.drools.mvel.compiler.lang.DRLIncompleteCodeTest
Rule code snippet
parse(true,
means that it's in Editor mode. When Editor mode:parser
method returns non-null PackageDescr even in case of parse errorparser.getEditorSentences()
. e.g. the current position is atLocation.LOCATION_RHS
Here "Editor" means Eclipse plugin and web workbench, which had already retired in Drools 8.
The next DRL Editor aims at LSP based ones. So I think there is no reason to implement the Editor mode and pass
DRLIncompleteCodeTest
. Implementing the Editor mode may not be a large effort, but it would polluteDRLVisitorImpl
code.Error output
DRLIncompleteCodeTest#testIncompleteCode3