Skip to content

Added support for multiple tag lines for features and scenarios #27

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 10 additions & 3 deletions lib/gherkin_ruby/parser/gherkin.y
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rule
Feature
Scenarios { result = val[0]; result.scenarios = val[1] }
| FeatureTags Feature { result = val[1]; result.tags = val[0] }
| FeatureTags Feature
| FeatureTags Feature
Scenarios { result = val[1]; result.scenarios = val[2]; result.tags = val[0] }
;

Expand All @@ -29,6 +29,8 @@ rule
FeatureTags:
Tags { result = val[0] }
| Newline Tags { result = val[1] }
| FeatureTags Newline Tags { result += val[2] }
;

Feature:
FeatureHeader { result = val[0] }
Expand Down Expand Up @@ -84,9 +86,14 @@ rule
Scenario:
SCENARIO TEXT Newline
Steps { result = AST::Scenario.new(val[1], val[3]); result.pos(filename, lineno - 1) }
| Tags Newline
| ScenarioTags
SCENARIO TEXT Newline
Steps { result = AST::Scenario.new(val[3], val[5], val[0]); result.pos(filename, lineno - 2) }
Steps { result = AST::Scenario.new(val[2], val[4], val[0]); result.pos(filename, lineno - 2) }
;

ScenarioTags:
Tags Newline { result = val[0] }
| Tags Newline ScenarioTags { result += val[2] }
;

Tags:
Expand Down
Loading