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

Allow comment inside descriptions #334

Merged
merged 18 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt

## [Unreleased]
### Added
- [All] Allow comment inside descriptions ([#334](https://github.com/cucumber/gherkin/pull/334))
- [.NET] Enabled overriding of parser's error-handling
- [Python] Expose Python public API as package imports ([#352](https://github.com/cucumber/gherkin/pull/352))

Expand Down
8 changes: 4 additions & 4 deletions c/gherkin.berp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DocString! := #DocStringSeparator #Other* #DocStringSeparator

Tags! := #TagLine+

// we need to explicitly mention comment, to avoid merging it into the description line's #Other token
// we also eat the leading empty lines, the tailing lines are not removed by the parser to avoid lookahead, this has to be done by the AST builder
DescriptionHelper := #Empty* Description? #Comment*
Description! := #Other+
// descriptions should be allowed to be interspersed with comments
// if only comments are encountered, the description text will be empty
DescriptionHelper := #Empty* Description?
Description! := (#Other | #Comment)+
4 changes: 2 additions & 2 deletions c/include/rule_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ typedef enum RuleType {
Rule_DataTable, /* DataTable! := #TableRow+ */
Rule_DocString, /* DocString! := #DocStringSeparator #Other* #DocStringSeparator */
Rule_Tags, /* Tags! := #TagLine+ */
Rule_DescriptionHelper, /* DescriptionHelper := #Empty* Description? #Comment* */
Rule_Description, /* Description! := #Other+ */
Rule_DescriptionHelper, /* DescriptionHelper := #Empty* Description? */
Rule_Description, /* Description! := (#Other | #Comment)+ */
Rule_Count
} RuleType;

Expand Down
Loading
Loading