Gherkin icon indicating copy to clipboard operation
Gherkin copied to clipboard

Comments before description is not parsed the same than in cucumber

Open stof opened this issue 7 months ago • 4 comments

cucumber/gherkin currently fails when using a comment the description. This has been reported as https://github.com/cucumber/gherkin/issues/16 as many people find this behavior undesirable.

Our parser currently supports such comments, which would break parsing of files using such comment if we migrate to the upstream parser (this has been identified in #253)

stof avatar May 21 '25 11:05 stof

The best way to solve this parity issue is probably to attempt fixing the issue in cucumber before we migrate instead of adding the parse error in our implementation.

stof avatar May 21 '25 11:05 stof

We should add a temporary test running a subset of the upstream descriptions_with_comments.feature, with descriptions only for nodes on which we support them (currently, it is skipped because we don't support descriptions on example tables, not because we don't support comments)

stof avatar May 26 '25 16:05 stof

I can take a look, I have started work on supporting descriptions on all the node types that can have them, which may mean we can just use the upstream feature?

acoulton avatar May 26 '25 16:05 acoulton

that would indeed unblock it.

stof avatar May 26 '25 16:05 stof

This was resolved in upstream cucumber/gherkin (which now allows comments in / before descriptions) and is also handled by us as part of #361 (we are passing the parity test on their descriptions_with_comments.feature when running in gherkin-32 compatibility mode).

acoulton avatar Nov 24 '25 23:11 acoulton