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

comments should not change parser state #334

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
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