Skip to content

Commit

Permalink
[All] Allow comment inside descriptions (#334)
Browse files Browse the repository at this point in the history
Fixes: #333
  • Loading branch information
jacob-wieland-gematik authored Jan 23, 2025
1 parent 355ed13 commit 93339df
Show file tree
Hide file tree
Showing 21 changed files with 5,748 additions and 12,335 deletions.
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))
- [Python] Added support for Python 3.13
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

0 comments on commit 93339df

Please sign in to comment.