gherkin icon indicating copy to clipboard operation
gherkin copied to clipboard

Maximum parse errors that the parser will output

Open ciaranmcnulty opened this issue 3 years ago • 3 comments

Currently both Java and PHP cap the number of errors at 11 (this maybe was meant to be 10 but I copied Java!) I imagine some others do to?

This is not really reflected in the testdata - I think we should have a document in there with ~20 errors and some pickle parseErrors showing it's capped off

OR we should remove the (arbitrary?) cap...

ciaranmcnulty avatar Nov 11 '22 15:11 ciaranmcnulty

The cap is there for human interaction reasons.

Once you've got more then a few parse errors it is likely that only the first few are actual problems, the others are false errors caused by the previous incorrect syntax.

For example, imagine a feature file with 20 scenarios, but missing the Feature keyword. Every line would have a parse error.

Some parsers are smart enough to make assumptions and somehow guess the intended structure, Berp unfortunately is not.

So to keep the user from being overwhelmed we are limited to limiting the parse errors shown.

mpkorstanje avatar Nov 11 '22 17:11 mpkorstanje

Ok I'll canonicalise it in a testdata feature

is 11 the right number? :)

ciaranmcnulty avatar Nov 11 '22 17:11 ciaranmcnulty

I guess, it's a prime. So it's not an ugly number. 😆

mpkorstanje avatar Nov 11 '22 19:11 mpkorstanje