antlr / antlr4test-maven-plugin

A maven plugin used to test the grammars-v4 repo grammars
BSD 3-Clause "New" or "Revised" License
17 stars 16 forks source link

Reuse lexer and parser between tests #84

Open ris58h opened 1 year ago

ris58h commented 1 year ago

Both Lexer and Parser have setInputStream method so they can be reused. We could add an option to reuse them between tests of the same grammar to make sure it works properly.

KvanTTT commented 1 year ago

I'm not sure if it makes big sense because I suspect it almost doesn't affect performance.

ris58h commented 1 year ago

It's not about performance but verification. I had an issue with JavaScript lexer that affected my project. Reusing lexer and parser will allow us to test such case.