Skip to content
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