apache / incubator-kie-drools

Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
http://www.drools.org
5.85k stars 2.49k forks source link

[new-parser] Parser should expect the final EOF, otherwise it can stop prematurely and report no error #5929

Closed yurloc closed 4 months ago

yurloc commented 4 months ago

Parent issue

Failing tests

Notes

For example, if there is a typo in the import keyword (or any other keyword that starts a DRL statement, such as rule or global), the parser cannot match a drlStatement and it bails out gracefully, ignoring the rest of the input and reporting no error.

Rule code snippet

package org.drools.compiler.test;

impot org.drools.compiler.test.model.Cheese;

rule "eval rule test" ...

Error output

No error.

yurloc commented 4 months ago

/take