Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new-parser] Unify error reporting of DRLParser and DRL6Expressions #5959

Open
yurloc opened this issue May 17, 2024 · 0 comments
Open

[new-parser] Unify error reporting of DRLParser and DRL6Expressions #5959

yurloc opened this issue May 17, 2024 · 0 comments

Comments

@yurloc
Copy link
Contributor

yurloc commented May 17, 2024

DRL6Expressions is a bit ahead of DRLParser so I take that as a benchmark.

Impl

The code that registers error listeners is very different for both parsers. It could be unified and reused.

API

Contents of parser.getErrors() should be unified.

DRL6Expressions

org.drools.drl.parser.DroolsParserException: [ERR 102] Line 1:1 mismatched input '<EOF>' expecting {...}

DRLParser

org.drools.drl.parser.ParserError: [18,0]: mismatched input 'impot' expecting {...}

So while the problem occurs during parsing (mismatched input), parsers report different exception types with slightly different messages. This should be unified.

Tests

  • DRL6Expressions has error reporting test coverage in org.drools.drl.parser.antlr4.DRLExprParserTest#testMismatchedInput and other test methods.
  • DRLParser should receive equal test coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant