From 8f3920bc526eaa815c2ab7e556b1b2a96dc00ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Fri, 15 Jun 2018 19:56:30 +0100 Subject: [PATCH 1/3] gherkin: (Java) Add support for Rule --- gherkin/java/gherkin.berp | 7 +- .../src/main/java/gherkin/AstBuilder.java | 21 +- .../src/main/java/gherkin/GherkinDialect.java | 6 + .../java/src/main/java/gherkin/Parser.java | 2339 ++++++++++++++++- .../src/main/java/gherkin/TokenMatcher.java | 5 + .../src/main/java/gherkin/ast/Feature.java | 7 +- .../java/src/main/java/gherkin/ast/Node.java | 6 + .../java/src/main/java/gherkin/ast/Rule.java | 40 + .../main/java/gherkin/ast/StepsContainer.java | 3 +- .../main/java/gherkin/pickles/Compiler.java | 31 +- .../src/test/java/gherkin/AstBuilderTest.java | 30 + ...ltiple_parser_errors.feature.errors.ndjson | 2 +- gherkin/java/testdata/good/rule.feature | 13 + .../testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + .../java/testdata/good/rule.feature.tokens | 14 + 17 files changed, 2380 insertions(+), 148 deletions(-) create mode 100644 gherkin/java/src/main/java/gherkin/ast/Rule.java create mode 100644 gherkin/java/testdata/good/rule.feature create mode 100644 gherkin/java/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/java/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/java/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/java/testdata/good/rule.feature.tokens diff --git a/gherkin/java/gherkin.berp b/gherkin/java/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/java/gherkin.berp +++ b/gherkin/java/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/java/src/main/java/gherkin/AstBuilder.java b/gherkin/java/src/main/java/gherkin/AstBuilder.java index dbc7e609e91..18260df26c9 100644 --- a/gherkin/java/src/main/java/gherkin/AstBuilder.java +++ b/gherkin/java/src/main/java/gherkin/AstBuilder.java @@ -9,6 +9,7 @@ import gherkin.ast.GherkinDocument; import gherkin.ast.Location; import gherkin.ast.Node; +import gherkin.ast.Rule; import gherkin.ast.Scenario; import gherkin.ast.Step; import gherkin.ast.StepsContainer; @@ -146,15 +147,27 @@ public String toString(Token t) { List tags = getTags(header); Token featureLine = header.getToken(TokenType.FeatureLine); if (featureLine == null) return null; - List scenarioDefinitions = new ArrayList<>(); + List featureChildren = new ArrayList<>(); Background background = node.getSingle(RuleType.Background, null); - if (background != null) scenarioDefinitions.add(background); - scenarioDefinitions.addAll(node.getItems(RuleType.ScenarioDefinition)); + if (background != null) featureChildren.add(background); + featureChildren.addAll(node.getItems(RuleType.ScenarioDefinition)); + featureChildren.addAll(node.getItems(RuleType.Rule)); String description = getDescription(header); if (featureLine.matchedGherkinDialect == null) return null; String language = featureLine.matchedGherkinDialect.getLanguage(); - return new Feature(tags, getLocation(featureLine, 0), language, featureLine.matchedKeyword, featureLine.matchedText, description, scenarioDefinitions); + return new Feature(tags, getLocation(featureLine, 0), language, featureLine.matchedKeyword, featureLine.matchedText, description, featureChildren); + } + case Rule: { + AstNode header = node.getSingle(RuleType.RuleHeader, new AstNode(RuleType.RuleHeader)); + if (header == null) return null; + Token ruleLine = header.getToken(TokenType.RuleLine); + if (ruleLine == null) return null; + String description = getDescription(node); + List ruleChildren = new ArrayList<>(); + List stepsContainers = node.getItems(RuleType.ScenarioDefinition); + ruleChildren.addAll(stepsContainers); + return new Rule(getLocation(ruleLine, 0), ruleLine.matchedKeyword, ruleLine.matchedText, description, ruleChildren); } case GherkinDocument: { Feature feature = node.getSingle(RuleType.Feature, null); diff --git a/gherkin/java/src/main/java/gherkin/GherkinDialect.java b/gherkin/java/src/main/java/gherkin/GherkinDialect.java index 5d6187cbf82..4923a5c3094 100644 --- a/gherkin/java/src/main/java/gherkin/GherkinDialect.java +++ b/gherkin/java/src/main/java/gherkin/GherkinDialect.java @@ -4,6 +4,8 @@ import java.util.List; import java.util.Map; +import static java.util.Collections.singletonList; + public class GherkinDialect { private final Map> keywords; private String language; @@ -63,6 +65,10 @@ public List getButKeywords() { return keywords.get("but"); } + public List getRuleKeywords() { + return singletonList("Rule"); + } + public String getLanguage() { return language; } diff --git a/gherkin/java/src/main/java/gherkin/Parser.java b/gherkin/java/src/main/java/gherkin/Parser.java index 7d0f446b0a0..4fbe902be29 100644 --- a/gherkin/java/src/main/java/gherkin/Parser.java +++ b/gherkin/java/src/main/java/gherkin/Parser.java @@ -24,6 +24,7 @@ public enum TokenType { Comment, TagLine, FeatureLine, + RuleLine, BackgroundLine, ScenarioLine, ExamplesLine, @@ -42,6 +43,7 @@ public enum RuleType { _Comment, // #Comment _TagLine, // #TagLine _FeatureLine, // #FeatureLine + _RuleLine, // #RuleLine _BackgroundLine, // #BackgroundLine _ScenarioLine, // #ScenarioLine _ExamplesLine, // #ExamplesLine @@ -51,8 +53,10 @@ public enum RuleType { _Language, // #Language _Other, // #Other GherkinDocument, // GherkinDocument! := Feature? - Feature, // Feature! := FeatureHeader Background? ScenarioDefinition* + Feature, // Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader, // FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper + Rule, // Rule! := RuleHeader Background? ScenarioDefinition* + RuleHeader, // RuleHeader! := #RuleLine DescriptionHelper Background, // Background! := #BackgroundLine DescriptionHelper Step* ScenarioDefinition, // ScenarioDefinition! := Tags? Scenario Scenario, // Scenario! := #ScenarioLine DescriptionHelper Step* ExamplesDefinition* @@ -246,6 +250,15 @@ public Boolean call() { }, false); } + private boolean match_RuleLine(final ParserContext context, final Token token) { + if (token.isEOF()) return false; + return handleExternalError(context, new Func() { + public Boolean call() { + return context.tokenMatcher.match_RuleLine(token); + } + }, false); + } + private boolean match_BackgroundLine(final ParserContext context, final Token token) { if (token.isEOF()) return false; return handleExternalError(context, new Func() { @@ -387,6 +400,9 @@ private int matchToken(int state, Token token, ParserContext context) { case 21: newState = matchTokenAt_21(token, context); break; + case 22: + newState = matchTokenAt_22(token, context); + break; case 23: newState = matchTokenAt_23(token, context); break; @@ -399,6 +415,72 @@ private int matchToken(int state, Token token, ParserContext context) { case 26: newState = matchTokenAt_26(token, context); break; + case 27: + newState = matchTokenAt_27(token, context); + break; + case 28: + newState = matchTokenAt_28(token, context); + break; + case 29: + newState = matchTokenAt_29(token, context); + break; + case 30: + newState = matchTokenAt_30(token, context); + break; + case 31: + newState = matchTokenAt_31(token, context); + break; + case 32: + newState = matchTokenAt_32(token, context); + break; + case 33: + newState = matchTokenAt_33(token, context); + break; + case 34: + newState = matchTokenAt_34(token, context); + break; + case 35: + newState = matchTokenAt_35(token, context); + break; + case 36: + newState = matchTokenAt_36(token, context); + break; + case 37: + newState = matchTokenAt_37(token, context); + break; + case 38: + newState = matchTokenAt_38(token, context); + break; + case 39: + newState = matchTokenAt_39(token, context); + break; + case 40: + newState = matchTokenAt_40(token, context); + break; + case 42: + newState = matchTokenAt_42(token, context); + break; + case 43: + newState = matchTokenAt_43(token, context); + break; + case 44: + newState = matchTokenAt_44(token, context); + break; + case 45: + newState = matchTokenAt_45(token, context); + break; + case 46: + newState = matchTokenAt_46(token, context); + break; + case 47: + newState = matchTokenAt_47(token, context); + break; + case 48: + newState = matchTokenAt_48(token, context); + break; + case 49: + newState = matchTokenAt_49(token, context); + break; default: throw new IllegalStateException("Unknown state: " + state); } @@ -411,7 +493,7 @@ private int matchTokenAt_0(Token token, ParserContext context) { if (match_EOF(context, token)) { build(context, token); - return 22; + return 41; } if (match_Language(context, token)) { @@ -546,7 +628,7 @@ private int matchTokenAt_3(Token token, ParserContext context) { endRule(context, RuleType.FeatureHeader); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Empty(context, token)) { @@ -581,6 +663,14 @@ private int matchTokenAt_3(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.FeatureHeader); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Other(context, token)) { startRule(context, RuleType.Description); @@ -590,7 +680,7 @@ private int matchTokenAt_3(Token token, ParserContext context) { final String stateComment = "State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"); + List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -611,7 +701,7 @@ private int matchTokenAt_4(Token token, ParserContext context) { endRule(context, RuleType.FeatureHeader); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Comment(context, token)) { @@ -645,6 +735,15 @@ private int matchTokenAt_4(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.FeatureHeader); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Other(context, token)) { build(context, token); @@ -653,7 +752,7 @@ private int matchTokenAt_4(Token token, ParserContext context) { final String stateComment = "State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"); + List expectedTokens = asList("#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -673,7 +772,7 @@ private int matchTokenAt_5(Token token, ParserContext context) { endRule(context, RuleType.FeatureHeader); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Comment(context, token)) { @@ -703,6 +802,14 @@ private int matchTokenAt_5(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.FeatureHeader); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Empty(context, token)) { build(context, token); @@ -711,7 +818,7 @@ private int matchTokenAt_5(Token token, ParserContext context) { final String stateComment = "State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Empty"); + List expectedTokens = asList("#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -731,7 +838,7 @@ private int matchTokenAt_6(Token token, ParserContext context) { endRule(context, RuleType.Background); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Empty(context, token)) { @@ -765,6 +872,14 @@ private int matchTokenAt_6(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Background); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Other(context, token)) { startRule(context, RuleType.Description); @@ -774,7 +889,7 @@ private int matchTokenAt_6(Token token, ParserContext context) { final String stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"); + List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -795,7 +910,7 @@ private int matchTokenAt_7(Token token, ParserContext context) { endRule(context, RuleType.Background); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Comment(context, token)) { @@ -828,6 +943,15 @@ private int matchTokenAt_7(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Background); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Other(context, token)) { build(context, token); @@ -836,7 +960,7 @@ private int matchTokenAt_7(Token token, ParserContext context) { final String stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"); + List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -856,7 +980,7 @@ private int matchTokenAt_8(Token token, ParserContext context) { endRule(context, RuleType.Background); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Comment(context, token)) { @@ -885,6 +1009,14 @@ private int matchTokenAt_8(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Background); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Empty(context, token)) { build(context, token); @@ -893,7 +1025,7 @@ private int matchTokenAt_8(Token token, ParserContext context) { final String stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Empty"); + List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -914,7 +1046,7 @@ private int matchTokenAt_9(Token token, ParserContext context) { endRule(context, RuleType.Background); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_TableRow(context, token)) { @@ -926,7 +1058,7 @@ private int matchTokenAt_9(Token token, ParserContext context) { { startRule(context, RuleType.DocString); build(context, token); - return 25; + return 48; } if (match_StepLine(context, token)) { @@ -953,6 +1085,15 @@ private int matchTokenAt_9(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Comment(context, token)) { build(context, token); @@ -966,7 +1107,7 @@ private int matchTokenAt_9(Token token, ParserContext context) { final String stateComment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0"; token.detach(); - List expectedTokens = asList("#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"); + List expectedTokens = asList("#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -988,7 +1129,7 @@ private int matchTokenAt_10(Token token, ParserContext context) { endRule(context, RuleType.Background); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_TableRow(context, token)) { @@ -1023,6 +1164,16 @@ private int matchTokenAt_10(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Comment(context, token)) { build(context, token); @@ -1036,7 +1187,7 @@ private int matchTokenAt_10(Token token, ParserContext context) { final String stateComment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; token.detach(); - List expectedTokens = asList("#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"); + List expectedTokens = asList("#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1097,7 +1248,7 @@ private int matchTokenAt_12(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Empty(context, token)) { @@ -1150,6 +1301,15 @@ private int matchTokenAt_12(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Other(context, token)) { startRule(context, RuleType.Description); @@ -1159,7 +1319,7 @@ private int matchTokenAt_12(Token token, ParserContext context) { final String stateComment = "State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"); + List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1181,7 +1341,7 @@ private int matchTokenAt_13(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Comment(context, token)) { @@ -1235,6 +1395,16 @@ private int matchTokenAt_13(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Other(context, token)) { build(context, token); @@ -1243,7 +1413,7 @@ private int matchTokenAt_13(Token token, ParserContext context) { final String stateComment = "State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"); + List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1264,7 +1434,7 @@ private int matchTokenAt_14(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Comment(context, token)) { @@ -1312,6 +1482,15 @@ private int matchTokenAt_14(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Empty(context, token)) { build(context, token); @@ -1320,7 +1499,7 @@ private int matchTokenAt_14(Token token, ParserContext context) { final String stateComment = "State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"); + List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1342,7 +1521,7 @@ private int matchTokenAt_15(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_TableRow(context, token)) { @@ -1354,7 +1533,7 @@ private int matchTokenAt_15(Token token, ParserContext context) { { startRule(context, RuleType.DocString); build(context, token); - return 23; + return 46; } if (match_StepLine(context, token)) { @@ -1402,6 +1581,16 @@ private int matchTokenAt_15(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Comment(context, token)) { build(context, token); @@ -1415,7 +1604,7 @@ private int matchTokenAt_15(Token token, ParserContext context) { final String stateComment = "State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0"; token.detach(); - List expectedTokens = asList("#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"); + List expectedTokens = asList("#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1438,7 +1627,7 @@ private int matchTokenAt_16(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_TableRow(context, token)) { @@ -1496,6 +1685,17 @@ private int matchTokenAt_16(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Comment(context, token)) { build(context, token); @@ -1509,7 +1709,7 @@ private int matchTokenAt_16(Token token, ParserContext context) { final String stateComment = "State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; token.detach(); - List expectedTokens = asList("#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"); + List expectedTokens = asList("#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1572,7 +1772,7 @@ private int matchTokenAt_18(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Empty(context, token)) { @@ -1633,6 +1833,17 @@ private int matchTokenAt_18(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Other(context, token)) { startRule(context, RuleType.Description); @@ -1642,7 +1853,7 @@ private int matchTokenAt_18(Token token, ParserContext context) { final String stateComment = "State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"); + List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1666,7 +1877,7 @@ private int matchTokenAt_19(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Comment(context, token)) { @@ -1728,6 +1939,18 @@ private int matchTokenAt_19(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Other(context, token)) { build(context, token); @@ -1736,7 +1959,7 @@ private int matchTokenAt_19(Token token, ParserContext context) { final String stateComment = "State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"); + List expectedTokens = asList("#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1759,7 +1982,7 @@ private int matchTokenAt_20(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_Comment(context, token)) { @@ -1815,6 +2038,17 @@ private int matchTokenAt_20(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Empty(context, token)) { build(context, token); @@ -1823,7 +2057,7 @@ private int matchTokenAt_20(Token token, ParserContext context) { final String stateComment = "State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0"; token.detach(); - List expectedTokens = asList("#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"); + List expectedTokens = asList("#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1847,7 +2081,7 @@ private int matchTokenAt_21(Token token, ParserContext context) { endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); - return 22; + return 41; } if (match_TableRow(context, token)) { @@ -1901,6 +2135,18 @@ private int matchTokenAt_21(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.ExamplesTable); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Comment(context, token)) { build(context, token); @@ -1914,7 +2160,7 @@ private int matchTokenAt_21(Token token, ParserContext context) { final String stateComment = "State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0"; token.detach(); - List expectedTokens = asList("#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"); + List expectedTokens = asList("#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -1927,111 +2173,68 @@ private int matchTokenAt_21(Token token, ParserContext context) { } - // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - private int matchTokenAt_23(Token token, ParserContext context) { - if (match_DocStringSeparator(context, token)) - { - build(context, token); - return 24; - } - if (match_Other(context, token)) + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0 + private int matchTokenAt_22(Token token, ParserContext context) { + if (match_EOF(context, token)) { + endRule(context, RuleType.RuleHeader); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); build(context, token); - return 23; + return 41; } - - final String stateComment = "State: 23 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; - token.detach(); - List expectedTokens = asList("#DocStringSeparator", "#Other"); - ParserException error = token.isEOF() - ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) - : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); - if (stopAtFirstError) - throw error; - - addError(context, error); - return 23; - - } - - - // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - private int matchTokenAt_24(Token token, ParserContext context) { - if (match_EOF(context, token)) + if (match_Empty(context, token)) { - endRule(context, RuleType.DocString); - endRule(context, RuleType.Step); - endRule(context, RuleType.Scenario); - endRule(context, RuleType.ScenarioDefinition); - endRule(context, RuleType.Feature); build(context, token); return 22; } - if (match_StepLine(context, token)) + if (match_Comment(context, token)) { - endRule(context, RuleType.DocString); - endRule(context, RuleType.Step); - startRule(context, RuleType.Step); build(context, token); - return 15; + return 24; } - if (match_TagLine(context, token)) + if (match_BackgroundLine(context, token)) { - if (lookahead_0(context, token)) - { - endRule(context, RuleType.DocString); - endRule(context, RuleType.Step); - startRule(context, RuleType.ExamplesDefinition); - startRule(context, RuleType.Tags); + endRule(context, RuleType.RuleHeader); + startRule(context, RuleType.Background); build(context, token); - return 17; - } + return 25; } if (match_TagLine(context, token)) { - endRule(context, RuleType.DocString); - endRule(context, RuleType.Step); - endRule(context, RuleType.Scenario); - endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.RuleHeader); startRule(context, RuleType.ScenarioDefinition); startRule(context, RuleType.Tags); build(context, token); - return 11; - } - if (match_ExamplesLine(context, token)) - { - endRule(context, RuleType.DocString); - endRule(context, RuleType.Step); - startRule(context, RuleType.ExamplesDefinition); - startRule(context, RuleType.Examples); - build(context, token); - return 18; + return 30; } if (match_ScenarioLine(context, token)) { - endRule(context, RuleType.DocString); - endRule(context, RuleType.Step); - endRule(context, RuleType.Scenario); - endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.RuleHeader); startRule(context, RuleType.ScenarioDefinition); startRule(context, RuleType.Scenario); build(context, token); - return 12; + return 31; } - if (match_Comment(context, token)) + if (match_RuleLine(context, token)) { + endRule(context, RuleType.RuleHeader); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); build(context, token); - return 24; + return 22; } - if (match_Empty(context, token)) + if (match_Other(context, token)) { + startRule(context, RuleType.Description); build(context, token); - return 24; + return 23; } - final String stateComment = "State: 24 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + final String stateComment = "State: 22 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0"; token.detach(); - List expectedTokens = asList("#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"); + List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -2039,25 +2242,1667 @@ private int matchTokenAt_24(Token token, ParserContext context) { throw error; addError(context, error); - return 24; + return 22; } - // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - private int matchTokenAt_25(Token token, ParserContext context) { - if (match_DocStringSeparator(context, token)) + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0 + private int matchTokenAt_23(Token token, ParserContext context) { + if (match_EOF(context, token)) { + endRule(context, RuleType.Description); + endRule(context, RuleType.RuleHeader); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); build(context, token); - return 26; + return 41; } - if (match_Other(context, token)) + if (match_Comment(context, token)) + { + endRule(context, RuleType.Description); + build(context, token); + return 24; + } + if (match_BackgroundLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.RuleHeader); + startRule(context, RuleType.Background); + build(context, token); + return 25; + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.RuleHeader); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.RuleHeader); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.RuleHeader); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Other(context, token)) + { + build(context, token); + return 23; + } + + final String stateComment = "State: 23 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 23; + + } + + + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0 + private int matchTokenAt_24(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.RuleHeader); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Comment(context, token)) + { + build(context, token); + return 24; + } + if (match_BackgroundLine(context, token)) + { + endRule(context, RuleType.RuleHeader); + startRule(context, RuleType.Background); + build(context, token); + return 25; + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.RuleHeader); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.RuleHeader); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.RuleHeader); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Empty(context, token)) + { + build(context, token); + return 24; + } + + final String stateComment = "State: 24 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 24; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0 + private int matchTokenAt_25(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Empty(context, token)) { build(context, token); return 25; } + if (match_Comment(context, token)) + { + build(context, token); + return 27; + } + if (match_StepLine(context, token)) + { + startRule(context, RuleType.Step); + build(context, token); + return 28; + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Other(context, token)) + { + startRule(context, RuleType.Description); + build(context, token); + return 26; + } + + final String stateComment = "State: 25 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 25; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0 + private int matchTokenAt_26(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Comment(context, token)) + { + endRule(context, RuleType.Description); + build(context, token); + return 27; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.Description); + startRule(context, RuleType.Step); + build(context, token); + return 28; + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Other(context, token)) + { + build(context, token); + return 26; + } + + final String stateComment = "State: 26 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 26; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0 + private int matchTokenAt_27(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Comment(context, token)) + { + build(context, token); + return 27; + } + if (match_StepLine(context, token)) + { + startRule(context, RuleType.Step); + build(context, token); + return 28; + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Empty(context, token)) + { + build(context, token); + return 27; + } + + final String stateComment = "State: 27 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 27; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0 + private int matchTokenAt_28(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_TableRow(context, token)) + { + startRule(context, RuleType.DataTable); + build(context, token); + return 29; + } + if (match_DocStringSeparator(context, token)) + { + startRule(context, RuleType.DocString); + build(context, token); + return 44; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.Step); + startRule(context, RuleType.Step); + build(context, token); + return 28; + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Comment(context, token)) + { + build(context, token); + return 28; + } + if (match_Empty(context, token)) + { + build(context, token); + return 28; + } + + final String stateComment = "State: 28 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 28; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + private int matchTokenAt_29(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_TableRow(context, token)) + { + build(context, token); + return 29; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + startRule(context, RuleType.Step); + build(context, token); + return 28; + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Comment(context, token)) + { + build(context, token); + return 29; + } + if (match_Empty(context, token)) + { + build(context, token); + return 29; + } + + final String stateComment = "State: 29 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 29; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0 + private int matchTokenAt_30(Token token, ParserContext context) { + if (match_TagLine(context, token)) + { + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Tags); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_Comment(context, token)) + { + build(context, token); + return 30; + } + if (match_Empty(context, token)) + { + build(context, token); + return 30; + } + + final String stateComment = "State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0"; + token.detach(); + List expectedTokens = asList("#TagLine", "#ScenarioLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 30; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0 + private int matchTokenAt_31(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Empty(context, token)) + { + build(context, token); + return 31; + } + if (match_Comment(context, token)) + { + build(context, token); + return 33; + } + if (match_StepLine(context, token)) + { + startRule(context, RuleType.Step); + build(context, token); + return 34; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Other(context, token)) + { + startRule(context, RuleType.Description); + build(context, token); + return 32; + } + + final String stateComment = "State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 31; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0 + private int matchTokenAt_32(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Comment(context, token)) + { + endRule(context, RuleType.Description); + build(context, token); + return 33; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.Description); + startRule(context, RuleType.Step); + build(context, token); + return 34; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.Description); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.Description); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Other(context, token)) + { + build(context, token); + return 32; + } + + final String stateComment = "State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 32; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0 + private int matchTokenAt_33(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Comment(context, token)) + { + build(context, token); + return 33; + } + if (match_StepLine(context, token)) + { + startRule(context, RuleType.Step); + build(context, token); + return 34; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Empty(context, token)) + { + build(context, token); + return 33; + } + + final String stateComment = "State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 33; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0 + private int matchTokenAt_34(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_TableRow(context, token)) + { + startRule(context, RuleType.DataTable); + build(context, token); + return 35; + } + if (match_DocStringSeparator(context, token)) + { + startRule(context, RuleType.DocString); + build(context, token); + return 42; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.Step); + startRule(context, RuleType.Step); + build(context, token); + return 34; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.Step); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.Step); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Comment(context, token)) + { + build(context, token); + return 34; + } + if (match_Empty(context, token)) + { + build(context, token); + return 34; + } + + final String stateComment = "State: 34 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 34; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + private int matchTokenAt_35(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_TableRow(context, token)) + { + build(context, token); + return 35; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + startRule(context, RuleType.Step); + build(context, token); + return 34; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.DataTable); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Comment(context, token)) + { + build(context, token); + return 35; + } + if (match_Empty(context, token)) + { + build(context, token); + return 35; + } + + final String stateComment = "State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 35; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0 + private int matchTokenAt_36(Token token, ParserContext context) { + if (match_TagLine(context, token)) + { + build(context, token); + return 36; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.Tags); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_Comment(context, token)) + { + build(context, token); + return 36; + } + if (match_Empty(context, token)) + { + build(context, token); + return 36; + } + + final String stateComment = "State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0"; + token.detach(); + List expectedTokens = asList("#TagLine", "#ExamplesLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 36; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0 + private int matchTokenAt_37(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Empty(context, token)) + { + build(context, token); + return 37; + } + if (match_Comment(context, token)) + { + build(context, token); + return 39; + } + if (match_TableRow(context, token)) + { + startRule(context, RuleType.ExamplesTable); + build(context, token); + return 40; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Other(context, token)) + { + startRule(context, RuleType.Description); + build(context, token); + return 38; + } + + final String stateComment = "State: 37 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 37; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0 + private int matchTokenAt_38(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Comment(context, token)) + { + endRule(context, RuleType.Description); + build(context, token); + return 39; + } + if (match_TableRow(context, token)) + { + endRule(context, RuleType.Description); + startRule(context, RuleType.ExamplesTable); + build(context, token); + return 40; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Description); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Other(context, token)) + { + build(context, token); + return 38; + } + + final String stateComment = "State: 38 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 38; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0 + private int matchTokenAt_39(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_Comment(context, token)) + { + build(context, token); + return 39; + } + if (match_TableRow(context, token)) + { + startRule(context, RuleType.ExamplesTable); + build(context, token); + return 40; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Empty(context, token)) + { + build(context, token); + return 39; + } + + final String stateComment = "State: 39 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 39; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0 + private int matchTokenAt_40(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.ExamplesTable); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_TableRow(context, token)) + { + build(context, token); + return 40; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.ExamplesTable); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.ExamplesTable); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.ExamplesTable); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.ExamplesTable); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.ExamplesTable); + endRule(context, RuleType.Examples); + endRule(context, RuleType.ExamplesDefinition); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Comment(context, token)) + { + build(context, token); + return 40; + } + if (match_Empty(context, token)) + { + build(context, token); + return 40; + } + + final String stateComment = "State: 40 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 40; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + private int matchTokenAt_42(Token token, ParserContext context) { + if (match_DocStringSeparator(context, token)) + { + build(context, token); + return 43; + } + if (match_Other(context, token)) + { + build(context, token); + return 42; + } + + final String stateComment = "State: 42 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + List expectedTokens = asList("#DocStringSeparator", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 42; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + private int matchTokenAt_43(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + startRule(context, RuleType.Step); + build(context, token); + return 34; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 36; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 37; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Comment(context, token)) + { + build(context, token); + return 43; + } + if (match_Empty(context, token)) + { + build(context, token); + return 43; + } + + final String stateComment = "State: 43 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 43; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + private int matchTokenAt_44(Token token, ParserContext context) { + if (match_DocStringSeparator(context, token)) + { + build(context, token); + return 45; + } + if (match_Other(context, token)) + { + build(context, token); + return 44; + } - final String stateComment = "State: 25 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + final String stateComment = "State: 44 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; token.detach(); List expectedTokens = asList("#DocStringSeparator", "#Other"); ParserException error = token.isEOF() @@ -2067,22 +3912,255 @@ private int matchTokenAt_25(Token token, ParserContext context) { throw error; addError(context, error); - return 25; + return 44; } - // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - private int matchTokenAt_26(Token token, ParserContext context) { + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + private int matchTokenAt_45(Token token, ParserContext context) { if (match_EOF(context, token)) { endRule(context, RuleType.DocString); endRule(context, RuleType.Step); endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + startRule(context, RuleType.Step); + build(context, token); + return 28; + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 30; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 31; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + endRule(context, RuleType.Rule); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } + if (match_Comment(context, token)) + { + build(context, token); + return 45; + } + if (match_Empty(context, token)) + { + build(context, token); + return 45; + } + + final String stateComment = "State: 45 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 45; + + } + + + // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + private int matchTokenAt_46(Token token, ParserContext context) { + if (match_DocStringSeparator(context, token)) + { + build(context, token); + return 47; + } + if (match_Other(context, token)) + { + build(context, token); + return 46; + } + + final String stateComment = "State: 46 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + List expectedTokens = asList("#DocStringSeparator", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 46; + + } + + + // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + private int matchTokenAt_47(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); endRule(context, RuleType.Feature); build(context, token); + return 41; + } + if (match_StepLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + startRule(context, RuleType.Step); + build(context, token); + return 15; + } + if (match_TagLine(context, token)) + { + if (lookahead_0(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 17; + } + } + if (match_TagLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Tags); + build(context, token); + return 11; + } + if (match_ExamplesLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + startRule(context, RuleType.ExamplesDefinition); + startRule(context, RuleType.Examples); + build(context, token); + return 18; + } + if (match_ScenarioLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Scenario); + build(context, token); + return 12; + } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Scenario); + endRule(context, RuleType.ScenarioDefinition); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); return 22; } + if (match_Comment(context, token)) + { + build(context, token); + return 47; + } + if (match_Empty(context, token)) + { + build(context, token); + return 47; + } + + final String stateComment = "State: 47 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + List expectedTokens = asList("#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 47; + + } + + + // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + private int matchTokenAt_48(Token token, ParserContext context) { + if (match_DocStringSeparator(context, token)) + { + build(context, token); + return 49; + } + if (match_Other(context, token)) + { + build(context, token); + return 48; + } + + final String stateComment = "State: 48 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + List expectedTokens = asList("#DocStringSeparator", "#Other"); + ParserException error = token.isEOF() + ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) + : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); + if (stopAtFirstError) + throw error; + + addError(context, error); + return 48; + + } + + + // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + private int matchTokenAt_49(Token token, ParserContext context) { + if (match_EOF(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + endRule(context, RuleType.Feature); + build(context, token); + return 41; + } if (match_StepLine(context, token)) { endRule(context, RuleType.DocString); @@ -2111,20 +4189,30 @@ private int matchTokenAt_26(Token token, ParserContext context) { build(context, token); return 12; } + if (match_RuleLine(context, token)) + { + endRule(context, RuleType.DocString); + endRule(context, RuleType.Step); + endRule(context, RuleType.Background); + startRule(context, RuleType.Rule); + startRule(context, RuleType.RuleHeader); + build(context, token); + return 22; + } if (match_Comment(context, token)) { build(context, token); - return 26; + return 49; } if (match_Empty(context, token)) { build(context, token); - return 26; + return 49; } - final String stateComment = "State: 26 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + final String stateComment = "State: 49 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; token.detach(); - List expectedTokens = asList("#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"); + List expectedTokens = asList("#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"); ParserException error = token.isEOF() ? new ParserException.UnexpectedEOFException(token, expectedTokens, stateComment) : new ParserException.UnexpectedTokenException(token, expectedTokens, stateComment); @@ -2132,7 +4220,7 @@ private int matchTokenAt_26(Token token, ParserContext context) { throw error; addError(context, error); - return 26; + return 49; } @@ -2186,6 +4274,7 @@ public interface ITokenMatcher { boolean match_Comment(Token token); boolean match_TagLine(Token token); boolean match_FeatureLine(Token token); + boolean match_RuleLine(Token token); boolean match_BackgroundLine(Token token); boolean match_ScenarioLine(Token token); boolean match_ExamplesLine(Token token); diff --git a/gherkin/java/src/main/java/gherkin/TokenMatcher.java b/gherkin/java/src/main/java/gherkin/TokenMatcher.java index a9ed6e72be9..6858bf3bfc8 100644 --- a/gherkin/java/src/main/java/gherkin/TokenMatcher.java +++ b/gherkin/java/src/main/java/gherkin/TokenMatcher.java @@ -112,6 +112,11 @@ public boolean match_FeatureLine(Token token) { return matchTitleLine(token, TokenType.FeatureLine, currentDialect.getFeatureKeywords()); } + @Override + public boolean match_RuleLine(Token token) { + return matchTitleLine(token, TokenType.RuleLine, currentDialect.getRuleKeywords()); + } + @Override public boolean match_BackgroundLine(Token token) { return matchTitleLine(token, TokenType.BackgroundLine, currentDialect.getBackgroundKeywords()); diff --git a/gherkin/java/src/main/java/gherkin/ast/Feature.java b/gherkin/java/src/main/java/gherkin/ast/Feature.java index 4e26418aa18..e7c790157aa 100644 --- a/gherkin/java/src/main/java/gherkin/ast/Feature.java +++ b/gherkin/java/src/main/java/gherkin/ast/Feature.java @@ -9,7 +9,7 @@ public class Feature extends Node { private final String keyword; private final String name; private final String description; - private final List children; + private final List children; public Feature( List tags, @@ -18,7 +18,7 @@ public Feature( String keyword, String name, String description, - List children) { + List children) { super(location); this.tags = Collections.unmodifiableList(tags); this.language = language; @@ -28,7 +28,8 @@ public Feature( this.children = Collections.unmodifiableList(children); } - public List getChildren() { + @Override + public List getChildren() { return children; } diff --git a/gherkin/java/src/main/java/gherkin/ast/Node.java b/gherkin/java/src/main/java/gherkin/ast/Node.java index 5f9530cf7ae..8280c06fed3 100644 --- a/gherkin/java/src/main/java/gherkin/ast/Node.java +++ b/gherkin/java/src/main/java/gherkin/ast/Node.java @@ -1,5 +1,7 @@ package gherkin.ast; +import java.util.List; + public abstract class Node { private final String type = getClass().getSimpleName(); private final Location location; @@ -11,4 +13,8 @@ protected Node(Location location) { public Location getLocation() { return location; } + + public List getChildren() { + throw new UnsupportedOperationException(); + } } diff --git a/gherkin/java/src/main/java/gherkin/ast/Rule.java b/gherkin/java/src/main/java/gherkin/ast/Rule.java new file mode 100644 index 00000000000..c7f2c3ebd25 --- /dev/null +++ b/gherkin/java/src/main/java/gherkin/ast/Rule.java @@ -0,0 +1,40 @@ +package gherkin.ast; + +import java.util.Collections; +import java.util.List; + +public class Rule extends Node { + private final String keyword; + private final String name; + private final String description; + private final List children; + + public Rule( + Location location, + String keyword, + String name, + String description, + List children) { + super(location); + this.keyword = keyword; + this.name = name; + this.description = description; + this.children = Collections.unmodifiableList(children); + } + + public List getChildren() { + return children; + } + + public String getKeyword() { + return keyword; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } +} diff --git a/gherkin/java/src/main/java/gherkin/ast/StepsContainer.java b/gherkin/java/src/main/java/gherkin/ast/StepsContainer.java index 3c11285404e..2536957462b 100644 --- a/gherkin/java/src/main/java/gherkin/ast/StepsContainer.java +++ b/gherkin/java/src/main/java/gherkin/ast/StepsContainer.java @@ -29,7 +29,8 @@ public String getDescription() { return description; } - public List getSteps() { + @Override + public List getChildren() { return steps; } } diff --git a/gherkin/java/src/main/java/gherkin/pickles/Compiler.java b/gherkin/java/src/main/java/gherkin/pickles/Compiler.java index d41779dcf44..4d427eb3804 100644 --- a/gherkin/java/src/main/java/gherkin/pickles/Compiler.java +++ b/gherkin/java/src/main/java/gherkin/pickles/Compiler.java @@ -9,6 +9,7 @@ import gherkin.ast.GherkinDocument; import gherkin.ast.Location; import gherkin.ast.Node; +import gherkin.ast.Rule; import gherkin.ast.Scenario; import gherkin.ast.Step; import gherkin.ast.StepsContainer; @@ -34,27 +35,33 @@ public List compile(GherkinDocument gherkinDocument) { } String language = feature.getLanguage(); - List featureTags = feature.getTags(); + List tags = feature.getTags(); List backgroundSteps = new ArrayList<>(); - for (StepsContainer stepsContainer : feature.getChildren()) { - if (stepsContainer instanceof Background) { - backgroundSteps = pickleSteps(stepsContainer); + build(pickles, language, tags, backgroundSteps, feature); + return pickles; + } + + private void build(List pickles, String language, List tags, List backgroundSteps, Node parent) { + for (Node child : parent.getChildren()) { + if (child instanceof Background) { + backgroundSteps = pickleSteps((Background) child); + } else if (child instanceof Rule) { + build(pickles, language, tags, backgroundSteps, child); } else { - Scenario scenario = (Scenario) stepsContainer; + Scenario scenario = (Scenario) child; if (scenario.getExamples().isEmpty()) { - compileScenario(pickles, backgroundSteps, scenario, featureTags, language); + compileScenario(pickles, backgroundSteps, scenario, tags, language); } else { - compileScenarioOutline(pickles, backgroundSteps, scenario, featureTags, language); + compileScenarioOutline(pickles, backgroundSteps, scenario, tags, language); } } } - return pickles; } private void compileScenario(List pickles, List backgroundSteps, Scenario scenario, List featureTags, String language) { List steps = new ArrayList<>(); - if (!scenario.getSteps().isEmpty()) + if (!scenario.getChildren().isEmpty()) steps.addAll(backgroundSteps); List scenarioTags = new ArrayList<>(); @@ -81,7 +88,7 @@ private void compileScenarioOutline(List pickles, List backg List valueCells = values.getCells(); List steps = new ArrayList<>(); - if (!scenario.getSteps().isEmpty()) + if (!scenario.getChildren().isEmpty()) steps.addAll(backgroundSteps); List tags = new ArrayList<>(); @@ -89,7 +96,7 @@ private void compileScenarioOutline(List pickles, List backg tags.addAll(scenario.getTags()); tags.addAll(examples.getTags()); - for (Step scenarioOutlineStep : scenario.getSteps()) { + for (Step scenarioOutlineStep : scenario.getChildren()) { String stepText = interpolate(scenarioOutlineStep.getText(), variableCells, valueCells); // TODO: Use an Array of location in DataTable/DocString as well. @@ -166,7 +173,7 @@ private List createPickleArguments(Node argument, List vari private List pickleSteps(StepsContainer scenarioDefinition) { List result = new ArrayList<>(); - for (Step step : scenarioDefinition.getSteps()) { + for (Step step : scenarioDefinition.getChildren()) { result.add(pickleStep(step)); } return unmodifiableList(result); diff --git a/gherkin/java/src/test/java/gherkin/AstBuilderTest.java b/gherkin/java/src/test/java/gherkin/AstBuilderTest.java index d11c8a4fa40..cb5d043d243 100644 --- a/gherkin/java/src/test/java/gherkin/AstBuilderTest.java +++ b/gherkin/java/src/test/java/gherkin/AstBuilderTest.java @@ -1,8 +1,13 @@ package gherkin; import gherkin.ast.GherkinDocument; +import gherkin.ast.Node; +import gherkin.pickles.Compiler; +import gherkin.pickles.Pickle; import org.junit.Test; +import java.util.List; + import static org.junit.Assert.assertEquals; public class AstBuilderTest { @@ -17,4 +22,29 @@ public void is_reusable() { assertEquals("1", d1.getFeature().getName()); assertEquals("2", d2.getFeature().getName()); } + + @Test + public void parses_rules() { + Parser parser = new Parser<>(new AstBuilder()); + GherkinDocument doc = parser.parse("" + + "Feature: Some rules\n" + + "\n" + + " Rule: A\n" + + "\n" + + " Example: Example A\n" + + " Given a\n" + + "\n" + + " Rule: B\n" + + "\n" + + " Example: Example B\n" + + " Given b"); + + List children = doc.getFeature().getChildren(); + assertEquals(2, children.size()); + + Compiler compiler = new Compiler(); + List pickles = compiler.compile(doc); + assertEquals(2, pickles.size()); + } + } diff --git a/gherkin/java/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/java/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/java/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/java/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/java/testdata/good/rule.feature b/gherkin/java/testdata/good/rule.feature new file mode 100644 index 00000000000..c233eb8d5bb --- /dev/null +++ b/gherkin/java/testdata/good/rule.feature @@ -0,0 +1,13 @@ +Feature: Some rules + + Rule: A + The rule A description + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/java/testdata/good/rule.feature.ast.ndjson b/gherkin/java/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..a25846b9446 --- /dev/null +++ b/gherkin/java/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":6},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":7},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Rule","location":{"column":3,"line":3},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Rule","location":{"column":3,"line":9},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/java/testdata/good/rule.feature.pickles.ndjson b/gherkin/java/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..4564d63ebbc --- /dev/null +++ b/gherkin/java/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":6}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":13,"line":7}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":13,"line":13}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/java/testdata/good/rule.feature.source.ndjson b/gherkin/java/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..85388da2215 --- /dev/null +++ b/gherkin/java/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Rule: A\n The rule A description\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/java/testdata/good/rule.feature.tokens b/gherkin/java/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..cbb360cae65 --- /dev/null +++ b/gherkin/java/testdata/good/rule.feature.tokens @@ -0,0 +1,14 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)RuleLine:Rule/A/ +(4:1)Other:/ The rule A description/ +(5:1)Other:// +(6:5)ScenarioLine:Example/Example A/ +(7:7)StepLine:Given /a/ +(8:1)Empty:// +(9:3)RuleLine:Rule/B/ +(10:1)Other:/ The rule B description/ +(11:1)Other:// +(12:5)ScenarioLine:Example/Example B/ +(13:7)StepLine:Given /b/ +EOF From 2426411b988622d386098047a6ddc34d478d17cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Fri, 15 Jun 2018 20:50:25 +0100 Subject: [PATCH 2/3] Support background under Rule --- .../src/main/java/gherkin/AstBuilder.java | 2 + .../main/java/gherkin/pickles/Compiler.java | 5 ++- .../src/test/java/gherkin/AstBuilderTest.java | 14 +++++- .../good/minimal-example.feature.ast.ndjson | 44 +------------------ gherkin/java/testdata/good/rule.feature | 6 +++ .../testdata/good/rule.feature.ast.ndjson | 2 +- .../testdata/good/rule.feature.pickles.ndjson | 4 +- .../testdata/good/rule.feature.source.ndjson | 2 +- .../java/testdata/good/rule.feature.tokens | 28 +++++++----- 9 files changed, 46 insertions(+), 61 deletions(-) diff --git a/gherkin/java/src/main/java/gherkin/AstBuilder.java b/gherkin/java/src/main/java/gherkin/AstBuilder.java index 18260df26c9..bf1f423fee5 100644 --- a/gherkin/java/src/main/java/gherkin/AstBuilder.java +++ b/gherkin/java/src/main/java/gherkin/AstBuilder.java @@ -165,6 +165,8 @@ public String toString(Token t) { if (ruleLine == null) return null; String description = getDescription(node); List ruleChildren = new ArrayList<>(); + Background background = node.getSingle(RuleType.Background, null); + if (background != null) ruleChildren.add(background); List stepsContainers = node.getItems(RuleType.ScenarioDefinition); ruleChildren.addAll(stepsContainers); return new Rule(getLocation(ruleLine, 0), ruleLine.matchedKeyword, ruleLine.matchedText, description, ruleChildren); diff --git a/gherkin/java/src/main/java/gherkin/pickles/Compiler.java b/gherkin/java/src/main/java/gherkin/pickles/Compiler.java index 4d427eb3804..39317dc1ded 100644 --- a/gherkin/java/src/main/java/gherkin/pickles/Compiler.java +++ b/gherkin/java/src/main/java/gherkin/pickles/Compiler.java @@ -42,10 +42,11 @@ public List compile(GherkinDocument gherkinDocument) { return pickles; } - private void build(List pickles, String language, List tags, List backgroundSteps, Node parent) { + private void build(List pickles, String language, List tags, List parentBackgroundSteps, Node parent) { + List backgroundSteps = new ArrayList<>(parentBackgroundSteps); for (Node child : parent.getChildren()) { if (child instanceof Background) { - backgroundSteps = pickleSteps((Background) child); + backgroundSteps.addAll(pickleSteps((Background) child)); } else if (child instanceof Rule) { build(pickles, language, tags, backgroundSteps, child); } else { diff --git a/gherkin/java/src/test/java/gherkin/AstBuilderTest.java b/gherkin/java/src/test/java/gherkin/AstBuilderTest.java index cb5d043d243..5cafd8205f4 100644 --- a/gherkin/java/src/test/java/gherkin/AstBuilderTest.java +++ b/gherkin/java/src/test/java/gherkin/AstBuilderTest.java @@ -29,22 +29,34 @@ public void parses_rules() { GherkinDocument doc = parser.parse("" + "Feature: Some rules\n" + "\n" + + " Background:\n" + + " Given fb\n" + + "\n" + " Rule: A\n" + + " The rule A description\n" + + "\n" + + " Background:\n" + + " Given ab\n" + "\n" + " Example: Example A\n" + " Given a\n" + "\n" + " Rule: B\n" + + " The rule B description\n" + "\n" + " Example: Example B\n" + " Given b"); List children = doc.getFeature().getChildren(); - assertEquals(2, children.size()); + assertEquals(3, children.size()); Compiler compiler = new Compiler(); List pickles = compiler.compile(doc); assertEquals(2, pickles.size()); + + assertEquals(3, pickles.get(0).getSteps().size()); + + assertEquals(2, pickles.get(1).getSteps().size()); } } diff --git a/gherkin/java/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/java/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/java/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/java/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/java/testdata/good/rule.feature b/gherkin/java/testdata/good/rule.feature index c233eb8d5bb..c5c3e7f1232 100644 --- a/gherkin/java/testdata/good/rule.feature +++ b/gherkin/java/testdata/good/rule.feature @@ -1,8 +1,14 @@ Feature: Some rules + Background: + Given fb + Rule: A The rule A description + Background: + Given ab + Example: Example A Given a diff --git a/gherkin/java/testdata/good/rule.feature.ast.ndjson b/gherkin/java/testdata/good/rule.feature.ast.ndjson index a25846b9446..bd8794060d9 100644 --- a/gherkin/java/testdata/good/rule.feature.ast.ndjson +++ b/gherkin/java/testdata/good/rule.feature.ast.ndjson @@ -1 +1 @@ -{"document":{"comments":[],"feature":{"children":[{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":6},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":7},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Rule","location":{"column":3,"line":3},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Rule","location":{"column":3,"line":9},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/java/testdata/good/rule.feature.pickles.ndjson b/gherkin/java/testdata/good/rule.feature.pickles.ndjson index 4564d63ebbc..427057ced72 100644 --- a/gherkin/java/testdata/good/rule.feature.pickles.ndjson +++ b/gherkin/java/testdata/good/rule.feature.pickles.ndjson @@ -1,2 +1,2 @@ -{"pickle":{"language":"en","locations":[{"column":5,"line":6}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":13,"line":7}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} -{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":13,"line":13}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/java/testdata/good/rule.feature.source.ndjson b/gherkin/java/testdata/good/rule.feature.source.ndjson index 85388da2215..e18933881b8 100644 --- a/gherkin/java/testdata/good/rule.feature.source.ndjson +++ b/gherkin/java/testdata/good/rule.feature.source.ndjson @@ -1 +1 @@ -{"data":"Feature: Some rules\n\n Rule: A\n The rule A description\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/java/testdata/good/rule.feature.tokens b/gherkin/java/testdata/good/rule.feature.tokens index cbb360cae65..2985c8eb9dc 100644 --- a/gherkin/java/testdata/good/rule.feature.tokens +++ b/gherkin/java/testdata/good/rule.feature.tokens @@ -1,14 +1,20 @@ (1:1)FeatureLine:Feature/Some rules/ (2:1)Empty:// -(3:3)RuleLine:Rule/A/ -(4:1)Other:/ The rule A description/ -(5:1)Other:// -(6:5)ScenarioLine:Example/Example A/ -(7:7)StepLine:Given /a/ -(8:1)Empty:// -(9:3)RuleLine:Rule/B/ -(10:1)Other:/ The rule B description/ -(11:1)Other:// -(12:5)ScenarioLine:Example/Example B/ -(13:7)StepLine:Given /b/ +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ EOF From 56bcb1bdc347b383b462d9c24ea3de9ea9edc360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Sat, 16 Jun 2018 20:38:09 +0100 Subject: [PATCH 3/3] Implement Rule for C#,Java,JavaScript,Ruby and partially Go --- gherkin/c/gherkin-languages.json | 222 ++ gherkin/c/gherkin.berp | 7 +- ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- gherkin/c/testdata/good/rule.feature | 19 + .../c/testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + gherkin/c/testdata/good/rule.feature.tokens | 20 + gherkin/dotnet/Gherkin/Ast/Feature.cs | 6 +- gherkin/dotnet/Gherkin/Ast/IHasChildren.cs | 9 + gherkin/dotnet/Gherkin/Ast/Rule.cs | 22 + gherkin/dotnet/Gherkin/AstBuilder.cs | 32 +- gherkin/dotnet/Gherkin/GherkinDialect.cs | 3 + .../dotnet/Gherkin/GherkinDialectProvider.cs | 3 + gherkin/dotnet/Gherkin/Parser.cs | 2340 ++++++++++++++++- gherkin/dotnet/Gherkin/Pickles/Compiler.cs | 37 +- gherkin/dotnet/Gherkin/TokenMatcher.cs | 5 + gherkin/dotnet/Gherkin/gherkin-languages.json | 222 ++ gherkin/dotnet/gherkin.berp | 7 +- ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- gherkin/dotnet/testdata/good/rule.feature | 19 + .../testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + .../dotnet/testdata/good/rule.feature.tokens | 20 + gherkin/gherkin-languages.json | 222 ++ gherkin/gherkin.berp | 7 +- gherkin/go/ast.go | 8 + gherkin/go/astbuilder.go | 27 + gherkin/go/dialect.go | 4 + gherkin/go/dialects_builtin.go | 223 ++ gherkin/go/dialects_builtin.go.jq | 4 +- gherkin/go/gherkin-languages.json | 222 ++ gherkin/go/gherkin.berp | 7 +- gherkin/go/matcher.go | 3 + gherkin/go/parser.go | 2167 ++++++++++++++- ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- gherkin/go/testdata/good/rule.feature | 19 + .../go/testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + gherkin/go/testdata/good/rule.feature.tokens | 20 + .../src/main/java/gherkin/AstBuilder.java | 2 +- .../src/main/java/gherkin/GherkinDialect.java | 2 +- .../main/java/gherkin/pickles/Compiler.java | 8 +- .../resources/gherkin/gherkin-languages.json | 222 ++ .../testdata/good/rule.feature.ast.ndjson | 2 +- gherkin/javascript/dist/gherkin.js | 2061 ++++++++++++++- gherkin/javascript/dist/gherkin.min.js | 8 +- gherkin/javascript/gherkin.berp | 7 +- gherkin/javascript/lib/gherkin/ast_builder.js | 20 + .../lib/gherkin/gherkin-languages.json | 222 ++ gherkin/javascript/lib/gherkin/parser.js | 2016 +++++++++++++- .../lib/gherkin/pickles/compiler.js | 28 +- .../javascript/lib/gherkin/token_matcher.js | 6 +- ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- gherkin/javascript/testdata/good/rule.feature | 19 + .../testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + .../testdata/good/rule.feature.tokens | 20 + .../GherkinLanguages/gherkin-languages.json | 222 ++ gherkin/objective-c/gherkin.berp | 7 +- ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- .../objective-c/testdata/good/rule.feature | 19 + .../testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + .../testdata/good/rule.feature.tokens | 20 + gherkin/perl/CHANGES | 3 +- gherkin/perl/gherkin-languages.json | 222 ++ gherkin/perl/gherkin.berp | 7 +- ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- gherkin/perl/testdata/good/rule.feature | 19 + .../testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + .../perl/testdata/good/rule.feature.tokens | 20 + gherkin/python/gherkin.berp | 7 +- gherkin/python/gherkin/gherkin-languages.json | 222 ++ ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- gherkin/python/testdata/good/rule.feature | 19 + .../testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + .../python/testdata/good/rule.feature.tokens | 20 + gherkin/ruby/gherkin.berp | 7 +- gherkin/ruby/lib/gherkin/ast_builder.rb | 20 + gherkin/ruby/lib/gherkin/dialect.rb | 4 + .../ruby/lib/gherkin/gherkin-languages.json | 222 ++ gherkin/ruby/lib/gherkin/parser.rb | 1940 +++++++++++++- gherkin/ruby/lib/gherkin/pickles/compiler.rb | 31 +- gherkin/ruby/lib/gherkin/token_matcher.rb | 4 + gherkin/ruby/ruby.iml | 25 + ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- gherkin/ruby/testdata/good/rule.feature | 19 + .../testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + .../ruby/testdata/good/rule.feature.tokens | 20 + ...ltiple_parser_errors.feature.errors.ndjson | 2 +- .../good/minimal-example.feature.ast.ndjson | 44 +- gherkin/testdata/good/rule.feature | 19 + gherkin/testdata/good/rule.feature.ast.ndjson | 1 + .../testdata/good/rule.feature.pickles.ndjson | 2 + .../testdata/good/rule.feature.source.ndjson | 1 + gherkin/testdata/good/rule.feature.tokens | 20 + 115 files changed, 13116 insertions(+), 1041 deletions(-) create mode 100644 gherkin/c/testdata/good/rule.feature create mode 100644 gherkin/c/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/c/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/c/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/c/testdata/good/rule.feature.tokens create mode 100644 gherkin/dotnet/Gherkin/Ast/IHasChildren.cs create mode 100644 gherkin/dotnet/Gherkin/Ast/Rule.cs create mode 100644 gherkin/dotnet/testdata/good/rule.feature create mode 100644 gherkin/dotnet/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/dotnet/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/dotnet/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/dotnet/testdata/good/rule.feature.tokens create mode 100644 gherkin/go/testdata/good/rule.feature create mode 100644 gherkin/go/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/go/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/go/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/go/testdata/good/rule.feature.tokens create mode 100644 gherkin/javascript/testdata/good/rule.feature create mode 100644 gherkin/javascript/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/javascript/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/javascript/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/javascript/testdata/good/rule.feature.tokens create mode 100644 gherkin/objective-c/testdata/good/rule.feature create mode 100644 gherkin/objective-c/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/objective-c/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/objective-c/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/objective-c/testdata/good/rule.feature.tokens create mode 100644 gherkin/perl/testdata/good/rule.feature create mode 100644 gherkin/perl/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/perl/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/perl/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/perl/testdata/good/rule.feature.tokens create mode 100644 gherkin/python/testdata/good/rule.feature create mode 100644 gherkin/python/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/python/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/python/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/python/testdata/good/rule.feature.tokens create mode 100644 gherkin/ruby/ruby.iml create mode 100644 gherkin/ruby/testdata/good/rule.feature create mode 100644 gherkin/ruby/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/ruby/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/ruby/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/ruby/testdata/good/rule.feature.tokens create mode 100644 gherkin/testdata/good/rule.feature create mode 100644 gherkin/testdata/good/rule.feature.ast.ndjson create mode 100644 gherkin/testdata/good/rule.feature.pickles.ndjson create mode 100644 gherkin/testdata/good/rule.feature.source.ndjson create mode 100644 gherkin/testdata/good/rule.feature.tokens diff --git a/gherkin/c/gherkin-languages.json b/gherkin/c/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/c/gherkin-languages.json +++ b/gherkin/c/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/c/gherkin.berp b/gherkin/c/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/c/gherkin.berp +++ b/gherkin/c/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/c/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/c/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/c/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/c/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/c/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/c/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/c/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/c/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/c/testdata/good/rule.feature b/gherkin/c/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/c/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/c/testdata/good/rule.feature.ast.ndjson b/gherkin/c/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/c/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/c/testdata/good/rule.feature.pickles.ndjson b/gherkin/c/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/c/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/c/testdata/good/rule.feature.source.ndjson b/gherkin/c/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/c/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/c/testdata/good/rule.feature.tokens b/gherkin/c/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/c/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF diff --git a/gherkin/dotnet/Gherkin/Ast/Feature.cs b/gherkin/dotnet/Gherkin/Ast/Feature.cs index 4aa21631b6b..1dafd1d44f0 100644 --- a/gherkin/dotnet/Gherkin/Ast/Feature.cs +++ b/gherkin/dotnet/Gherkin/Ast/Feature.cs @@ -2,7 +2,7 @@ namespace Gherkin.Ast { - public class Feature : IHasLocation, IHasDescription, IHasTags + public class Feature : IHasLocation, IHasDescription, IHasTags, IHasChildren { public IEnumerable Tags { get; private set; } public Location Location { get; private set; } @@ -10,9 +10,9 @@ public class Feature : IHasLocation, IHasDescription, IHasTags public string Keyword { get; private set; } public string Name { get; private set; } public string Description { get; private set; } - public IEnumerable Children { get; private set; } + public IEnumerable Children { get; private set; } - public Feature(Tag[] tags, Location location, string language, string keyword, string name, string description, StepsContainer[] children) + public Feature(Tag[] tags, Location location, string language, string keyword, string name, string description, IHasLocation[] children) { Tags = tags; Location = location; diff --git a/gherkin/dotnet/Gherkin/Ast/IHasChildren.cs b/gherkin/dotnet/Gherkin/Ast/IHasChildren.cs new file mode 100644 index 00000000000..468f8a00de0 --- /dev/null +++ b/gherkin/dotnet/Gherkin/Ast/IHasChildren.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace Gherkin.Ast +{ + public interface IHasChildren + { + IEnumerable Children { get; } + } +} \ No newline at end of file diff --git a/gherkin/dotnet/Gherkin/Ast/Rule.cs b/gherkin/dotnet/Gherkin/Ast/Rule.cs new file mode 100644 index 00000000000..78508c7ccf0 --- /dev/null +++ b/gherkin/dotnet/Gherkin/Ast/Rule.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace Gherkin.Ast +{ + public class Rule : IHasLocation, IHasDescription, IHasChildren + { + public Location Location { get; private set; } + public string Keyword { get; private set; } + public string Name { get; private set; } + public string Description { get; private set; } + public IEnumerable Children { get; private set; } + + public Rule(Location location, string keyword, string name, string description, IHasLocation[] children) + { + Location = location; + Keyword = keyword; + Name = name; + Description = description; + Children = children; + } + } +} diff --git a/gherkin/dotnet/Gherkin/AstBuilder.cs b/gherkin/dotnet/Gherkin/AstBuilder.cs index c7cf0a5d107..220abac5d78 100644 --- a/gherkin/dotnet/Gherkin/AstBuilder.cs +++ b/gherkin/dotnet/Gherkin/AstBuilder.cs @@ -129,19 +129,39 @@ private object GetTransformedNode(AstNode node) var tags = GetTags(header); var featureLine = header.GetToken(TokenType.FeatureLine); if(featureLine == null) return null; - var children = new List (); + var children = new List (); var background = node.GetSingle(RuleType.Background); if (background != null) { children.Add (background); } - var childrenEnumerable = children.Concat(node.GetItems(RuleType.ScenarioDefinition)); + var childrenEnumerable = children.Concat(node.GetItems(RuleType.ScenarioDefinition)) + .Concat(node.GetItems(RuleType.Rule)); var description = GetDescription(header); if(featureLine.MatchedGherkinDialect == null) return null; var language = featureLine.MatchedGherkinDialect.Language; return CreateFeature(tags, GetLocation(featureLine), language, featureLine.MatchedKeyword, featureLine.MatchedText, description, childrenEnumerable.ToArray(), node); } + case RuleType.Rule: + { + var header = node.GetSingle(RuleType.RuleHeader); + if (header == null) return null; + var ruleLine = header.GetToken(TokenType.RuleLine); + if (ruleLine == null) return null; + var children = new List(); + var background = node.GetSingle(RuleType.Background); + if (background != null) + { + children.Add(background); + } + var childrenEnumerable = children.Concat(node.GetItems(RuleType.ScenarioDefinition)); + var description = GetDescription(header); + if (ruleLine.MatchedGherkinDialect == null) return null; + var language = ruleLine.MatchedGherkinDialect.Language; + + return CreateRule(GetLocation(ruleLine), ruleLine.MatchedKeyword, ruleLine.MatchedText, description, childrenEnumerable.ToArray(), node); + } case RuleType.GherkinDocument: { var feature = node.GetSingle(RuleType.Feature); @@ -192,10 +212,16 @@ protected virtual GherkinDocument CreateGherkinDocument(Feature feature, Comment return new GherkinDocument(feature, gherkinDocumentComments); } - protected virtual Feature CreateFeature(Tag[] tags, Location location, string language, string keyword, string name, string description, StepsContainer[] children, AstNode node) + protected virtual Feature CreateFeature(Tag[] tags, Location location, string language, string keyword, string name, string description, IHasLocation[] children, AstNode node) { return new Feature(tags, location, language, keyword, name, description, children); } + + protected virtual Rule CreateRule(Location location, string keyword, string name, string description, IHasLocation[] children, AstNode node) + { + return new Rule(location, keyword, name, description, children); + } + protected virtual Tag CreateTag(Location location, string name, AstNode node) { return new Tag(location, name); diff --git a/gherkin/dotnet/Gherkin/GherkinDialect.cs b/gherkin/dotnet/Gherkin/GherkinDialect.cs index e35b93732af..907d3cfdd00 100644 --- a/gherkin/dotnet/Gherkin/GherkinDialect.cs +++ b/gherkin/dotnet/Gherkin/GherkinDialect.cs @@ -7,6 +7,7 @@ public class GherkinDialect public string Language { get; private set; } public string[] FeatureKeywords { get; private set; } + public string[] RuleKeywords { get; private set; } public string[] BackgroundKeywords { get; private set; } public string[] ScenarioKeywords { get; private set; } public string[] ScenarioOutlineKeywords { get; private set; } @@ -23,6 +24,7 @@ public class GherkinDialect public GherkinDialect( string language, string[] featureKeywords, + string[] ruleKeywords, string[] backgroundKeywords, string[] scenarioKeywords, string[] scenarioOutlineKeywords, @@ -35,6 +37,7 @@ public GherkinDialect( { Language = language; FeatureKeywords = featureKeywords; + RuleKeywords = ruleKeywords; BackgroundKeywords = backgroundKeywords; ScenarioKeywords = scenarioKeywords; ScenarioOutlineKeywords = scenarioOutlineKeywords; diff --git a/gherkin/dotnet/Gherkin/GherkinDialectProvider.cs b/gherkin/dotnet/Gherkin/GherkinDialectProvider.cs index 9c88ce8a28a..6056bb23ece 100644 --- a/gherkin/dotnet/Gherkin/GherkinDialectProvider.cs +++ b/gherkin/dotnet/Gherkin/GherkinDialectProvider.cs @@ -22,6 +22,7 @@ protected class GherkinLanguageSetting public string name; public string native; public string[] feature; + public string[] rule; public string[] background; public string[] scenario; public string[] scenarioOutline; @@ -102,6 +103,7 @@ protected GherkinDialect CreateGherkinDialect(string language, GherkinLanguageSe return new GherkinDialect( language, ParseTitleKeywords(languageSettings.feature), + ParseTitleKeywords(languageSettings.rule), ParseTitleKeywords(languageSettings.background), ParseTitleKeywords(languageSettings.scenario), ParseTitleKeywords(languageSettings.scenarioOutline), @@ -129,6 +131,7 @@ protected static GherkinDialect GetFactoryDefault() return new GherkinDialect( "en", new[] {"Feature"}, + new[] {"Rule"}, new[] {"Background"}, new[] {"Scenario"}, new[] {"Scenario Outline", "Scenario Template"}, diff --git a/gherkin/dotnet/Gherkin/Parser.cs b/gherkin/dotnet/Gherkin/Parser.cs index 557b8dec9d2..424c8525955 100644 --- a/gherkin/dotnet/Gherkin/Parser.cs +++ b/gherkin/dotnet/Gherkin/Parser.cs @@ -20,6 +20,7 @@ public enum TokenType Comment, TagLine, FeatureLine, + RuleLine, BackgroundLine, ScenarioLine, ExamplesLine, @@ -38,6 +39,7 @@ public enum RuleType _Comment, // #Comment _TagLine, // #TagLine _FeatureLine, // #FeatureLine + _RuleLine, // #RuleLine _BackgroundLine, // #BackgroundLine _ScenarioLine, // #ScenarioLine _ExamplesLine, // #ExamplesLine @@ -47,8 +49,10 @@ public enum RuleType _Language, // #Language _Other, // #Other GherkinDocument, // GherkinDocument! := Feature? - Feature, // Feature! := FeatureHeader Background? ScenarioDefinition* + Feature, // Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader, // FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper + Rule, // Rule! := RuleHeader Background? ScenarioDefinition* + RuleHeader, // RuleHeader! := #RuleLine DescriptionHelper Background, // Background! := #BackgroundLine DescriptionHelper Step* ScenarioDefinition, // ScenarioDefinition! := Tags? Scenario Scenario, // Scenario! := #ScenarioLine DescriptionHelper Step* ExamplesDefinition* @@ -216,6 +220,12 @@ bool Match_FeatureLine(ParserContext context, Token token) return HandleExternalError(context, () => context.TokenMatcher.Match_FeatureLine(token), false); } + bool Match_RuleLine(ParserContext context, Token token) + { + if (token.IsEOF) return false; + return HandleExternalError(context, () => context.TokenMatcher.Match_RuleLine(token), false); + } + bool Match_BackgroundLine(ParserContext context, Token token) { if (token.IsEOF) return false; @@ -335,6 +345,9 @@ protected virtual int MatchToken(int state, Token token, ParserContext context) case 21: newState = MatchTokenAt_21(token, context); break; + case 22: + newState = MatchTokenAt_22(token, context); + break; case 23: newState = MatchTokenAt_23(token, context); break; @@ -347,6 +360,72 @@ protected virtual int MatchToken(int state, Token token, ParserContext context) case 26: newState = MatchTokenAt_26(token, context); break; + case 27: + newState = MatchTokenAt_27(token, context); + break; + case 28: + newState = MatchTokenAt_28(token, context); + break; + case 29: + newState = MatchTokenAt_29(token, context); + break; + case 30: + newState = MatchTokenAt_30(token, context); + break; + case 31: + newState = MatchTokenAt_31(token, context); + break; + case 32: + newState = MatchTokenAt_32(token, context); + break; + case 33: + newState = MatchTokenAt_33(token, context); + break; + case 34: + newState = MatchTokenAt_34(token, context); + break; + case 35: + newState = MatchTokenAt_35(token, context); + break; + case 36: + newState = MatchTokenAt_36(token, context); + break; + case 37: + newState = MatchTokenAt_37(token, context); + break; + case 38: + newState = MatchTokenAt_38(token, context); + break; + case 39: + newState = MatchTokenAt_39(token, context); + break; + case 40: + newState = MatchTokenAt_40(token, context); + break; + case 42: + newState = MatchTokenAt_42(token, context); + break; + case 43: + newState = MatchTokenAt_43(token, context); + break; + case 44: + newState = MatchTokenAt_44(token, context); + break; + case 45: + newState = MatchTokenAt_45(token, context); + break; + case 46: + newState = MatchTokenAt_46(token, context); + break; + case 47: + newState = MatchTokenAt_47(token, context); + break; + case 48: + newState = MatchTokenAt_48(token, context); + break; + case 49: + newState = MatchTokenAt_49(token, context); + break; default: throw new InvalidOperationException("Unknown state: " + state); } @@ -360,7 +439,7 @@ int MatchTokenAt_0(Token token, ParserContext context) if (Match_EOF(context, token)) { Build(context, token); - return 22; + return 41; } if (Match_Language(context, token)) { @@ -495,7 +574,7 @@ int MatchTokenAt_3(Token token, ParserContext context) EndRule(context, RuleType.FeatureHeader); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Empty(context, token)) { @@ -530,6 +609,14 @@ int MatchTokenAt_3(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.FeatureHeader); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Other(context, token)) { StartRule(context, RuleType.Description); @@ -539,7 +626,7 @@ int MatchTokenAt_3(Token token, ParserContext context) const string stateComment = "State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"}; + var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -560,7 +647,7 @@ int MatchTokenAt_4(Token token, ParserContext context) EndRule(context, RuleType.FeatureHeader); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Comment(context, token)) { @@ -594,6 +681,15 @@ int MatchTokenAt_4(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.FeatureHeader); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Other(context, token)) { Build(context, token); @@ -602,7 +698,7 @@ int MatchTokenAt_4(Token token, ParserContext context) const string stateComment = "State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"}; + var expectedTokens = new string[] {"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -622,7 +718,7 @@ int MatchTokenAt_5(Token token, ParserContext context) EndRule(context, RuleType.FeatureHeader); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Comment(context, token)) { @@ -652,6 +748,14 @@ int MatchTokenAt_5(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.FeatureHeader); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Empty(context, token)) { Build(context, token); @@ -660,7 +764,7 @@ int MatchTokenAt_5(Token token, ParserContext context) const string stateComment = "State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -680,7 +784,7 @@ int MatchTokenAt_6(Token token, ParserContext context) EndRule(context, RuleType.Background); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Empty(context, token)) { @@ -714,6 +818,14 @@ int MatchTokenAt_6(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Background); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Other(context, token)) { StartRule(context, RuleType.Description); @@ -723,7 +835,7 @@ int MatchTokenAt_6(Token token, ParserContext context) const string stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"}; + var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -744,7 +856,7 @@ int MatchTokenAt_7(Token token, ParserContext context) EndRule(context, RuleType.Background); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Comment(context, token)) { @@ -777,6 +889,15 @@ int MatchTokenAt_7(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Other(context, token)) { Build(context, token); @@ -785,7 +906,7 @@ int MatchTokenAt_7(Token token, ParserContext context) const string stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"}; + var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -805,7 +926,7 @@ int MatchTokenAt_8(Token token, ParserContext context) EndRule(context, RuleType.Background); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Comment(context, token)) { @@ -834,6 +955,14 @@ int MatchTokenAt_8(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Background); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Empty(context, token)) { Build(context, token); @@ -842,7 +971,7 @@ int MatchTokenAt_8(Token token, ParserContext context) const string stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -863,7 +992,7 @@ int MatchTokenAt_9(Token token, ParserContext context) EndRule(context, RuleType.Background); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_TableRow(context, token)) { @@ -875,7 +1004,7 @@ int MatchTokenAt_9(Token token, ParserContext context) { StartRule(context, RuleType.DocString); Build(context, token); - return 25; + return 48; } if (Match_StepLine(context, token)) { @@ -902,6 +1031,15 @@ int MatchTokenAt_9(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Comment(context, token)) { Build(context, token); @@ -915,7 +1053,7 @@ int MatchTokenAt_9(Token token, ParserContext context) const string stateComment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -937,7 +1075,7 @@ int MatchTokenAt_10(Token token, ParserContext context) EndRule(context, RuleType.Background); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_TableRow(context, token)) { @@ -972,6 +1110,16 @@ int MatchTokenAt_10(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Comment(context, token)) { Build(context, token); @@ -985,7 +1133,7 @@ int MatchTokenAt_10(Token token, ParserContext context) const string stateComment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1046,7 +1194,7 @@ int MatchTokenAt_12(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Empty(context, token)) { @@ -1099,6 +1247,15 @@ int MatchTokenAt_12(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Other(context, token)) { StartRule(context, RuleType.Description); @@ -1108,7 +1265,7 @@ int MatchTokenAt_12(Token token, ParserContext context) const string stateComment = "State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"}; + var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1130,7 +1287,7 @@ int MatchTokenAt_13(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Comment(context, token)) { @@ -1184,6 +1341,16 @@ int MatchTokenAt_13(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Other(context, token)) { Build(context, token); @@ -1192,7 +1359,7 @@ int MatchTokenAt_13(Token token, ParserContext context) const string stateComment = "State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"}; + var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1213,7 +1380,7 @@ int MatchTokenAt_14(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Comment(context, token)) { @@ -1261,6 +1428,15 @@ int MatchTokenAt_14(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Empty(context, token)) { Build(context, token); @@ -1269,7 +1445,7 @@ int MatchTokenAt_14(Token token, ParserContext context) const string stateComment = "State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1291,7 +1467,7 @@ int MatchTokenAt_15(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_TableRow(context, token)) { @@ -1303,7 +1479,7 @@ int MatchTokenAt_15(Token token, ParserContext context) { StartRule(context, RuleType.DocString); Build(context, token); - return 23; + return 46; } if (Match_StepLine(context, token)) { @@ -1351,6 +1527,16 @@ int MatchTokenAt_15(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Comment(context, token)) { Build(context, token); @@ -1364,7 +1550,7 @@ int MatchTokenAt_15(Token token, ParserContext context) const string stateComment = "State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1387,7 +1573,7 @@ int MatchTokenAt_16(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_TableRow(context, token)) { @@ -1445,6 +1631,17 @@ int MatchTokenAt_16(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Comment(context, token)) { Build(context, token); @@ -1458,7 +1655,7 @@ int MatchTokenAt_16(Token token, ParserContext context) const string stateComment = "State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1521,7 +1718,7 @@ int MatchTokenAt_18(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Empty(context, token)) { @@ -1582,6 +1779,17 @@ int MatchTokenAt_18(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Other(context, token)) { StartRule(context, RuleType.Description); @@ -1591,7 +1799,7 @@ int MatchTokenAt_18(Token token, ParserContext context) const string stateComment = "State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"}; + var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1615,7 +1823,7 @@ int MatchTokenAt_19(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Comment(context, token)) { @@ -1677,6 +1885,18 @@ int MatchTokenAt_19(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Other(context, token)) { Build(context, token); @@ -1685,7 +1905,7 @@ int MatchTokenAt_19(Token token, ParserContext context) const string stateComment = "State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"}; + var expectedTokens = new string[] {"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1708,7 +1928,7 @@ int MatchTokenAt_20(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_Comment(context, token)) { @@ -1764,6 +1984,17 @@ int MatchTokenAt_20(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Empty(context, token)) { Build(context, token); @@ -1772,7 +2003,7 @@ int MatchTokenAt_20(Token token, ParserContext context) const string stateComment = "State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1796,7 +2027,7 @@ int MatchTokenAt_21(Token token, ParserContext context) EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); - return 22; + return 41; } if (Match_TableRow(context, token)) { @@ -1850,6 +2081,18 @@ int MatchTokenAt_21(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.ExamplesTable); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Comment(context, token)) { Build(context, token); @@ -1863,7 +2106,7 @@ int MatchTokenAt_21(Token token, ParserContext context) const string stateComment = "State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) @@ -1875,138 +2118,1737 @@ int MatchTokenAt_21(Token token, ParserContext context) } - // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - int MatchTokenAt_23(Token token, ParserContext context) + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0 + int MatchTokenAt_22(Token token, ParserContext context) { - if (Match_DocStringSeparator(context, token)) - { - Build(context, token); - return 24; - } - if (Match_Other(context, token)) + if (Match_EOF(context, token)) { + EndRule(context, RuleType.RuleHeader); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); Build(context, token); - return 23; + return 41; } - - const string stateComment = "State: 23 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; - token.Detach(); - var expectedTokens = new string[] {"#DocStringSeparator", "#Other"}; - var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) - : new UnexpectedTokenException(token, expectedTokens, stateComment); - if (StopAtFirstError) - throw error; - - AddError(context, error); - return 23; - - } - - - // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - int MatchTokenAt_24(Token token, ParserContext context) - { - if (Match_EOF(context, token)) + if (Match_Empty(context, token)) { - EndRule(context, RuleType.DocString); - EndRule(context, RuleType.Step); - EndRule(context, RuleType.Scenario); - EndRule(context, RuleType.ScenarioDefinition); - EndRule(context, RuleType.Feature); Build(context, token); return 22; } - if (Match_StepLine(context, token)) + if (Match_Comment(context, token)) { - EndRule(context, RuleType.DocString); - EndRule(context, RuleType.Step); - StartRule(context, RuleType.Step); Build(context, token); - return 15; + return 24; } - if (Match_TagLine(context, token)) + if (Match_BackgroundLine(context, token)) { - if (LookAhead_0(context, token)) - { - EndRule(context, RuleType.DocString); - EndRule(context, RuleType.Step); - StartRule(context, RuleType.ExamplesDefinition); - StartRule(context, RuleType.Tags); + EndRule(context, RuleType.RuleHeader); + StartRule(context, RuleType.Background); Build(context, token); - return 17; - } + return 25; } if (Match_TagLine(context, token)) { - EndRule(context, RuleType.DocString); - EndRule(context, RuleType.Step); - EndRule(context, RuleType.Scenario); - EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.RuleHeader); StartRule(context, RuleType.ScenarioDefinition); StartRule(context, RuleType.Tags); Build(context, token); - return 11; - } - if (Match_ExamplesLine(context, token)) - { - EndRule(context, RuleType.DocString); - EndRule(context, RuleType.Step); - StartRule(context, RuleType.ExamplesDefinition); - StartRule(context, RuleType.Examples); - Build(context, token); - return 18; + return 30; } if (Match_ScenarioLine(context, token)) { - EndRule(context, RuleType.DocString); - EndRule(context, RuleType.Step); - EndRule(context, RuleType.Scenario); - EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.RuleHeader); StartRule(context, RuleType.ScenarioDefinition); StartRule(context, RuleType.Scenario); Build(context, token); - return 12; + return 31; } - if (Match_Comment(context, token)) + if (Match_RuleLine(context, token)) { + EndRule(context, RuleType.RuleHeader); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); Build(context, token); - return 24; + return 22; } - if (Match_Empty(context, token)) + if (Match_Other(context, token)) { + StartRule(context, RuleType.Description); Build(context, token); - return 24; + return 23; } - const string stateComment = "State: 24 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + const string stateComment = "State: 22 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) throw error; AddError(context, error); - return 24; + return 22; } - // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - int MatchTokenAt_25(Token token, ParserContext context) + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0 + int MatchTokenAt_23(Token token, ParserContext context) { - if (Match_DocStringSeparator(context, token)) + if (Match_EOF(context, token)) { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.RuleHeader); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); Build(context, token); - return 26; + return 41; } - if (Match_Other(context, token)) + if (Match_Comment(context, token)) { + EndRule(context, RuleType.Description); Build(context, token); - return 25; + return 24; } - - const string stateComment = "State: 25 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + if (Match_BackgroundLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.RuleHeader); + StartRule(context, RuleType.Background); + Build(context, token); + return 25; + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.RuleHeader); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.RuleHeader); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.RuleHeader); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Other(context, token)) + { + Build(context, token); + return 23; + } + + const string stateComment = "State: 23 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 23; + + } + + + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0 + int MatchTokenAt_24(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.RuleHeader); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 24; + } + if (Match_BackgroundLine(context, token)) + { + EndRule(context, RuleType.RuleHeader); + StartRule(context, RuleType.Background); + Build(context, token); + return 25; + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.RuleHeader); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.RuleHeader); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.RuleHeader); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 24; + } + + const string stateComment = "State: 24 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 24; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0 + int MatchTokenAt_25(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 25; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 27; + } + if (Match_StepLine(context, token)) + { + StartRule(context, RuleType.Step); + Build(context, token); + return 28; + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Other(context, token)) + { + StartRule(context, RuleType.Description); + Build(context, token); + return 26; + } + + const string stateComment = "State: 25 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 25; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0 + int MatchTokenAt_26(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Comment(context, token)) + { + EndRule(context, RuleType.Description); + Build(context, token); + return 27; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.Description); + StartRule(context, RuleType.Step); + Build(context, token); + return 28; + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Other(context, token)) + { + Build(context, token); + return 26; + } + + const string stateComment = "State: 26 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 26; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0 + int MatchTokenAt_27(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 27; + } + if (Match_StepLine(context, token)) + { + StartRule(context, RuleType.Step); + Build(context, token); + return 28; + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 27; + } + + const string stateComment = "State: 27 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 27; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0 + int MatchTokenAt_28(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_TableRow(context, token)) + { + StartRule(context, RuleType.DataTable); + Build(context, token); + return 29; + } + if (Match_DocStringSeparator(context, token)) + { + StartRule(context, RuleType.DocString); + Build(context, token); + return 44; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.Step); + StartRule(context, RuleType.Step); + Build(context, token); + return 28; + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 28; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 28; + } + + const string stateComment = "State: 28 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 28; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + int MatchTokenAt_29(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_TableRow(context, token)) + { + Build(context, token); + return 29; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.Step); + Build(context, token); + return 28; + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 29; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 29; + } + + const string stateComment = "State: 29 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 29; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0 + int MatchTokenAt_30(Token token, ParserContext context) + { + if (Match_TagLine(context, token)) + { + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Tags); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 30; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 30; + } + + const string stateComment = "State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0"; + token.Detach(); + var expectedTokens = new string[] {"#TagLine", "#ScenarioLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 30; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0 + int MatchTokenAt_31(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 31; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 33; + } + if (Match_StepLine(context, token)) + { + StartRule(context, RuleType.Step); + Build(context, token); + return 34; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Other(context, token)) + { + StartRule(context, RuleType.Description); + Build(context, token); + return 32; + } + + const string stateComment = "State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 31; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0 + int MatchTokenAt_32(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Comment(context, token)) + { + EndRule(context, RuleType.Description); + Build(context, token); + return 33; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.Description); + StartRule(context, RuleType.Step); + Build(context, token); + return 34; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.Description); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.Description); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Other(context, token)) + { + Build(context, token); + return 32; + } + + const string stateComment = "State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 32; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0 + int MatchTokenAt_33(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 33; + } + if (Match_StepLine(context, token)) + { + StartRule(context, RuleType.Step); + Build(context, token); + return 34; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 33; + } + + const string stateComment = "State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 33; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0 + int MatchTokenAt_34(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_TableRow(context, token)) + { + StartRule(context, RuleType.DataTable); + Build(context, token); + return 35; + } + if (Match_DocStringSeparator(context, token)) + { + StartRule(context, RuleType.DocString); + Build(context, token); + return 42; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.Step); + StartRule(context, RuleType.Step); + Build(context, token); + return 34; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.Step); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.Step); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 34; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 34; + } + + const string stateComment = "State: 34 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 34; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + int MatchTokenAt_35(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_TableRow(context, token)) + { + Build(context, token); + return 35; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.Step); + Build(context, token); + return 34; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.DataTable); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 35; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 35; + } + + const string stateComment = "State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 35; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0 + int MatchTokenAt_36(Token token, ParserContext context) + { + if (Match_TagLine(context, token)) + { + Build(context, token); + return 36; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.Tags); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 36; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 36; + } + + const string stateComment = "State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0"; + token.Detach(); + var expectedTokens = new string[] {"#TagLine", "#ExamplesLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 36; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0 + int MatchTokenAt_37(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 37; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 39; + } + if (Match_TableRow(context, token)) + { + StartRule(context, RuleType.ExamplesTable); + Build(context, token); + return 40; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Other(context, token)) + { + StartRule(context, RuleType.Description); + Build(context, token); + return 38; + } + + const string stateComment = "State: 37 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 37; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0 + int MatchTokenAt_38(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Comment(context, token)) + { + EndRule(context, RuleType.Description); + Build(context, token); + return 39; + } + if (Match_TableRow(context, token)) + { + EndRule(context, RuleType.Description); + StartRule(context, RuleType.ExamplesTable); + Build(context, token); + return 40; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Description); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Other(context, token)) + { + Build(context, token); + return 38; + } + + const string stateComment = "State: 38 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 38; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0 + int MatchTokenAt_39(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 39; + } + if (Match_TableRow(context, token)) + { + StartRule(context, RuleType.ExamplesTable); + Build(context, token); + return 40; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 39; + } + + const string stateComment = "State: 39 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 39; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0 + int MatchTokenAt_40(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.ExamplesTable); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_TableRow(context, token)) + { + Build(context, token); + return 40; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.ExamplesTable); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.ExamplesTable); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.ExamplesTable); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.ExamplesTable); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.ExamplesTable); + EndRule(context, RuleType.Examples); + EndRule(context, RuleType.ExamplesDefinition); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 40; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 40; + } + + const string stateComment = "State: 40 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 40; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + int MatchTokenAt_42(Token token, ParserContext context) + { + if (Match_DocStringSeparator(context, token)) + { + Build(context, token); + return 43; + } + if (Match_Other(context, token)) + { + Build(context, token); + return 42; + } + + const string stateComment = "State: 42 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.Detach(); + var expectedTokens = new string[] {"#DocStringSeparator", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 42; + + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + int MatchTokenAt_43(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.Step); + Build(context, token); + return 34; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 36; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 37; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 43; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 43; + } + + const string stateComment = "State: 43 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 43; + + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + int MatchTokenAt_44(Token token, ParserContext context) + { + if (Match_DocStringSeparator(context, token)) + { + Build(context, token); + return 45; + } + if (Match_Other(context, token)) + { + Build(context, token); + return 44; + } + + const string stateComment = "State: 44 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; token.Detach(); var expectedTokens = new string[] {"#DocStringSeparator", "#Other"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) @@ -2015,23 +3857,256 @@ int MatchTokenAt_25(Token token, ParserContext context) throw error; AddError(context, error); - return 25; + return 44; } - // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - int MatchTokenAt_26(Token token, ParserContext context) + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + int MatchTokenAt_45(Token token, ParserContext context) { if (Match_EOF(context, token)) { EndRule(context, RuleType.DocString); EndRule(context, RuleType.Step); EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.Step); + Build(context, token); + return 28; + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 30; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 31; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Rule); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } + if (Match_Comment(context, token)) + { + Build(context, token); + return 45; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 45; + } + + const string stateComment = "State: 45 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 45; + + } + + + // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + int MatchTokenAt_46(Token token, ParserContext context) + { + if (Match_DocStringSeparator(context, token)) + { + Build(context, token); + return 47; + } + if (Match_Other(context, token)) + { + Build(context, token); + return 46; + } + + const string stateComment = "State: 46 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.Detach(); + var expectedTokens = new string[] {"#DocStringSeparator", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 46; + + } + + + // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + int MatchTokenAt_47(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); EndRule(context, RuleType.Feature); Build(context, token); + return 41; + } + if (Match_StepLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.Step); + Build(context, token); + return 15; + } + if (Match_TagLine(context, token)) + { + if (LookAhead_0(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 17; + } + } + if (Match_TagLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Tags); + Build(context, token); + return 11; + } + if (Match_ExamplesLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + StartRule(context, RuleType.ExamplesDefinition); + StartRule(context, RuleType.Examples); + Build(context, token); + return 18; + } + if (Match_ScenarioLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Scenario); + Build(context, token); + return 12; + } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Scenario); + EndRule(context, RuleType.ScenarioDefinition); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); return 22; } + if (Match_Comment(context, token)) + { + Build(context, token); + return 47; + } + if (Match_Empty(context, token)) + { + Build(context, token); + return 47; + } + + const string stateComment = "State: 47 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.Detach(); + var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 47; + + } + + + // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + int MatchTokenAt_48(Token token, ParserContext context) + { + if (Match_DocStringSeparator(context, token)) + { + Build(context, token); + return 49; + } + if (Match_Other(context, token)) + { + Build(context, token); + return 48; + } + + const string stateComment = "State: 48 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.Detach(); + var expectedTokens = new string[] {"#DocStringSeparator", "#Other"}; + var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) + : new UnexpectedTokenException(token, expectedTokens, stateComment); + if (StopAtFirstError) + throw error; + + AddError(context, error); + return 48; + + } + + + // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + int MatchTokenAt_49(Token token, ParserContext context) + { + if (Match_EOF(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + EndRule(context, RuleType.Feature); + Build(context, token); + return 41; + } if (Match_StepLine(context, token)) { EndRule(context, RuleType.DocString); @@ -2060,27 +4135,37 @@ int MatchTokenAt_26(Token token, ParserContext context) Build(context, token); return 12; } + if (Match_RuleLine(context, token)) + { + EndRule(context, RuleType.DocString); + EndRule(context, RuleType.Step); + EndRule(context, RuleType.Background); + StartRule(context, RuleType.Rule); + StartRule(context, RuleType.RuleHeader); + Build(context, token); + return 22; + } if (Match_Comment(context, token)) { Build(context, token); - return 26; + return 49; } if (Match_Empty(context, token)) { Build(context, token); - return 26; + return 49; } - const string stateComment = "State: 26 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + const string stateComment = "State: 49 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; token.Detach(); - var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"}; + var expectedTokens = new string[] {"#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"}; var error = token.IsEOF ? (ParserException)new UnexpectedEOFException(token, expectedTokens, stateComment) : new UnexpectedTokenException(token, expectedTokens, stateComment); if (StopAtFirstError) throw error; AddError(context, error); - return 26; + return 49; } @@ -2138,6 +4223,7 @@ public partial interface ITokenMatcher bool Match_Comment(Token token); bool Match_TagLine(Token token); bool Match_FeatureLine(Token token); + bool Match_RuleLine(Token token); bool Match_BackgroundLine(Token token); bool Match_ScenarioLine(Token token); bool Match_ExamplesLine(Token token); diff --git a/gherkin/dotnet/Gherkin/Pickles/Compiler.cs b/gherkin/dotnet/Gherkin/Pickles/Compiler.cs index bd89ad98dfb..ad2f359e0fd 100644 --- a/gherkin/dotnet/Gherkin/Pickles/Compiler.cs +++ b/gherkin/dotnet/Gherkin/Pickles/Compiler.cs @@ -18,25 +18,40 @@ public List Compile(GherkinDocument gherkinDocument) return pickles; } - var featureTags = feature.Tags; + var language = feature.Language; + var tags = feature.Tags; var backgroundSteps = new PickleStep[0]; - foreach (var stepsContainer in feature.Children) + Build(pickles, language, tags, backgroundSteps, feature); + + return pickles; + } + + protected virtual void Build(List pickles, string language, IEnumerable tags, IEnumerable parentBackgroundSteps, IHasChildren parent) { + IEnumerable backgroundSteps = new List(parentBackgroundSteps); + foreach (var child in parent.Children) { - if (stepsContainer is Background) + if (child is Background) + { + backgroundSteps = backgroundSteps.Concat(PickleSteps((Background)child)); + } + else if (child is Rule) { - backgroundSteps = PickleSteps(stepsContainer); + Build(pickles, language, tags, backgroundSteps, (Rule)child); } - else { - var scenario = (Scenario)stepsContainer; - if(!scenario.Examples.Any()) { - CompileScenario(pickles, backgroundSteps, scenario, featureTags, feature.Language); - } else { - CompileScenarioOutline(pickles, backgroundSteps, scenario, featureTags, feature.Language); + else + { + var scenario = (Scenario)child; + if (!scenario.Examples.Any()) + { + CompileScenario(pickles, backgroundSteps, scenario, tags, language); + } + else + { + CompileScenarioOutline(pickles, backgroundSteps, scenario, tags, language); } } } - return pickles; } protected virtual void CompileScenario(List pickles, IEnumerable backgroundSteps, Scenario scenario, IEnumerable featureTags, string language) diff --git a/gherkin/dotnet/Gherkin/TokenMatcher.cs b/gherkin/dotnet/Gherkin/TokenMatcher.cs index 1b1c9ed6ef4..ab9c8a7e4cd 100644 --- a/gherkin/dotnet/Gherkin/TokenMatcher.cs +++ b/gherkin/dotnet/Gherkin/TokenMatcher.cs @@ -131,6 +131,11 @@ public bool Match_FeatureLine(Token token) return MatchTitleLine(token, TokenType.FeatureLine, CurrentDialect.FeatureKeywords); } + public bool Match_RuleLine(Token token) + { + return MatchTitleLine(token, TokenType.RuleLine, CurrentDialect.RuleKeywords); + } + public bool Match_BackgroundLine(Token token) { return MatchTitleLine(token, TokenType.BackgroundLine, CurrentDialect.BackgroundKeywords); diff --git a/gherkin/dotnet/Gherkin/gherkin-languages.json b/gherkin/dotnet/Gherkin/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/dotnet/Gherkin/gherkin-languages.json +++ b/gherkin/dotnet/Gherkin/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/dotnet/gherkin.berp b/gherkin/dotnet/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/dotnet/gherkin.berp +++ b/gherkin/dotnet/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/dotnet/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/dotnet/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/dotnet/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/dotnet/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/dotnet/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/dotnet/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/dotnet/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/dotnet/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/dotnet/testdata/good/rule.feature b/gherkin/dotnet/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/dotnet/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/dotnet/testdata/good/rule.feature.ast.ndjson b/gherkin/dotnet/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/dotnet/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/dotnet/testdata/good/rule.feature.pickles.ndjson b/gherkin/dotnet/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/dotnet/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/dotnet/testdata/good/rule.feature.source.ndjson b/gherkin/dotnet/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/dotnet/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/dotnet/testdata/good/rule.feature.tokens b/gherkin/dotnet/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/dotnet/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF diff --git a/gherkin/gherkin-languages.json b/gherkin/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/gherkin-languages.json +++ b/gherkin/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/gherkin.berp b/gherkin/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/gherkin.berp +++ b/gherkin/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/go/ast.go b/gherkin/go/ast.go index a39fe2d3149..729326010a4 100644 --- a/gherkin/go/ast.go +++ b/gherkin/go/ast.go @@ -26,6 +26,14 @@ type Feature struct { Children []interface{} `json:"children"` } +type Rule struct { + Node + Keyword string `json:"keyword"` + Name string `json:"name"` + Description string `json:"description,omitempty"` + Children []interface{} `json:"children"` +} + type Comment struct { Node Location *Location `json:"location,omitempty"` diff --git a/gherkin/go/astbuilder.go b/gherkin/go/astbuilder.go index cd83058eee3..fdd6bc341b9 100644 --- a/gherkin/go/astbuilder.go +++ b/gherkin/go/astbuilder.go @@ -257,6 +257,7 @@ func (t *astBuilder) transformNode(node *astNode) (interface{}, error) { children = append(children, background) } children = append(children, node.getItems(RuleType_ScenarioDefinition)...) + children = append(children, node.getItems(RuleType_Rule)...) description, _ := header.getSingle(RuleType_Description).(string) feat := new(Feature) @@ -270,6 +271,32 @@ func (t *astBuilder) transformNode(node *astNode) (interface{}, error) { feat.Children = children return feat, nil + case RuleType_Rule: + header, ok := node.getSingle(RuleType_RuleHeader).(*astNode) + if !ok { + return nil, nil + } + ruleLine := header.getToken(TokenType_RuleLine) + if ruleLine == nil { + return nil, nil + } + children := []interface{}{} + background, _ := node.getSingle(RuleType_Background).(*Background) + if background != nil { + children = append(children, background) + } + children = append(children, node.getItems(RuleType_ScenarioDefinition)...) + description, _ := header.getSingle(RuleType_Description).(string) + + rule := new(Rule) + rule.Type = "Rule" + rule.Location = astLocation(ruleLine) + rule.Keyword = ruleLine.Keyword + rule.Name = ruleLine.Text + rule.Description = description + rule.Children = children + return rule, nil + case RuleType_GherkinDocument: feature, _ := node.getSingle(RuleType_Feature).(*Feature) diff --git a/gherkin/go/dialect.go b/gherkin/go/dialect.go index e8af1e4550b..0fd781af8e0 100644 --- a/gherkin/go/dialect.go +++ b/gherkin/go/dialect.go @@ -11,6 +11,10 @@ func (g *GherkinDialect) FeatureKeywords() []string { return g.Keywords["feature"] } +func (g *GherkinDialect) RuleKeywords() []string { + return g.Keywords["rule"] +} + func (g *GherkinDialect) ScenarioKeywords() []string { return g.Keywords["scenario"] } diff --git a/gherkin/go/dialects_builtin.go b/gherkin/go/dialects_builtin.go index f365281edb7..73ea2b07727 100644 --- a/gherkin/go/dialects_builtin.go +++ b/gherkin/go/dialects_builtin.go @@ -7,6 +7,7 @@ func GherkinDialectsBuildin() GherkinDialectProvider { const ( feature = "feature" + rule = "rule" background = "background" scenario = "scenario" scenarioOutline = "scenarioOutline" @@ -26,6 +27,9 @@ var buildinDialects = gherkinDialectMap{ "Besigheid Behoefte", "Vermoë", }, + rule: []string{ + "Rule", + }, background: []string{ "Agtergrond", }, @@ -67,6 +71,9 @@ var buildinDialects = gherkinDialectMap{ "Ֆունկցիոնալություն", "Հատկություն", }, + rule: []string{ + "Rule", + }, background: []string{ "Կոնտեքստ", }, @@ -108,6 +115,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Caracteristica", }, + rule: []string{ + "Rule", + }, background: []string{ "Antecedents", }, @@ -154,6 +164,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "خاصية", }, + rule: []string{ + "Rule", + }, background: []string{ "الخلفية", }, @@ -196,6 +209,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Carauterística", }, + rule: []string{ + "Rule", + }, background: []string{ "Antecedentes", }, @@ -240,6 +256,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Özəllik", }, + rule: []string{ + "Rule", + }, background: []string{ "Keçmiş", "Kontekst", @@ -285,6 +304,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Функционалност", }, + rule: []string{ + "Rule", + }, background: []string{ "Предистория", }, @@ -325,6 +347,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Fungsi", }, + rule: []string{ + "Rule", + }, background: []string{ "Latar Belakang", }, @@ -372,6 +397,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Karakteristika", }, + rule: []string{ + "Rule", + }, background: []string{ "Pozadina", }, @@ -416,6 +444,9 @@ var buildinDialects = gherkinDialectMap{ "Característica", "Funcionalitat", }, + rule: []string{ + "Rule", + }, background: []string{ "Rerefons", "Antecedents", @@ -461,6 +492,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Požadavek", }, + rule: []string{ + "Rule", + }, background: []string{ "Pozadí", "Kontext", @@ -505,6 +539,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Arwedd", }, + rule: []string{ + "Rule", + }, background: []string{ "Cefndir", }, @@ -545,6 +582,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Egenskab", }, + rule: []string{ + "Rule", + }, background: []string{ "Baggrund", }, @@ -585,6 +625,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Funktionalität", }, + rule: []string{ + "Rule", + }, background: []string{ "Grundlage", }, @@ -628,6 +671,9 @@ var buildinDialects = gherkinDialectMap{ "Δυνατότητα", "Λειτουργία", }, + rule: []string{ + "Rule", + }, background: []string{ "Υπόβαθρο", }, @@ -670,6 +716,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "📚", }, + rule: []string{ + "Rule", + }, background: []string{ "💤", }, @@ -712,6 +761,9 @@ var buildinDialects = gherkinDialectMap{ "Business Need", "Ability", }, + rule: []string{ + "Rule", + }, background: []string{ "Background", }, @@ -754,6 +806,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Feature", }, + rule: []string{ + "Rule", + }, background: []string{ "Dis is what went down", }, @@ -796,6 +851,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Pretty much", }, + rule: []string{ + "Rule", + }, background: []string{ "First off", }, @@ -835,6 +893,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "OH HAI", }, + rule: []string{ + "Rule", + }, background: []string{ "B4", }, @@ -875,6 +936,9 @@ var buildinDialects = gherkinDialectMap{ "Hwaet", "Hwæt", }, + rule: []string{ + "Rule", + }, background: []string{ "Aer", "Ær", @@ -928,6 +992,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Ahoy matey!", }, + rule: []string{ + "Rule", + }, background: []string{ "Yo-ho-ho", }, @@ -967,6 +1034,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Trajto", }, + rule: []string{ + "Rule", + }, background: []string{ "Fono", }, @@ -1011,6 +1081,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Característica", }, + rule: []string{ + "Rule", + }, background: []string{ "Antecedentes", }, @@ -1055,6 +1128,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Omadus", }, + rule: []string{ + "Rule", + }, background: []string{ "Taust", }, @@ -1096,6 +1172,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "وِیژگی", }, + rule: []string{ + "Rule", + }, background: []string{ "زمینه", }, @@ -1136,6 +1215,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Ominaisuus", }, + rule: []string{ + "Rule", + }, background: []string{ "Tausta", }, @@ -1175,6 +1257,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Fonctionnalité", }, + rule: []string{ + "Règle", + }, background: []string{ "Contexte", }, @@ -1234,6 +1319,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Gné", }, + rule: []string{ + "Rule", + }, background: []string{ "Cúlra", }, @@ -1282,6 +1370,9 @@ var buildinDialects = gherkinDialectMap{ "વ્યાપાર જરૂર", "ક્ષમતા", }, + rule: []string{ + "Rule", + }, background: []string{ "બેકગ્રાઉન્ડ", }, @@ -1323,6 +1414,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Característica", }, + rule: []string{ + "Rule", + }, background: []string{ "Contexto", }, @@ -1368,6 +1462,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "תכונה", }, + rule: []string{ + "Rule", + }, background: []string{ "רקע", }, @@ -1409,6 +1506,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "रूप लेख", }, + rule: []string{ + "Rule", + }, background: []string{ "पृष्ठभूमि", }, @@ -1457,6 +1557,9 @@ var buildinDialects = gherkinDialectMap{ "Mogućnost", "Mogucnost", }, + rule: []string{ + "Rule", + }, background: []string{ "Pozadina", }, @@ -1504,6 +1607,9 @@ var buildinDialects = gherkinDialectMap{ "Mak", "Fonksyonalite", }, + rule: []string{ + "Rule", + }, background: []string{ "Kontèks", "Istorik", @@ -1555,6 +1661,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Jellemző", }, + rule: []string{ + "Rule", + }, background: []string{ "Háttér", }, @@ -1598,6 +1707,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Fitur", }, + rule: []string{ + "Rule", + }, background: []string{ "Dasar", }, @@ -1637,6 +1749,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Eiginleiki", }, + rule: []string{ + "Rule", + }, background: []string{ "Bakgrunnur", }, @@ -1678,6 +1793,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Funzionalità", }, + rule: []string{ + "Rule", + }, background: []string{ "Contesto", }, @@ -1722,6 +1840,9 @@ var buildinDialects = gherkinDialectMap{ "フィーチャ", "機能", }, + rule: []string{ + "Rule", + }, background: []string{ "背景", }, @@ -1767,6 +1888,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Fitur", }, + rule: []string{ + "Rule", + }, background: []string{ "Dasar", }, @@ -1812,6 +1936,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "თვისება", }, + rule: []string{ + "Rule", + }, background: []string{ "კონტექსტი", }, @@ -1852,6 +1979,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "ಹೆಚ್ಚಳ", }, + rule: []string{ + "Rule", + }, background: []string{ "ಹಿನ್ನೆಲೆ", }, @@ -1892,6 +2022,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "기능", }, + rule: []string{ + "Rule", + }, background: []string{ "배경", }, @@ -1934,6 +2067,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Savybė", }, + rule: []string{ + "Rule", + }, background: []string{ "Kontekstas", }, @@ -1976,6 +2112,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Funktionalitéit", }, + rule: []string{ + "Rule", + }, background: []string{ "Hannergrond", }, @@ -2019,6 +2158,9 @@ var buildinDialects = gherkinDialectMap{ "Funkcionalitāte", "Fīča", }, + rule: []string{ + "Rule", + }, background: []string{ "Konteksts", "Situācija", @@ -2063,6 +2205,9 @@ var buildinDialects = gherkinDialectMap{ "Бизнис потреба", "Можност", }, + rule: []string{ + "Rule", + }, background: []string{ "Контекст", "Содржина", @@ -2111,6 +2256,9 @@ var buildinDialects = gherkinDialectMap{ "Biznis potreba", "Mozhnost", }, + rule: []string{ + "Rule", + }, background: []string{ "Kontekst", "Sodrzhina", @@ -2157,6 +2305,9 @@ var buildinDialects = gherkinDialectMap{ "Функц", "Функционал", }, + rule: []string{ + "Rule", + }, background: []string{ "Агуулга", }, @@ -2200,6 +2351,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Functionaliteit", }, + rule: []string{ + "Rule", + }, background: []string{ "Achtergrond", }, @@ -2242,6 +2396,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Egenskap", }, + rule: []string{ + "Regel", + }, background: []string{ "Bakgrunn", }, @@ -2285,6 +2442,9 @@ var buildinDialects = gherkinDialectMap{ "ਮੁਹਾਂਦਰਾ", "ਨਕਸ਼ ਨੁਹਾਰ", }, + rule: []string{ + "Rule", + }, background: []string{ "ਪਿਛੋਕੜ", }, @@ -2330,6 +2490,9 @@ var buildinDialects = gherkinDialectMap{ "Aspekt", "Potrzeba biznesowa", }, + rule: []string{ + "Rule", + }, background: []string{ "Założenia", }, @@ -2378,6 +2541,9 @@ var buildinDialects = gherkinDialectMap{ "Característica", "Caracteristica", }, + rule: []string{ + "Rule", + }, background: []string{ "Contexto", "Cenário de Fundo", @@ -2433,6 +2599,9 @@ var buildinDialects = gherkinDialectMap{ "Funcționalitate", "Funcţionalitate", }, + rule: []string{ + "Rule", + }, background: []string{ "Context", }, @@ -2485,6 +2654,9 @@ var buildinDialects = gherkinDialectMap{ "Функционал", "Свойство", }, + rule: []string{ + "Rule", + }, background: []string{ "Предыстория", "Контекст", @@ -2537,6 +2709,9 @@ var buildinDialects = gherkinDialectMap{ "Funkcia", "Vlastnosť", }, + rule: []string{ + "Rule", + }, background: []string{ "Pozadie", }, @@ -2590,6 +2765,9 @@ var buildinDialects = gherkinDialectMap{ "Lastnost", "Značilnost", }, + rule: []string{ + "Rule", + }, background: []string{ "Kontekst", "Osnova", @@ -2645,6 +2823,9 @@ var buildinDialects = gherkinDialectMap{ "Могућност", "Особина", }, + rule: []string{ + "Rule", + }, background: []string{ "Контекст", "Основа", @@ -2697,6 +2878,9 @@ var buildinDialects = gherkinDialectMap{ "Mogucnost", "Osobina", }, + rule: []string{ + "Rule", + }, background: []string{ "Kontekst", "Osnova", @@ -2745,6 +2929,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Egenskap", }, + rule: []string{ + "Rule", + }, background: []string{ "Bakgrund", }, @@ -2787,6 +2974,9 @@ var buildinDialects = gherkinDialectMap{ "வணிக தேவை", "திறன்", }, + rule: []string{ + "Rule", + }, background: []string{ "பின்னணி", }, @@ -2833,6 +3023,9 @@ var buildinDialects = gherkinDialectMap{ "ความต้องการทางธุรกิจ", "ความสามารถ", }, + rule: []string{ + "Rule", + }, background: []string{ "แนวคิด", }, @@ -2874,6 +3067,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "గుణము", }, + rule: []string{ + "Rule", + }, background: []string{ "నేపథ్యం", }, @@ -2918,6 +3114,9 @@ var buildinDialects = gherkinDialectMap{ "poQbogh malja'", "laH", }, + rule: []string{ + "Rule", + }, background: []string{ "mo'", }, @@ -2961,6 +3160,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Özellik", }, + rule: []string{ + "Rule", + }, background: []string{ "Geçmiş", }, @@ -3003,6 +3205,9 @@ var buildinDialects = gherkinDialectMap{ "Мөмкинлек", "Үзенчәлеклелек", }, + rule: []string{ + "Rule", + }, background: []string{ "Кереш", }, @@ -3045,6 +3250,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Функціонал", }, + rule: []string{ + "Rule", + }, background: []string{ "Передумова", }, @@ -3094,6 +3302,9 @@ var buildinDialects = gherkinDialectMap{ "کاروبار کی ضرورت", "خصوصیت", }, + rule: []string{ + "Rule", + }, background: []string{ "پس منظر", }, @@ -3136,6 +3347,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Функционал", }, + rule: []string{ + "Rule", + }, background: []string{ "Тарих", }, @@ -3177,6 +3391,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "Tính năng", }, + rule: []string{ + "Rule", + }, background: []string{ "Bối cảnh", }, @@ -3219,6 +3436,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "功能", }, + rule: []string{ + "Rule", + }, background: []string{ "背景", }, @@ -3264,6 +3484,9 @@ var buildinDialects = gherkinDialectMap{ feature: []string{ "功能", }, + rule: []string{ + "Rule", + }, background: []string{ "背景", }, diff --git a/gherkin/go/dialects_builtin.go.jq b/gherkin/go/dialects_builtin.go.jq index f6129002f7f..6ac0eaa9317 100644 --- a/gherkin/go/dialects_builtin.go.jq +++ b/gherkin/go/dialects_builtin.go.jq @@ -6,7 +6,7 @@ "\t\t", (.key|@json),", ", (.value.name|@json),", ", (.value.native|@json), ", map[string][]string{\n" ] + ( [ .value - | {"feature","background","scenario","scenarioOutline","examples","given","when","then","and","but"} + | {"feature","rule","background","scenario","scenarioOutline","examples","given","when","then","and","but"} | to_entries[] | "\t\t\t"+(.key), ": []string{\n", ([ .value[] | "\t\t\t\t", @json, ",\n" ]|add), @@ -24,7 +24,7 @@ + "}\n\n" + "const (\n" + ( - ["feature","background","scenario","scenarioOutline","examples","given","when","then","and","but"] + ["feature","rule","background","scenario","scenarioOutline","examples","given","when","then","and","but"] | [ .[] | "\t" + . + " = " + (.|@json) + "\n" ] | add ) + ")\n\n" diff --git a/gherkin/go/gherkin-languages.json b/gherkin/go/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/go/gherkin-languages.json +++ b/gherkin/go/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/go/gherkin.berp b/gherkin/go/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/go/gherkin.berp +++ b/gherkin/go/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/go/matcher.go b/gherkin/go/matcher.go index 8110f0e3fcb..f08f4a6859a 100644 --- a/gherkin/go/matcher.go +++ b/gherkin/go/matcher.go @@ -127,6 +127,9 @@ func (m *matcher) matchTitleLine(line *Line, tokenType TokenType, keywords []str func (m *matcher) MatchFeatureLine(line *Line) (ok bool, token *Token, err error) { return m.matchTitleLine(line, TokenType_FeatureLine, m.dialect.FeatureKeywords()) } +func (m *matcher) MatchRuleLine(line *Line) (ok bool, token *Token, err error) { + return m.matchTitleLine(line, TokenType_RuleLine, m.dialect.RuleKeywords()) +} func (m *matcher) MatchBackgroundLine(line *Line) (ok bool, token *Token, err error) { return m.matchTitleLine(line, TokenType_BackgroundLine, m.dialect.BackgroundKeywords()) } diff --git a/gherkin/go/parser.go b/gherkin/go/parser.go index b4b91ae0aa6..d452fe7a73c 100644 --- a/gherkin/go/parser.go +++ b/gherkin/go/parser.go @@ -18,6 +18,7 @@ const ( TokenType_Comment TokenType_TagLine TokenType_FeatureLine + TokenType_RuleLine TokenType_BackgroundLine TokenType_ScenarioLine TokenType_ExamplesLine @@ -44,6 +45,8 @@ func (t TokenType) Name() string { return "TagLine" case TokenType_FeatureLine: return "FeatureLine" + case TokenType_RuleLine: + return "RuleLine" case TokenType_BackgroundLine: return "BackgroundLine" case TokenType_ScenarioLine: @@ -76,6 +79,8 @@ func (t TokenType) RuleType() RuleType { return RuleType__TagLine case TokenType_FeatureLine: return RuleType__FeatureLine + case TokenType_RuleLine: + return RuleType__RuleLine case TokenType_BackgroundLine: return RuleType__BackgroundLine case TokenType_ScenarioLine: @@ -106,6 +111,7 @@ const ( RuleType__Comment RuleType__TagLine RuleType__FeatureLine + RuleType__RuleLine RuleType__BackgroundLine RuleType__ScenarioLine RuleType__ExamplesLine @@ -117,6 +123,8 @@ const ( RuleType_GherkinDocument RuleType_Feature RuleType_FeatureHeader + RuleType_Rule + RuleType_RuleHeader RuleType_Background RuleType_ScenarioDefinition RuleType_Scenario @@ -147,6 +155,8 @@ func (t RuleType) Name() string { return "#TagLine" case RuleType__FeatureLine: return "#FeatureLine" + case RuleType__RuleLine: + return "#RuleLine" case RuleType__BackgroundLine: return "#BackgroundLine" case RuleType__ScenarioLine: @@ -169,6 +179,10 @@ func (t RuleType) Name() string { return "Feature" case RuleType_FeatureHeader: return "FeatureHeader" + case RuleType_Rule: + return "Rule" + case RuleType_RuleHeader: + return "RuleHeader" case RuleType_Background: return "Background" case RuleType_ScenarioDefinition: @@ -352,6 +366,8 @@ func (ctxt *parseContext) match(state int, line *Line) (newState int, err error) return ctxt.matchAt_20(line) case 21: return ctxt.matchAt_21(line) + case 22: + return ctxt.matchAt_22(line) case 23: return ctxt.matchAt_23(line) case 24: @@ -360,6 +376,50 @@ func (ctxt *parseContext) match(state int, line *Line) (newState int, err error) return ctxt.matchAt_25(line) case 26: return ctxt.matchAt_26(line) + case 27: + return ctxt.matchAt_27(line) + case 28: + return ctxt.matchAt_28(line) + case 29: + return ctxt.matchAt_29(line) + case 30: + return ctxt.matchAt_30(line) + case 31: + return ctxt.matchAt_31(line) + case 32: + return ctxt.matchAt_32(line) + case 33: + return ctxt.matchAt_33(line) + case 34: + return ctxt.matchAt_34(line) + case 35: + return ctxt.matchAt_35(line) + case 36: + return ctxt.matchAt_36(line) + case 37: + return ctxt.matchAt_37(line) + case 38: + return ctxt.matchAt_38(line) + case 39: + return ctxt.matchAt_39(line) + case 40: + return ctxt.matchAt_40(line) + case 42: + return ctxt.matchAt_42(line) + case 43: + return ctxt.matchAt_43(line) + case 44: + return ctxt.matchAt_44(line) + case 45: + return ctxt.matchAt_45(line) + case 46: + return ctxt.matchAt_46(line) + case 47: + return ctxt.matchAt_47(line) + case 48: + return ctxt.matchAt_48(line) + case 49: + return ctxt.matchAt_49(line) default: return state, fmt.Errorf("Unknown state: %+v", state) } @@ -369,7 +429,7 @@ func (ctxt *parseContext) match(state int, line *Line) (newState int, err error) func (ctxt *parseContext) matchAt_0(line *Line) (newState int, err error) { if ok, token, err := ctxt.match_EOF(line); ok { ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Language(line); ok { ctxt.startRule(RuleType_Feature) @@ -499,7 +559,7 @@ func (ctxt *parseContext) matchAt_3(line *Line) (newState int, err error) { ctxt.endRule(RuleType_FeatureHeader) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) @@ -529,6 +589,13 @@ func (ctxt *parseContext) matchAt_3(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_FeatureHeader) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { ctxt.startRule(RuleType_Description) ctxt.build(token) @@ -536,7 +603,7 @@ func (ctxt *parseContext) matchAt_3(line *Line) (newState int, err error) { } // var stateComment = "State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0" - var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"} + var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -560,7 +627,7 @@ func (ctxt *parseContext) matchAt_4(line *Line) (newState int, err error) { ctxt.endRule(RuleType_FeatureHeader) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.endRule(RuleType_Description) @@ -590,13 +657,21 @@ func (ctxt *parseContext) matchAt_4(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_FeatureHeader) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { ctxt.build(token) return 4, err } // var stateComment = "State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0" - var expectedTokens = []string{"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"} + var expectedTokens = []string{"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -619,7 +694,7 @@ func (ctxt *parseContext) matchAt_5(line *Line) (newState int, err error) { ctxt.endRule(RuleType_FeatureHeader) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) @@ -645,13 +720,20 @@ func (ctxt *parseContext) matchAt_5(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_FeatureHeader) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) return 5, err } // var stateComment = "State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0" - var expectedTokens = []string{"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Empty"} + var expectedTokens = []string{"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -674,7 +756,7 @@ func (ctxt *parseContext) matchAt_6(line *Line) (newState int, err error) { ctxt.endRule(RuleType_Background) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) @@ -703,6 +785,13 @@ func (ctxt *parseContext) matchAt_6(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { ctxt.startRule(RuleType_Description) ctxt.build(token) @@ -710,7 +799,7 @@ func (ctxt *parseContext) matchAt_6(line *Line) (newState int, err error) { } // var stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0" - var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"} + var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -734,7 +823,7 @@ func (ctxt *parseContext) matchAt_7(line *Line) (newState int, err error) { ctxt.endRule(RuleType_Background) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.endRule(RuleType_Description) @@ -763,13 +852,21 @@ func (ctxt *parseContext) matchAt_7(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { ctxt.build(token) return 7, err } // var stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0" - var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"} + var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -792,7 +889,7 @@ func (ctxt *parseContext) matchAt_8(line *Line) (newState int, err error) { ctxt.endRule(RuleType_Background) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) @@ -817,13 +914,20 @@ func (ctxt *parseContext) matchAt_8(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) return 8, err } // var stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0" - var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Empty"} + var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -847,7 +951,7 @@ func (ctxt *parseContext) matchAt_9(line *Line) (newState int, err error) { ctxt.endRule(RuleType_Background) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_TableRow(line); ok { ctxt.startRule(RuleType_DataTable) @@ -857,7 +961,7 @@ func (ctxt *parseContext) matchAt_9(line *Line) (newState int, err error) { if ok, token, err := ctxt.match_DocStringSeparator(line); ok { ctxt.startRule(RuleType_DocString) ctxt.build(token) - return 25, err + return 48, err } if ok, token, err := ctxt.match_StepLine(line); ok { ctxt.endRule(RuleType_Step) @@ -881,6 +985,14 @@ func (ctxt *parseContext) matchAt_9(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) return 9, err @@ -891,7 +1003,7 @@ func (ctxt *parseContext) matchAt_9(line *Line) (newState int, err error) { } // var stateComment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0" - var expectedTokens = []string{"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"} + var expectedTokens = []string{"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -916,7 +1028,7 @@ func (ctxt *parseContext) matchAt_10(line *Line) (newState int, err error) { ctxt.endRule(RuleType_Background) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_TableRow(line); ok { ctxt.build(token) @@ -947,6 +1059,15 @@ func (ctxt *parseContext) matchAt_10(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) return 10, err @@ -957,7 +1078,7 @@ func (ctxt *parseContext) matchAt_10(line *Line) (newState int, err error) { } // var stateComment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0" - var expectedTokens = []string{"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"} + var expectedTokens = []string{"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1020,7 +1141,7 @@ func (ctxt *parseContext) matchAt_12(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) @@ -1065,6 +1186,14 @@ func (ctxt *parseContext) matchAt_12(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { ctxt.startRule(RuleType_Description) ctxt.build(token) @@ -1072,7 +1201,7 @@ func (ctxt *parseContext) matchAt_12(line *Line) (newState int, err error) { } // var stateComment = "State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0" - var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"} + var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1097,7 +1226,7 @@ func (ctxt *parseContext) matchAt_13(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.endRule(RuleType_Description) @@ -1144,13 +1273,22 @@ func (ctxt *parseContext) matchAt_13(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { ctxt.build(token) return 13, err } // var stateComment = "State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0" - var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"} + var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1174,7 +1312,7 @@ func (ctxt *parseContext) matchAt_14(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) @@ -1215,13 +1353,21 @@ func (ctxt *parseContext) matchAt_14(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) return 14, err } // var stateComment = "State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0" - var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"} + var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1246,7 +1392,7 @@ func (ctxt *parseContext) matchAt_15(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_TableRow(line); ok { ctxt.startRule(RuleType_DataTable) @@ -1256,7 +1402,7 @@ func (ctxt *parseContext) matchAt_15(line *Line) (newState int, err error) { if ok, token, err := ctxt.match_DocStringSeparator(line); ok { ctxt.startRule(RuleType_DocString) ctxt.build(token) - return 23, err + return 46, err } if ok, token, err := ctxt.match_StepLine(line); ok { ctxt.endRule(RuleType_Step) @@ -1298,6 +1444,15 @@ func (ctxt *parseContext) matchAt_15(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) return 15, err @@ -1308,7 +1463,7 @@ func (ctxt *parseContext) matchAt_15(line *Line) (newState int, err error) { } // var stateComment = "State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0" - var expectedTokens = []string{"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"} + var expectedTokens = []string{"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1334,7 +1489,7 @@ func (ctxt *parseContext) matchAt_16(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_TableRow(line); ok { ctxt.build(token) @@ -1385,6 +1540,16 @@ func (ctxt *parseContext) matchAt_16(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) return 16, err @@ -1395,7 +1560,7 @@ func (ctxt *parseContext) matchAt_16(line *Line) (newState int, err error) { } // var stateComment = "State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0" - var expectedTokens = []string{"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"} + var expectedTokens = []string{"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1460,7 +1625,7 @@ func (ctxt *parseContext) matchAt_18(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) @@ -1513,6 +1678,16 @@ func (ctxt *parseContext) matchAt_18(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { ctxt.startRule(RuleType_Description) ctxt.build(token) @@ -1520,7 +1695,7 @@ func (ctxt *parseContext) matchAt_18(line *Line) (newState int, err error) { } // var stateComment = "State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0" - var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"} + var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1547,7 +1722,7 @@ func (ctxt *parseContext) matchAt_19(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.endRule(RuleType_Description) @@ -1602,13 +1777,24 @@ func (ctxt *parseContext) matchAt_19(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { ctxt.build(token) return 19, err } // var stateComment = "State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0" - var expectedTokens = []string{"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"} + var expectedTokens = []string{"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1634,7 +1820,7 @@ func (ctxt *parseContext) matchAt_20(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) @@ -1683,13 +1869,23 @@ func (ctxt *parseContext) matchAt_20(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) return 20, err } // var stateComment = "State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0" - var expectedTokens = []string{"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"} + var expectedTokens = []string{"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1716,7 +1912,7 @@ func (ctxt *parseContext) matchAt_21(line *Line) (newState int, err error) { ctxt.endRule(RuleType_ScenarioDefinition) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } if ok, token, err := ctxt.match_TableRow(line); ok { ctxt.build(token) @@ -1764,6 +1960,17 @@ func (ctxt *parseContext) matchAt_21(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_ExamplesTable) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) return 21, err @@ -1774,7 +1981,7 @@ func (ctxt *parseContext) matchAt_21(line *Line) (newState int, err error) { } // var stateComment = "State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0" - var expectedTokens = []string{"#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"} + var expectedTokens = []string{"#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1791,19 +1998,59 @@ func (ctxt *parseContext) matchAt_21(line *Line) (newState int, err error) { return 21, err } -// GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 -func (ctxt *parseContext) matchAt_23(line *Line) (newState int, err error) { - if ok, token, err := ctxt.match_DocStringSeparator(line); ok { +// GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0 +func (ctxt *parseContext) matchAt_22(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) return 24, err } + if ok, token, err := ctxt.match_BackgroundLine(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.startRule(RuleType_Background) + ctxt.build(token) + return 25, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Other(line); ok { + ctxt.startRule(RuleType_Description) ctxt.build(token) return 23, err } - // var stateComment = "State: 23 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" - var expectedTokens = []string{"#DocStringSeparator", "#Other"} + // var stateComment = "State: 22 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0" + var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1817,76 +2064,63 @@ func (ctxt *parseContext) matchAt_23(line *Line) (newState int, err error) { } // if (ctxt.p.stopAtFirstError) throw error; //ctxt.addError(err) - return 23, err + return 22, err } -// GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 -func (ctxt *parseContext) matchAt_24(line *Line) (newState int, err error) { +// GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0 +func (ctxt *parseContext) matchAt_23(line *Line) (newState int, err error) { if ok, token, err := ctxt.match_EOF(line); ok { - ctxt.endRule(RuleType_DocString) - ctxt.endRule(RuleType_Step) - ctxt.endRule(RuleType_Scenario) - ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_RuleHeader) + ctxt.endRule(RuleType_Rule) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } - if ok, token, err := ctxt.match_StepLine(line); ok { - ctxt.endRule(RuleType_DocString) - ctxt.endRule(RuleType_Step) - ctxt.startRule(RuleType_Step) + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.endRule(RuleType_Description) ctxt.build(token) - return 15, err + return 24, err } - if ok, token, err := ctxt.match_TagLine(line); ok { - if ctxt.lookahead_0(line) { - ctxt.endRule(RuleType_DocString) - ctxt.endRule(RuleType_Step) - ctxt.startRule(RuleType_ExamplesDefinition) - ctxt.startRule(RuleType_Tags) - ctxt.build(token) - return 17, err - } + if ok, token, err := ctxt.match_BackgroundLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_RuleHeader) + ctxt.startRule(RuleType_Background) + ctxt.build(token) + return 25, err } if ok, token, err := ctxt.match_TagLine(line); ok { - ctxt.endRule(RuleType_DocString) - ctxt.endRule(RuleType_Step) - ctxt.endRule(RuleType_Scenario) - ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_RuleHeader) ctxt.startRule(RuleType_ScenarioDefinition) ctxt.startRule(RuleType_Tags) ctxt.build(token) - return 11, err - } - if ok, token, err := ctxt.match_ExamplesLine(line); ok { - ctxt.endRule(RuleType_DocString) - ctxt.endRule(RuleType_Step) - ctxt.startRule(RuleType_ExamplesDefinition) - ctxt.startRule(RuleType_Examples) - ctxt.build(token) - return 18, err + return 30, err } if ok, token, err := ctxt.match_ScenarioLine(line); ok { - ctxt.endRule(RuleType_DocString) - ctxt.endRule(RuleType_Step) - ctxt.endRule(RuleType_Scenario) - ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_RuleHeader) ctxt.startRule(RuleType_ScenarioDefinition) ctxt.startRule(RuleType_Scenario) ctxt.build(token) - return 12, err + return 31, err } - if ok, token, err := ctxt.match_Comment(line); ok { + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_RuleHeader) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) ctxt.build(token) - return 24, err + return 22, err } - if ok, token, err := ctxt.match_Empty(line); ok { + if ok, token, err := ctxt.match_Other(line); ok { ctxt.build(token) - return 24, err + return 23, err } - // var stateComment = "State: 24 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" - var expectedTokens = []string{"#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"} + // var stateComment = "State: 23 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0" + var expectedTokens = []string{"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1900,22 +2134,57 @@ func (ctxt *parseContext) matchAt_24(line *Line) (newState int, err error) { } // if (ctxt.p.stopAtFirstError) throw error; //ctxt.addError(err) - return 24, err + return 23, err } -// GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 -func (ctxt *parseContext) matchAt_25(line *Line) (newState int, err error) { - if ok, token, err := ctxt.match_DocStringSeparator(line); ok { +// GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0 +func (ctxt *parseContext) matchAt_24(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 26, err + return 41, err } - if ok, token, err := ctxt.match_Other(line); ok { + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 24, err + } + if ok, token, err := ctxt.match_BackgroundLine(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.startRule(RuleType_Background) ctxt.build(token) return 25, err } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_RuleHeader) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 24, err + } - // var stateComment = "State: 25 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" - var expectedTokens = []string{"#DocStringSeparator", "#Other"} + // var stateComment = "State: 24 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0" + var expectedTokens = []string{"#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1929,25 +2198,1678 @@ func (ctxt *parseContext) matchAt_25(line *Line) (newState int, err error) { } // if (ctxt.p.stopAtFirstError) throw error; //ctxt.addError(err) - return 25, err + return 24, err } -// GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 -func (ctxt *parseContext) matchAt_26(line *Line) (newState int, err error) { +// GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0 +func (ctxt *parseContext) matchAt_25(line *Line) (newState int, err error) { if ok, token, err := ctxt.match_EOF(line); ok { - ctxt.endRule(RuleType_DocString) - ctxt.endRule(RuleType_Step) ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) ctxt.endRule(RuleType_Feature) ctxt.build(token) - return 22, err + return 41, err } - if ok, token, err := ctxt.match_StepLine(line); ok { - ctxt.endRule(RuleType_DocString) - ctxt.endRule(RuleType_Step) - ctxt.startRule(RuleType_Step) + if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) - return 9, err + return 25, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 27, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 28, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.startRule(RuleType_Description) + ctxt.build(token) + return 26, err + } + + // var stateComment = "State: 25 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0" + var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 25, err +} + +// GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0 +func (ctxt *parseContext) matchAt_26(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.build(token) + return 27, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 28, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.build(token) + return 26, err + } + + // var stateComment = "State: 26 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0" + var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 26, err +} + +// GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0 +func (ctxt *parseContext) matchAt_27(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 27, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 28, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 27, err + } + + // var stateComment = "State: 27 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0" + var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 27, err +} + +// GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0 +func (ctxt *parseContext) matchAt_28(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_TableRow(line); ok { + ctxt.startRule(RuleType_DataTable) + ctxt.build(token) + return 29, err + } + if ok, token, err := ctxt.match_DocStringSeparator(line); ok { + ctxt.startRule(RuleType_DocString) + ctxt.build(token) + return 44, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 28, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 28, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 28, err + } + + // var stateComment = "State: 28 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0" + var expectedTokens = []string{"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 28, err +} + +// GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 +func (ctxt *parseContext) matchAt_29(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_TableRow(line); ok { + ctxt.build(token) + return 29, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 28, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 29, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 29, err + } + + // var stateComment = "State: 29 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0" + var expectedTokens = []string{"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 29, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0 +func (ctxt *parseContext) matchAt_30(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Tags) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 30, err + } + + // var stateComment = "State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0" + var expectedTokens = []string{"#TagLine", "#ScenarioLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 30, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0 +func (ctxt *parseContext) matchAt_31(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 33, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 34, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.startRule(RuleType_Description) + ctxt.build(token) + return 32, err + } + + // var stateComment = "State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0" + var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 31, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0 +func (ctxt *parseContext) matchAt_32(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.build(token) + return 33, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 34, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_Description) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.build(token) + return 32, err + } + + // var stateComment = "State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0" + var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 32, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0 +func (ctxt *parseContext) matchAt_33(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 33, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 34, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 33, err + } + + // var stateComment = "State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0" + var expectedTokens = []string{"#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 33, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0 +func (ctxt *parseContext) matchAt_34(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_TableRow(line); ok { + ctxt.startRule(RuleType_DataTable) + ctxt.build(token) + return 35, err + } + if ok, token, err := ctxt.match_DocStringSeparator(line); ok { + ctxt.startRule(RuleType_DocString) + ctxt.build(token) + return 42, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 34, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 34, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 34, err + } + + // var stateComment = "State: 34 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0" + var expectedTokens = []string{"#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 34, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 +func (ctxt *parseContext) matchAt_35(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_TableRow(line); ok { + ctxt.build(token) + return 35, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 34, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_DataTable) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 35, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 35, err + } + + // var stateComment = "State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0" + var expectedTokens = []string{"#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 35, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0 +func (ctxt *parseContext) matchAt_36(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.build(token) + return 36, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_Tags) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 36, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 36, err + } + + // var stateComment = "State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0" + var expectedTokens = []string{"#TagLine", "#ExamplesLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 36, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0 +func (ctxt *parseContext) matchAt_37(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 39, err + } + if ok, token, err := ctxt.match_TableRow(line); ok { + ctxt.startRule(RuleType_ExamplesTable) + ctxt.build(token) + return 40, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.startRule(RuleType_Description) + ctxt.build(token) + return 38, err + } + + // var stateComment = "State: 37 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0" + var expectedTokens = []string{"#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 37, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0 +func (ctxt *parseContext) matchAt_38(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.build(token) + return 39, err + } + if ok, token, err := ctxt.match_TableRow(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.startRule(RuleType_ExamplesTable) + ctxt.build(token) + return 40, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Description) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.build(token) + return 38, err + } + + // var stateComment = "State: 38 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0" + var expectedTokens = []string{"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 38, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0 +func (ctxt *parseContext) matchAt_39(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 39, err + } + if ok, token, err := ctxt.match_TableRow(line); ok { + ctxt.startRule(RuleType_ExamplesTable) + ctxt.build(token) + return 40, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 39, err + } + + // var stateComment = "State: 39 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0" + var expectedTokens = []string{"#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 39, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0 +func (ctxt *parseContext) matchAt_40(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_ExamplesTable) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_TableRow(line); ok { + ctxt.build(token) + return 40, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_ExamplesTable) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_ExamplesTable) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_ExamplesTable) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_ExamplesTable) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_ExamplesTable) + ctxt.endRule(RuleType_Examples) + ctxt.endRule(RuleType_ExamplesDefinition) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 40, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 40, err + } + + // var stateComment = "State: 40 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0" + var expectedTokens = []string{"#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 40, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 +func (ctxt *parseContext) matchAt_42(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_DocStringSeparator(line); ok { + ctxt.build(token) + return 43, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.build(token) + return 42, err + } + + // var stateComment = "State: 42 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + var expectedTokens = []string{"#DocStringSeparator", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 42, err +} + +// GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 +func (ctxt *parseContext) matchAt_43(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 34, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 36, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 37, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 43, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 43, err + } + + // var stateComment = "State: 43 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + var expectedTokens = []string{"#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 43, err +} + +// GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 +func (ctxt *parseContext) matchAt_44(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_DocStringSeparator(line); ok { + ctxt.build(token) + return 45, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.build(token) + return 44, err + } + + // var stateComment = "State: 44 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + var expectedTokens = []string{"#DocStringSeparator", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 44, err +} + +// GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 +func (ctxt *parseContext) matchAt_45(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 28, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 30, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 31, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Rule) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 45, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 45, err + } + + // var stateComment = "State: 45 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + var expectedTokens = []string{"#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 45, err +} + +// GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 +func (ctxt *parseContext) matchAt_46(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_DocStringSeparator(line); ok { + ctxt.build(token) + return 47, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.build(token) + return 46, err + } + + // var stateComment = "State: 46 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + var expectedTokens = []string{"#DocStringSeparator", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 46, err +} + +// GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 +func (ctxt *parseContext) matchAt_47(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 15, err + } + if ok, token, err := ctxt.match_TagLine(line); ok { + if ctxt.lookahead_0(line) { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 17, err + } + } + if ok, token, err := ctxt.match_TagLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Tags) + ctxt.build(token) + return 11, err + } + if ok, token, err := ctxt.match_ExamplesLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_ExamplesDefinition) + ctxt.startRule(RuleType_Examples) + ctxt.build(token) + return 18, err + } + if ok, token, err := ctxt.match_ScenarioLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Scenario) + ctxt.build(token) + return 12, err + } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Scenario) + ctxt.endRule(RuleType_ScenarioDefinition) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } + if ok, token, err := ctxt.match_Comment(line); ok { + ctxt.build(token) + return 47, err + } + if ok, token, err := ctxt.match_Empty(line); ok { + ctxt.build(token) + return 47, err + } + + // var stateComment = "State: 47 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + var expectedTokens = []string{"#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 47, err +} + +// GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 +func (ctxt *parseContext) matchAt_48(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_DocStringSeparator(line); ok { + ctxt.build(token) + return 49, err + } + if ok, token, err := ctxt.match_Other(line); ok { + ctxt.build(token) + return 48, err + } + + // var stateComment = "State: 48 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + var expectedTokens = []string{"#DocStringSeparator", "#Other"} + if line.IsEof() { + err = &parseError{ + msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), + loc: &Location{Line: line.LineNumber, Column: 0}, + } + } else { + err = &parseError{ + msg: fmt.Sprintf("expected: %s, got '%s'", strings.Join(expectedTokens, ", "), line.LineText), + loc: &Location{Line: line.LineNumber, Column: line.Indent() + 1}, + } + } + // if (ctxt.p.stopAtFirstError) throw error; + //ctxt.addError(err) + return 48, err +} + +// GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 +func (ctxt *parseContext) matchAt_49(line *Line) (newState int, err error) { + if ok, token, err := ctxt.match_EOF(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.endRule(RuleType_Feature) + ctxt.build(token) + return 41, err + } + if ok, token, err := ctxt.match_StepLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.startRule(RuleType_Step) + ctxt.build(token) + return 9, err } if ok, token, err := ctxt.match_TagLine(line); ok { ctxt.endRule(RuleType_DocString) @@ -1967,17 +3889,26 @@ func (ctxt *parseContext) matchAt_26(line *Line) (newState int, err error) { ctxt.build(token) return 12, err } + if ok, token, err := ctxt.match_RuleLine(line); ok { + ctxt.endRule(RuleType_DocString) + ctxt.endRule(RuleType_Step) + ctxt.endRule(RuleType_Background) + ctxt.startRule(RuleType_Rule) + ctxt.startRule(RuleType_RuleHeader) + ctxt.build(token) + return 22, err + } if ok, token, err := ctxt.match_Comment(line); ok { ctxt.build(token) - return 26, err + return 49, err } if ok, token, err := ctxt.match_Empty(line); ok { ctxt.build(token) - return 26, err + return 49, err } - // var stateComment = "State: 26 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" - var expectedTokens = []string{"#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"} + // var stateComment = "State: 49 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + var expectedTokens = []string{"#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"} if line.IsEof() { err = &parseError{ msg: fmt.Sprintf("unexpected end of file, expected: %s", strings.Join(expectedTokens, ", ")), @@ -1991,7 +3922,7 @@ func (ctxt *parseContext) matchAt_26(line *Line) (newState int, err error) { } // if (ctxt.p.stopAtFirstError) throw error; //ctxt.addError(err) - return 26, err + return 49, err } type Matcher interface { @@ -2000,6 +3931,7 @@ type Matcher interface { MatchComment(line *Line) (bool, *Token, error) MatchTagLine(line *Line) (bool, *Token, error) MatchFeatureLine(line *Line) (bool, *Token, error) + MatchRuleLine(line *Line) (bool, *Token, error) MatchBackgroundLine(line *Line) (bool, *Token, error) MatchScenarioLine(line *Line) (bool, *Token, error) MatchExamplesLine(line *Line) (bool, *Token, error) @@ -2063,6 +3995,17 @@ func (ctxt *parseContext) match_FeatureLine(line *Line) (bool, *Token, error) { return ctxt.m.MatchFeatureLine(line) } +func (ctxt *parseContext) isMatch_RuleLine(line *Line) bool { + ok, _, _ := ctxt.match_RuleLine(line) + return ok +} +func (ctxt *parseContext) match_RuleLine(line *Line) (bool, *Token, error) { + if line.IsEof() { + return false, nil, nil + } + return ctxt.m.MatchRuleLine(line) +} + func (ctxt *parseContext) isMatch_BackgroundLine(line *Line) bool { ok, _, _ := ctxt.match_BackgroundLine(line) return ok diff --git a/gherkin/go/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/go/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/go/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/go/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/go/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/go/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/go/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/go/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/go/testdata/good/rule.feature b/gherkin/go/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/go/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/go/testdata/good/rule.feature.ast.ndjson b/gherkin/go/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/go/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/go/testdata/good/rule.feature.pickles.ndjson b/gherkin/go/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/go/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/go/testdata/good/rule.feature.source.ndjson b/gherkin/go/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/go/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/go/testdata/good/rule.feature.tokens b/gherkin/go/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/go/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF diff --git a/gherkin/java/src/main/java/gherkin/AstBuilder.java b/gherkin/java/src/main/java/gherkin/AstBuilder.java index bf1f423fee5..1da6786fbd2 100644 --- a/gherkin/java/src/main/java/gherkin/AstBuilder.java +++ b/gherkin/java/src/main/java/gherkin/AstBuilder.java @@ -163,7 +163,7 @@ public String toString(Token t) { if (header == null) return null; Token ruleLine = header.getToken(TokenType.RuleLine); if (ruleLine == null) return null; - String description = getDescription(node); + String description = getDescription(header); List ruleChildren = new ArrayList<>(); Background background = node.getSingle(RuleType.Background, null); if (background != null) ruleChildren.add(background); diff --git a/gherkin/java/src/main/java/gherkin/GherkinDialect.java b/gherkin/java/src/main/java/gherkin/GherkinDialect.java index 4923a5c3094..f30c97ce84a 100644 --- a/gherkin/java/src/main/java/gherkin/GherkinDialect.java +++ b/gherkin/java/src/main/java/gherkin/GherkinDialect.java @@ -66,7 +66,7 @@ public List getButKeywords() { } public List getRuleKeywords() { - return singletonList("Rule"); + return keywords.get("rule"); } public String getLanguage() { diff --git a/gherkin/java/src/main/java/gherkin/pickles/Compiler.java b/gherkin/java/src/main/java/gherkin/pickles/Compiler.java index 39317dc1ded..755ebaffb6d 100644 --- a/gherkin/java/src/main/java/gherkin/pickles/Compiler.java +++ b/gherkin/java/src/main/java/gherkin/pickles/Compiler.java @@ -60,13 +60,13 @@ private void build(List pickles, String language, List tags, List

pickles, List backgroundSteps, Scenario scenario, List featureTags, String language) { + private void compileScenario(List pickles, List backgroundSteps, Scenario scenario, List parentTags, String language) { List steps = new ArrayList<>(); if (!scenario.getChildren().isEmpty()) steps.addAll(backgroundSteps); List scenarioTags = new ArrayList<>(); - scenarioTags.addAll(featureTags); + scenarioTags.addAll(parentTags); scenarioTags.addAll(scenario.getTags()); steps.addAll(pickleSteps(scenario)); @@ -81,7 +81,7 @@ private void compileScenario(List pickles, List backgroundSt pickles.add(pickle); } - private void compileScenarioOutline(List pickles, List backgroundSteps, Scenario scenario, List featureTags, String language) { + private void compileScenarioOutline(List pickles, List backgroundSteps, Scenario scenario, List parentTags, String language) { for (final Examples examples : scenario.getExamples()) { if (examples.getTableHeader() == null) continue; List variableCells = examples.getTableHeader().getCells(); @@ -93,7 +93,7 @@ private void compileScenarioOutline(List pickles, List backg steps.addAll(backgroundSteps); List tags = new ArrayList<>(); - tags.addAll(featureTags); + tags.addAll(parentTags); tags.addAll(scenario.getTags()); tags.addAll(examples.getTags()); diff --git a/gherkin/java/src/main/resources/gherkin/gherkin-languages.json b/gherkin/java/src/main/resources/gherkin/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/java/src/main/resources/gherkin/gherkin-languages.json +++ b/gherkin/java/src/main/resources/gherkin/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/java/testdata/good/rule.feature.ast.ndjson b/gherkin/java/testdata/good/rule.feature.ast.ndjson index bd8794060d9..ab8e06740d4 100644 --- a/gherkin/java/testdata/good/rule.feature.ast.ndjson +++ b/gherkin/java/testdata/good/rule.feature.ast.ndjson @@ -1 +1 @@ -{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/javascript/dist/gherkin.js b/gherkin/javascript/dist/gherkin.js index 4ed9cbd0ac7..f40e5f09a1c 100644 --- a/gherkin/javascript/dist/gherkin.js +++ b/gherkin/javascript/dist/gherkin.js @@ -265,6 +265,7 @@ module.exports = function AstBuilder () { var background = node.getSingle('Background'); if(background) children.push(background); children = children.concat(node.getItems('ScenarioDefinition')); + children = children.concat(node.getItems('Rule')); var description = getDescription(header); var language = featureLine.matchedGherkinDialect; @@ -278,6 +279,25 @@ module.exports = function AstBuilder () { description: description, children: children, }; + case 'Rule': + var header = node.getSingle('RuleHeader'); + if(!header) return null; + var ruleLine = header.getToken('RuleLine'); + if(!ruleLine) return null; + var children = [] + var background = node.getSingle('Background'); + if(background) children.push(background); + children = children.concat(node.getItems('ScenarioDefinition')); + var description = getDescription(header); + + return { + type: node.ruleType, + location: getLocation(ruleLine), + keyword: ruleLine.matchedKeyword, + name: ruleLine.matchedText, + description: description, + children: children, + }; case 'GherkinDocument': var feature = node.getSingle('Feature'); @@ -1190,6 +1210,9 @@ module.exports={ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -1668,6 +1691,9 @@ module.exports={ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -2719,6 +2745,9 @@ module.exports={ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -3863,6 +3892,7 @@ var RULE_TYPES = [ '_Comment', // #Comment '_TagLine', // #TagLine '_FeatureLine', // #FeatureLine + '_RuleLine', // #RuleLine '_BackgroundLine', // #BackgroundLine '_ScenarioLine', // #ScenarioLine '_ExamplesLine', // #ExamplesLine @@ -3872,8 +3902,10 @@ var RULE_TYPES = [ '_Language', // #Language '_Other', // #Other 'GherkinDocument', // GherkinDocument! := Feature? - 'Feature', // Feature! := FeatureHeader Background? ScenarioDefinition* + 'Feature', // Feature! := FeatureHeader Background? ScenarioDefinition* Rule* 'FeatureHeader', // FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper + 'Rule', // Rule! := RuleHeader Background? ScenarioDefinition* + 'RuleHeader', // RuleHeader! := #RuleLine DescriptionHelper 'Background', // Background! := #BackgroundLine DescriptionHelper Step* 'ScenarioDefinition', // ScenarioDefinition! := Tags? Scenario 'Scenario', // Scenario! := #ScenarioLine DescriptionHelper Step* ExamplesDefinition* @@ -4035,6 +4067,8 @@ module.exports = function Parser(builder) { return matchTokenAt_20(token, context); case 21: return matchTokenAt_21(token, context); + case 22: + return matchTokenAt_22(token, context); case 23: return matchTokenAt_23(token, context); case 24: @@ -4043,6 +4077,50 @@ module.exports = function Parser(builder) { return matchTokenAt_25(token, context); case 26: return matchTokenAt_26(token, context); + case 27: + return matchTokenAt_27(token, context); + case 28: + return matchTokenAt_28(token, context); + case 29: + return matchTokenAt_29(token, context); + case 30: + return matchTokenAt_30(token, context); + case 31: + return matchTokenAt_31(token, context); + case 32: + return matchTokenAt_32(token, context); + case 33: + return matchTokenAt_33(token, context); + case 34: + return matchTokenAt_34(token, context); + case 35: + return matchTokenAt_35(token, context); + case 36: + return matchTokenAt_36(token, context); + case 37: + return matchTokenAt_37(token, context); + case 38: + return matchTokenAt_38(token, context); + case 39: + return matchTokenAt_39(token, context); + case 40: + return matchTokenAt_40(token, context); + case 42: + return matchTokenAt_42(token, context); + case 43: + return matchTokenAt_43(token, context); + case 44: + return matchTokenAt_44(token, context); + case 45: + return matchTokenAt_45(token, context); + case 46: + return matchTokenAt_46(token, context); + case 47: + return matchTokenAt_47(token, context); + case 48: + return matchTokenAt_48(token, context); + case 49: + return matchTokenAt_49(token, context); default: throw new Error("Unknown state: " + state); } @@ -4053,7 +4131,7 @@ module.exports = function Parser(builder) { function matchTokenAt_0(token, context) { if(match_EOF(context, token)) { build(context, token); - return 22; + return 41; } if(match_Language(context, token)) { startRule(context, 'Feature'); @@ -4165,7 +4243,7 @@ module.exports = function Parser(builder) { endRule(context, 'FeatureHeader'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Empty(context, token)) { build(context, token); @@ -4195,6 +4273,13 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'FeatureHeader'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { startRule(context, 'Description'); build(context, token); @@ -4203,7 +4288,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4220,7 +4305,7 @@ module.exports = function Parser(builder) { endRule(context, 'FeatureHeader'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { endRule(context, 'Description'); @@ -4250,6 +4335,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'FeatureHeader'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { build(context, token); return 4; @@ -4257,7 +4350,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4273,7 +4366,7 @@ module.exports = function Parser(builder) { endRule(context, 'FeatureHeader'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { build(context, token); @@ -4299,6 +4392,13 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'FeatureHeader'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Empty(context, token)) { build(context, token); return 5; @@ -4306,7 +4406,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4322,7 +4422,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Empty(context, token)) { build(context, token); @@ -4351,6 +4451,13 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { startRule(context, 'Description'); build(context, token); @@ -4359,7 +4466,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4376,7 +4483,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { endRule(context, 'Description'); @@ -4405,6 +4512,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { build(context, token); return 7; @@ -4412,7 +4527,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4428,7 +4543,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { build(context, token); @@ -4453,6 +4568,13 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Empty(context, token)) { build(context, token); return 8; @@ -4460,7 +4582,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4477,7 +4599,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { startRule(context, 'DataTable'); @@ -4487,7 +4609,7 @@ module.exports = function Parser(builder) { if(match_DocStringSeparator(context, token)) { startRule(context, 'DocString'); build(context, token); - return 25; + return 48; } if(match_StepLine(context, token)) { endRule(context, 'Step'); @@ -4511,6 +4633,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 9; @@ -4522,7 +4652,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4540,7 +4670,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { build(context, token); @@ -4571,6 +4701,15 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 10; @@ -4582,7 +4721,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4632,7 +4771,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Empty(context, token)) { build(context, token); @@ -4677,6 +4816,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { startRule(context, 'Description'); build(context, token); @@ -4685,7 +4832,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4703,7 +4850,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { endRule(context, 'Description'); @@ -4750,6 +4897,15 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { build(context, token); return 13; @@ -4757,7 +4913,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4774,7 +4930,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { build(context, token); @@ -4815,6 +4971,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Empty(context, token)) { build(context, token); return 14; @@ -4822,7 +4986,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4840,7 +5004,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { startRule(context, 'DataTable'); @@ -4850,7 +5014,7 @@ module.exports = function Parser(builder) { if(match_DocStringSeparator(context, token)) { startRule(context, 'DocString'); build(context, token); - return 23; + return 46; } if(match_StepLine(context, token)) { endRule(context, 'Step'); @@ -4892,6 +5056,15 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 15; @@ -4903,7 +5076,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -4922,7 +5095,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { build(context, token); @@ -4973,6 +5146,16 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 16; @@ -4984,7 +5167,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -5036,7 +5219,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Empty(context, token)) { build(context, token); @@ -5089,6 +5272,16 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { startRule(context, 'Description'); build(context, token); @@ -5097,7 +5290,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -5117,7 +5310,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { endRule(context, 'Description'); @@ -5172,6 +5365,17 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { build(context, token); return 19; @@ -5179,7 +5383,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -5198,7 +5402,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { build(context, token); @@ -5247,6 +5451,16 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Empty(context, token)) { build(context, token); return 20; @@ -5254,7 +5468,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -5274,7 +5488,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { build(context, token); @@ -5322,6 +5536,17 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 21; @@ -5333,7 +5558,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -5343,139 +5568,1716 @@ module.exports = function Parser(builder) { } - // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - function matchTokenAt_23(token, context) { - if(match_DocStringSeparator(context, token)) { + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0 + function matchTokenAt_22(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Empty(context, token)) { + build(context, token); + return 22; + } + if(match_Comment(context, token)) { build(context, token); return 24; } + if(match_BackgroundLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'Background'); + build(context, token); + return 25; + } + if(match_TagLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { + startRule(context, 'Description'); build(context, token); return 23; } - var stateComment = "State: 23 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + var stateComment = "State: 22 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0"; token.detach(); - var expectedTokens = ["#DocStringSeparator", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); if (self.stopAtFirstError) throw error; addError(context, error); - return 23; + return 22; } - // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - function matchTokenAt_24(token, context) { + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0 + function matchTokenAt_23(token, context) { if(match_EOF(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - endRule(context, 'Scenario'); - endRule(context, 'ScenarioDefinition'); + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } - if(match_StepLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - startRule(context, 'Step'); + if(match_Comment(context, token)) { + endRule(context, 'Description'); build(context, token); - return 15; + return 24; } - if(match_TagLine(context, token)) { - if(lookahead_0(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - startRule(context, 'ExamplesDefinition'); - startRule(context, 'Tags'); + if(match_BackgroundLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); + startRule(context, 'Background'); build(context, token); - return 17; - } + return 25; } if(match_TagLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - endRule(context, 'Scenario'); - endRule(context, 'ScenarioDefinition'); + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); startRule(context, 'ScenarioDefinition'); startRule(context, 'Tags'); build(context, token); - return 11; - } - if(match_ExamplesLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - startRule(context, 'ExamplesDefinition'); - startRule(context, 'Examples'); - build(context, token); - return 18; + return 30; } if(match_ScenarioLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - endRule(context, 'Scenario'); - endRule(context, 'ScenarioDefinition'); + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); startRule(context, 'ScenarioDefinition'); startRule(context, 'Scenario'); build(context, token); - return 12; + return 31; } - if(match_Comment(context, token)) { + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); build(context, token); - return 24; + return 22; } - if(match_Empty(context, token)) { + if(match_Other(context, token)) { build(context, token); - return 24; + return 23; } - var stateComment = "State: 24 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + var stateComment = "State: 23 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); if (self.stopAtFirstError) throw error; addError(context, error); - return 24; + return 23; } - // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - function matchTokenAt_25(token, context) { - if(match_DocStringSeparator(context, token)) { + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0 + function matchTokenAt_24(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); build(context, token); - return 26; + return 41; } - if(match_Other(context, token)) { + if(match_Comment(context, token)) { + build(context, token); + return 24; + } + if(match_BackgroundLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'Background'); build(context, token); return 25; } + if(match_TagLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Empty(context, token)) { + build(context, token); + return 24; + } - var stateComment = "State: 25 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + var stateComment = "State: 24 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#DocStringSeparator", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); if (self.stopAtFirstError) throw error; addError(context, error); - return 25; + return 24; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0 + function matchTokenAt_25(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Empty(context, token)) { + build(context, token); + return 25; + } + if(match_Comment(context, token)) { + build(context, token); + return 27; + } + if(match_StepLine(context, token)) { + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + startRule(context, 'Description'); + build(context, token); + return 26; + } + + var stateComment = "State: 25 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 25; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0 + function matchTokenAt_26(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + endRule(context, 'Description'); + build(context, token); + return 27; + } + if(match_StepLine(context, token)) { + endRule(context, 'Description'); + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + build(context, token); + return 26; + } + + var stateComment = "State: 26 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 26; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0 + function matchTokenAt_27(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + build(context, token); + return 27; + } + if(match_StepLine(context, token)) { + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Empty(context, token)) { + build(context, token); + return 27; + } + + var stateComment = "State: 27 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 27; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0 + function matchTokenAt_28(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + startRule(context, 'DataTable'); + build(context, token); + return 29; + } + if(match_DocStringSeparator(context, token)) { + startRule(context, 'DocString'); + build(context, token); + return 44; + } + if(match_StepLine(context, token)) { + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 28; + } + if(match_Empty(context, token)) { + build(context, token); + return 28; + } + + var stateComment = "State: 28 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 28; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + function matchTokenAt_29(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + build(context, token); + return 29; + } + if(match_StepLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 29; + } + if(match_Empty(context, token)) { + build(context, token); + return 29; + } + + var stateComment = "State: 29 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 29; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0 + function matchTokenAt_30(token, context) { + if(match_TagLine(context, token)) { + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Tags'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_Comment(context, token)) { + build(context, token); + return 30; + } + if(match_Empty(context, token)) { + build(context, token); + return 30; + } + + var stateComment = "State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0"; + token.detach(); + var expectedTokens = ["#TagLine", "#ScenarioLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 30; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0 + function matchTokenAt_31(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Empty(context, token)) { + build(context, token); + return 31; + } + if(match_Comment(context, token)) { + build(context, token); + return 33; + } + if(match_StepLine(context, token)) { + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + startRule(context, 'Description'); + build(context, token); + return 32; + } + + var stateComment = "State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 31; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0 + function matchTokenAt_32(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + endRule(context, 'Description'); + build(context, token); + return 33; + } + if(match_StepLine(context, token)) { + endRule(context, 'Description'); + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Description'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Description'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + build(context, token); + return 32; + } + + var stateComment = "State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 32; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0 + function matchTokenAt_33(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + build(context, token); + return 33; + } + if(match_StepLine(context, token)) { + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Empty(context, token)) { + build(context, token); + return 33; + } + + var stateComment = "State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 33; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0 + function matchTokenAt_34(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + startRule(context, 'DataTable'); + build(context, token); + return 35; + } + if(match_DocStringSeparator(context, token)) { + startRule(context, 'DocString'); + build(context, token); + return 42; + } + if(match_StepLine(context, token)) { + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 34; + } + if(match_Empty(context, token)) { + build(context, token); + return 34; + } + + var stateComment = "State: 34 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 34; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + function matchTokenAt_35(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + build(context, token); + return 35; + } + if(match_StepLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 35; + } + if(match_Empty(context, token)) { + build(context, token); + return 35; + } + + var stateComment = "State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 35; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0 + function matchTokenAt_36(token, context) { + if(match_TagLine(context, token)) { + build(context, token); + return 36; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Tags'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_Comment(context, token)) { + build(context, token); + return 36; + } + if(match_Empty(context, token)) { + build(context, token); + return 36; + } + + var stateComment = "State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0"; + token.detach(); + var expectedTokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 36; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0 + function matchTokenAt_37(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Empty(context, token)) { + build(context, token); + return 37; + } + if(match_Comment(context, token)) { + build(context, token); + return 39; + } + if(match_TableRow(context, token)) { + startRule(context, 'ExamplesTable'); + build(context, token); + return 40; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + startRule(context, 'Description'); + build(context, token); + return 38; + } + + var stateComment = "State: 37 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 37; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0 + function matchTokenAt_38(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + endRule(context, 'Description'); + build(context, token); + return 39; + } + if(match_TableRow(context, token)) { + endRule(context, 'Description'); + startRule(context, 'ExamplesTable'); + build(context, token); + return 40; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + build(context, token); + return 38; + } + + var stateComment = "State: 38 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 38; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0 + function matchTokenAt_39(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + build(context, token); + return 39; + } + if(match_TableRow(context, token)) { + startRule(context, 'ExamplesTable'); + build(context, token); + return 40; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Empty(context, token)) { + build(context, token); + return 39; + } + + var stateComment = "State: 39 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 39; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0 + function matchTokenAt_40(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + build(context, token); + return 40; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 40; + } + if(match_Empty(context, token)) { + build(context, token); + return 40; + } + + var stateComment = "State: 40 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 40; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + function matchTokenAt_42(token, context) { + if(match_DocStringSeparator(context, token)) { + build(context, token); + return 43; + } + if(match_Other(context, token)) { + build(context, token); + return 42; + } + + var stateComment = "State: 42 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#DocStringSeparator", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 42; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + function matchTokenAt_43(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_StepLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 43; + } + if(match_Empty(context, token)) { + build(context, token); + return 43; + } + + var stateComment = "State: 43 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 43; } - // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - function matchTokenAt_26(token, context) { + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + function matchTokenAt_44(token, context) { + if(match_DocStringSeparator(context, token)) { + build(context, token); + return 45; + } + if(match_Other(context, token)) { + build(context, token); + return 44; + } + + var stateComment = "State: 44 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#DocStringSeparator", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 44; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + function matchTokenAt_45(token, context) { if(match_EOF(context, token)) { endRule(context, 'DocString'); endRule(context, 'Step'); endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_StepLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 45; + } + if(match_Empty(context, token)) { + build(context, token); + return 45; + } + + var stateComment = "State: 45 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 45; + } + + + // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + function matchTokenAt_46(token, context) { + if(match_DocStringSeparator(context, token)) { + build(context, token); + return 47; + } + if(match_Other(context, token)) { + build(context, token); + return 46; + } + + var stateComment = "State: 46 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#DocStringSeparator", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 46; + } + + + // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + function matchTokenAt_47(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); + return 41; + } + if(match_StepLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 15; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 17; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 11; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 18; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 12; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); return 22; } + if(match_Comment(context, token)) { + build(context, token); + return 47; + } + if(match_Empty(context, token)) { + build(context, token); + return 47; + } + + var stateComment = "State: 47 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 47; + } + + + // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + function matchTokenAt_48(token, context) { + if(match_DocStringSeparator(context, token)) { + build(context, token); + return 49; + } + if(match_Other(context, token)) { + build(context, token); + return 48; + } + + var stateComment = "State: 48 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#DocStringSeparator", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 48; + } + + + // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + function matchTokenAt_49(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } if(match_StepLine(context, token)) { endRule(context, 'DocString'); endRule(context, 'Step'); @@ -5501,24 +7303,33 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); - return 26; + return 49; } if(match_Empty(context, token)) { build(context, token); - return 26; + return 49; } - var stateComment = "State: 26 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + var stateComment = "State: 49 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; token.detach(); - var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); if (self.stopAtFirstError) throw error; addError(context, error); - return 26; + return 49; } @@ -5562,6 +7373,14 @@ module.exports = function Parser(builder) { } + function match_RuleLine(context, token) { + if(token.isEof) return false; + return handleExternalError(context, false, function () { + return context.tokenMatcher.match_RuleLine(token); + }); + } + + function match_BackgroundLine(context, token) { if(token.isEof) return false; return handleExternalError(context, false, function () { @@ -5662,20 +7481,30 @@ function Compiler() { var feature = gherkin_document.feature; var language = feature.language; - var featureTags = feature.tags; + var tags = feature.tags; var backgroundSteps = []; - feature.children.forEach(function (stepsContainer) { - if(stepsContainer.type === 'Background') { - backgroundSteps = pickleSteps(stepsContainer); - } else if(stepsContainer.examples.length === 0) { - compileScenario(featureTags, backgroundSteps, stepsContainer, language, pickles); + build(pickles, language, tags, backgroundSteps, feature); + return pickles; + }; + + function build(pickles, language, tags, parentBackgroundSteps, parent) { + var backgroundSteps = parentBackgroundSteps.slice(0); // dup + parent.children.forEach(function (child) { + if (child.type === 'Background') { + backgroundSteps = backgroundSteps.concat(pickleSteps(child)); + } else if (child.type === 'Rule') { + build(pickles, language, tags, backgroundSteps, child) } else { - compileScenarioOutline(featureTags, backgroundSteps, stepsContainer, language, pickles); + var scenario = child + if (scenario.examples.length === 0) { + compileScenario(tags, backgroundSteps, scenario, language, pickles); + } else { + compileScenarioOutline(tags, backgroundSteps, scenario, language, pickles); + } } }); - return pickles; - }; + } function compileScenario(featureTags, backgroundSteps, scenario, language, pickles) { var steps = scenario.steps.length == 0 ? [] : [].concat(backgroundSteps); @@ -5882,6 +7711,10 @@ module.exports = function TokenMatcher(defaultDialectName) { return matchTitleLine(token, 'FeatureLine', dialect.feature); }; + this.match_RuleLine = function match_RuleLine(token) { + return matchTitleLine(token, 'RuleLine', dialect.rule); + }; + this.match_ScenarioLine = function match_ScenarioLine(token) { return matchTitleLine(token, 'ScenarioLine', dialect.scenario) || matchTitleLine(token, 'ScenarioLine', dialect.scenarioOutline); @@ -5999,7 +7832,7 @@ module.exports = function TokenMatcher(defaultDialectName) { function matchTitleLine(token, tokenType, keywords) { var length = keywords.length; - for(var i = 0, keyword; i < length; i++) { + for(var i = 0; i < length; i++) { var keyword = keywords[i]; if (token.line.startsWithTitleKeyword(keyword)) { diff --git a/gherkin/javascript/dist/gherkin.min.js b/gherkin/javascript/dist/gherkin.min.js index 6a3512c5d1e..5d52e2fa3d3 100644 --- a/gherkin/javascript/dist/gherkin.min.js +++ b/gherkin/javascript/dist/gherkin.min.js @@ -21,6 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i0?separatorToken.matchedText:undefined;var lineTokens=node.getTokens("Other");var content=lineTokens.map(function(t){return t.matchedText}).join("\n");var result={type:node.ruleType,location:getLocation(separatorToken),content:content};if(contentType){result.contentType=contentType}return result;case"DataTable":var rows=getTableRows(node);return{type:node.ruleType,location:rows[0].location,rows:rows};case"Background":var backgroundLine=node.getToken("BackgroundLine");var description=getDescription(node);var steps=getSteps(node);return{type:node.ruleType,location:getLocation(backgroundLine),keyword:backgroundLine.matchedKeyword,name:backgroundLine.matchedText,description:description,steps:steps};case"ScenarioDefinition":var tags=getTags(node);var scenarioNode=node.getSingle("Scenario");var scenarioLine=scenarioNode.getToken("ScenarioLine");var description=getDescription(scenarioNode);var steps=getSteps(scenarioNode);var examples=scenarioNode.getItems("ExamplesDefinition");return{type:scenarioNode.ruleType,tags:tags,location:getLocation(scenarioLine),keyword:scenarioLine.matchedKeyword,name:scenarioLine.matchedText,description:description,steps:steps,examples:examples};case"ExamplesDefinition":var tags=getTags(node);var examplesNode=node.getSingle("Examples");var examplesLine=examplesNode.getToken("ExamplesLine");var description=getDescription(examplesNode);var exampleTable=examplesNode.getSingle("ExamplesTable");return{type:examplesNode.ruleType,tags:tags,location:getLocation(examplesLine),keyword:examplesLine.matchedKeyword,name:examplesLine.matchedText,description:description,tableHeader:exampleTable!=undefined?exampleTable.tableHeader:undefined,tableBody:exampleTable!=undefined?exampleTable.tableBody:undefined};case"ExamplesTable":var rows=getTableRows(node);return{tableHeader:rows!=undefined?rows[0]:undefined,tableBody:rows!=undefined?rows.slice(1):undefined};case"Description":var lineTokens=node.getTokens("Other");var end=lineTokens.length;while(end>0&&lineTokens[end-1].line.trimmedLineText===""){end--}lineTokens=lineTokens.slice(0,end);var description=lineTokens.map(function(token){return token.matchedText}).join("\n");return description;case"Feature":var header=node.getSingle("FeatureHeader");if(!header)return null;var tags=getTags(header);var featureLine=header.getToken("FeatureLine");if(!featureLine)return null;var children=[];var background=node.getSingle("Background");if(background)children.push(background);children=children.concat(node.getItems("ScenarioDefinition"));var description=getDescription(header);var language=featureLine.matchedGherkinDialect;return{type:node.ruleType,tags:tags,location:getLocation(featureLine),language:language,keyword:featureLine.matchedKeyword,name:featureLine.matchedText,description:description,children:children};case"GherkinDocument":var feature=node.getSingle("Feature");return{type:node.ruleType,feature:feature,comments:comments};default:return node}}}},{"./ast_node":3,"./errors":6}],3:[function(require,module,exports){function AstNode(ruleType){this.ruleType=ruleType;this._subItems={}}AstNode.prototype.add=function(ruleType,obj){var items=this._subItems[ruleType];if(items===undefined)this._subItems[ruleType]=items=[];items.push(obj)};AstNode.prototype.getSingle=function(ruleType){return(this._subItems[ruleType]||[])[0]};AstNode.prototype.getItems=function(ruleType){return this._subItems[ruleType]||[]};AstNode.prototype.getToken=function(tokenType){return this.getSingle(tokenType)};AstNode.prototype.getTokens=function(tokenType){return this._subItems[tokenType]||[]};module.exports=AstNode},{}],4:[function(require,module,exports){var regexAstralSymbols=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;module.exports=function countSymbols(string){return string.replace(regexAstralSymbols,"_").length}},{}],5:[function(require,module,exports){module.exports=require("./gherkin-languages.json")},{"./gherkin-languages.json":8}],6:[function(require,module,exports){var Errors={};["ParserException","CompositeParserException","UnexpectedTokenException","UnexpectedEOFException","AstBuilderException","NoSuchLanguageException"].forEach(function(name){function ErrorProto(message){this.message=message||"Unspecified "+name;if(Error.captureStackTrace){Error.captureStackTrace(this,arguments.callee)}}ErrorProto.prototype=Object.create(Error.prototype);ErrorProto.prototype.name=name;ErrorProto.prototype.constructor=ErrorProto;Errors[name]=ErrorProto});Errors.CompositeParserException.create=function(errors){var message="Parser errors:\n"+errors.map(function(e){return e.message}).join("\n");var err=new Errors.CompositeParserException(message);err.errors=errors;return err};Errors.UnexpectedTokenException.create=function(token,expectedTokenTypes,stateComment){var message="expected: "+expectedTokenTypes.join(", ")+", got '"+token.getTokenValue().trim()+"'";var location=!token.location.column?{line:token.location.line,column:token.line.indent+1}:token.location;return createError(Errors.UnexpectedEOFException,message,location)};Errors.UnexpectedEOFException.create=function(token,expectedTokenTypes,stateComment){var message="unexpected end of file, expected: "+expectedTokenTypes.join(", ");return createError(Errors.UnexpectedTokenException,message,token.location)};Errors.AstBuilderException.create=function(message,location){return createError(Errors.AstBuilderException,message,location)};Errors.NoSuchLanguageException.create=function(language,location){var message="Language not supported: "+language;return createError(Errors.NoSuchLanguageException,message,location)};function createError(Ctor,message,location){var fullMessage="("+location.line+":"+location.column+"): "+message;var error=new Ctor(fullMessage);error.location=location;return error}module.exports=Errors},{}],7:[function(require,module,exports){var Parser=require("./parser");var Compiler=require("./pickles/compiler");var compiler=new Compiler;var parser=new Parser;parser.stopAtFirstError=false;function generateEvents(data,uri,types,language){types=Object.assign({source:true,"gherkin-document":true,pickle:true},types||{});result=[];try{if(types["source"]){result.push({type:"source",uri:uri,data:data,media:{encoding:"utf-8",type:"text/x.cucumber.gherkin+plain"}})}if(!types["gherkin-document"]&&!types["pickle"])return result;var gherkinDocument=parser.parse(data,language);if(types["gherkin-document"]){result.push({type:"gherkin-document",uri:uri,document:gherkinDocument})}if(types["pickle"]){var pickles=compiler.compile(gherkinDocument);for(var p in pickles){result.push({type:"pickle",uri:uri,pickle:pickles[p]})}}}catch(err){var errors=err.errors||[err];for(var e in errors){result.push({type:"attachment",source:{uri:uri,start:{line:errors[e].location.line,column:errors[e].location.column}},data:errors[e].message,media:{encoding:"utf-8",type:"text/x.cucumber.stacktrace+plain"}})}}return result}module.exports=generateEvents},{"./parser":10,"./pickles/compiler":11}],8:[function(require,module,exports){module.exports={af:{and:["* ","En "],background:["Agtergrond"],but:["* ","Maar "],examples:["Voorbeelde"],feature:["Funksie","Besigheid Behoefte","Vermoë"],given:["* ","Gegewe "],name:"Afrikaans",native:"Afrikaans",scenario:["Voorbeeld","Situasie"],scenarioOutline:["Situasie Uiteensetting"],then:["* ","Dan "],when:["* ","Wanneer "]},am:{and:["* ","Եվ "],background:["Կոնտեքստ"],but:["* ","Բայց "],examples:["Օրինակներ"],feature:["Ֆունկցիոնալություն","Հատկություն"],given:["* ","Դիցուք "],name:"Armenian",native:"հայերեն",scenario:["Օրինակ","Սցենար"],scenarioOutline:["Սցենարի կառուցվացքը"],then:["* ","Ապա "],when:["* ","Եթե ","Երբ "]},an:{and:["* ","Y ","E "],background:["Antecedents"],but:["* ","Pero "],examples:["Eixemplos"],feature:["Caracteristica"],given:["* ","Dau ","Dada ","Daus ","Dadas "],name:"Aragonese",native:"Aragonés",scenario:["Eixemplo","Caso"],scenarioOutline:["Esquema del caso"],then:["* ","Alavez ","Allora ","Antonces "],when:["* ","Cuan "]},ar:{and:["* ","و "],background:["الخلفية"],but:["* ","لكن "],examples:["امثلة"],feature:["خاصية"],given:["* ","بفرض "],name:"Arabic",native:"العربية",scenario:["مثال","سيناريو"],scenarioOutline:["سيناريو مخطط"],then:["* ","اذاً ","ثم "],when:["* ","متى ","عندما "]},ast:{and:["* ","Y ","Ya "],background:["Antecedentes"],but:["* ","Peru "],examples:["Exemplos"],feature:["Carauterística"],given:["* ","Dáu ","Dada ","Daos ","Daes "],name:"Asturian",native:"asturianu",scenario:["Exemplo","Casu"],scenarioOutline:["Esbozu del casu"],then:["* ","Entós "],when:["* ","Cuando "]},az:{and:["* ","Və ","Həm "],background:["Keçmiş","Kontekst"],but:["* ","Amma ","Ancaq "],examples:["Nümunələr"],feature:["Özəllik"],given:["* ","Tutaq ki ","Verilir "],name:"Azerbaijani",native:"Azərbaycanca",scenario:["Nümunələr","Ssenari"],scenarioOutline:["Ssenarinin strukturu"],then:["* ","O halda "],when:["* ","Əgər ","Nə vaxt ki "]},bg:{and:["* ","И "],background:["Предистория"],but:["* ","Но "],examples:["Примери"],feature:["Функционалност"],given:["* ","Дадено "],name:"Bulgarian",native:"български",scenario:["Пример","Сценарий"],scenarioOutline:["Рамка на сценарий"],then:["* ","То "],when:["* ","Когато "]},bm:{and:["* ","Dan "],background:["Latar Belakang"],but:["* ","Tetapi ","Tapi "],examples:["Contoh"],feature:["Fungsi"],given:["* ","Diberi ","Bagi "],name:"Malay",native:"Bahasa Melayu",scenario:["Senario","Situasi","Keadaan"],scenarioOutline:["Kerangka Senario","Kerangka Situasi","Kerangka Keadaan","Garis Panduan Senario"],then:["* ","Maka ","Kemudian "],when:["* ","Apabila "]},bs:{and:["* ","I ","A "],background:["Pozadina"],but:["* ","Ali "],examples:["Primjeri"],feature:["Karakteristika"],given:["* ","Dato "],name:"Bosnian",native:"Bosanski",scenario:["Primjer","Scenariju","Scenario"],scenarioOutline:["Scenariju-obris","Scenario-outline"],then:["* ","Zatim "],when:["* ","Kada "]},ca:{and:["* ","I "],background:["Rerefons","Antecedents"],but:["* ","Però "],examples:["Exemples"],feature:["Característica","Funcionalitat"],given:["* ","Donat ","Donada ","Atès ","Atesa "],name:"Catalan",native:"català",scenario:["Exemple","Escenari"],scenarioOutline:["Esquema de l'escenari"],then:["* ","Aleshores ","Cal "],when:["* ","Quan "]},cs:{and:["* ","A také ","A "],background:["Pozadí","Kontext"],but:["* ","Ale "],examples:["Příklady"],feature:["Požadavek"],given:["* ","Pokud ","Za předpokladu "],name:"Czech",native:"Česky",scenario:["Příklad","Scénář"],scenarioOutline:["Náčrt Scénáře","Osnova scénáře"],then:["* ","Pak "],when:["* ","Když "]},"cy-GB":{and:["* ","A "],background:["Cefndir"],but:["* ","Ond "],examples:["Enghreifftiau"],feature:["Arwedd"],given:["* ","Anrhegedig a "],name:"Welsh",native:"Cymraeg",scenario:["Enghraifft","Scenario"],scenarioOutline:["Scenario Amlinellol"],then:["* ","Yna "],when:["* ","Pryd "]},da:{and:["* ","Og "],background:["Baggrund"],but:["* ","Men "],examples:["Eksempler"],feature:["Egenskab"],given:["* ","Givet "],name:"Danish",native:"dansk",scenario:["Eksempel","Scenarie"],scenarioOutline:["Abstrakt Scenario"],then:["* ","Så "],when:["* ","Når "]},de:{and:["* ","Und "],background:["Grundlage"],but:["* ","Aber "],examples:["Beispiele"],feature:["Funktionalität"],given:["* ","Angenommen ","Gegeben sei ","Gegeben seien "],name:"German",native:"Deutsch",scenario:["Beispiel","Szenario"],scenarioOutline:["Szenariogrundriss"],then:["* ","Dann "],when:["* ","Wenn "]},el:{and:["* ","Και "],background:["Υπόβαθρο"],but:["* ","Αλλά "],examples:["Παραδείγματα","Σενάρια"],feature:["Δυνατότητα","Λειτουργία"],given:["* ","Δεδομένου "],name:"Greek",native:"Ελληνικά",scenario:["Παράδειγμα","Σενάριο"],scenarioOutline:["Περιγραφή Σεναρίου","Περίγραμμα Σεναρίου"],then:["* ","Τότε "],when:["* ","Όταν "]},em:{and:["* ","😂"],background:["💤"],but:["* ","😔"],examples:["📓"],feature:["📚"],given:["* ","😐"],name:"Emoji",native:"😀",scenario:["🥒","📕"],scenarioOutline:["📖"],then:["* ","🙏"],when:["* ","🎬"]},en:{and:["* ","And "],background:["Background"],but:["* ","But "],examples:["Examples","Scenarios"],feature:["Feature","Business Need","Ability"],given:["* ","Given "],name:"English",native:"English",scenario:["Example","Scenario"],scenarioOutline:["Scenario Outline","Scenario Template"],then:["* ","Then "],when:["* ","When "]},"en-Scouse":{and:["* ","An "],background:["Dis is what went down"],but:["* ","Buh "],examples:["Examples"],feature:["Feature"],given:["* ","Givun ","Youse know when youse got "],name:"Scouse",native:"Scouse",scenario:["The thing of it is"],scenarioOutline:["Wharrimean is"],then:["* ","Dun ","Den youse gotta "],when:["* ","Wun ","Youse know like when "]},"en-au":{and:["* ","Too right "],background:["First off"],but:["* ","Yeah nah "],examples:["You'll wanna"],feature:["Pretty much"],given:["* ","Y'know "],name:"Australian",native:"Australian",scenario:["Awww, look mate"],scenarioOutline:["Reckon it's like"],then:["* ","But at the end of the day I reckon "],when:["* ","It's just unbelievable "]},"en-lol":{and:["* ","AN "],background:["B4"],but:["* ","BUT "],examples:["EXAMPLZ"],feature:["OH HAI"],given:["* ","I CAN HAZ "],name:"LOLCAT",native:"LOLCAT",scenario:["MISHUN"],scenarioOutline:["MISHUN SRSLY"],then:["* ","DEN "],when:["* ","WEN "]},"en-old":{and:["* ","Ond ","7 "],background:["Aer","Ær"],but:["* ","Ac "],examples:["Se the","Se þe","Se ðe"],feature:["Hwaet","Hwæt"],given:["* ","Thurh ","Þurh ","Ðurh "],name:"Old English",native:"Englisc",scenario:["Swa"],scenarioOutline:["Swa hwaer swa","Swa hwær swa"],then:["* ","Tha ","Þa ","Ða ","Tha the ","Þa þe ","Ða ðe "],when:["* ","Tha ","Þa ","Ða "]},"en-pirate":{and:["* ","Aye "],background:["Yo-ho-ho"],but:["* ","Avast! "],examples:["Dead men tell no tales"],feature:["Ahoy matey!"],given:["* ","Gangway! "],name:"Pirate",native:"Pirate",scenario:["Heave to"],scenarioOutline:["Shiver me timbers"],then:["* ","Let go and haul "],when:["* ","Blimey! "]},eo:{and:["* ","Kaj "],background:["Fono"],but:["* ","Sed "],examples:["Ekzemploj"],feature:["Trajto"],given:["* ","Donitaĵo ","Komence "],name:"Esperanto",native:"Esperanto",scenario:["Ekzemplo","Scenaro","Kazo"],scenarioOutline:["Konturo de la scenaro","Skizo","Kazo-skizo"],then:["* ","Do "],when:["* ","Se "]},es:{and:["* ","Y ","E "],background:["Antecedentes"],but:["* ","Pero "],examples:["Ejemplos"],feature:["Característica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Spanish",native:"español",scenario:["Ejemplo","Escenario"],scenarioOutline:["Esquema del escenario"],then:["* ","Entonces "],when:["* ","Cuando "]},et:{and:["* ","Ja "],background:["Taust"],but:["* ","Kuid "],examples:["Juhtumid"],feature:["Omadus"],given:["* ","Eeldades "],name:"Estonian",native:"eesti keel",scenario:["Juhtum","Stsenaarium"],scenarioOutline:["Raamstjuhtum","Raamstsenaarium"],then:["* ","Siis "],when:["* ","Kui "]},fa:{and:["* ","و "],background:["زمینه"],but:["* ","اما "],examples:["نمونه ها"],feature:["وِیژگی"],given:["* ","با فرض "],name:"Persian",native:"فارسی",scenario:["مثال","سناریو"],scenarioOutline:["الگوی سناریو"],then:["* ","آنگاه "],when:["* ","هنگامی "]},fi:{and:["* ","Ja "],background:["Tausta"],but:["* ","Mutta "],examples:["Tapaukset"],feature:["Ominaisuus"],given:["* ","Oletetaan "],name:"Finnish",native:"suomi",scenario:["Tapaus"],scenarioOutline:["Tapausaihio"],then:["* ","Niin "],when:["* ","Kun "]},fr:{and:["* ","Et que ","Et qu'","Et "],background:["Contexte"],but:["* ","Mais que ","Mais qu'","Mais "],examples:["Exemples"],feature:["Fonctionnalité"],given:["* ","Soit ","Etant donné que ","Etant donné qu'","Etant donné ","Etant donnée ","Etant donnés ","Etant données ","Étant donné que ","Étant donné qu'","Étant donné ","Étant donnée ","Étant donnés ","Étant données "],name:"French",native:"français",scenario:["Exemple","Scénario"],scenarioOutline:["Plan du scénario","Plan du Scénario"],then:["* ","Alors "],when:["* ","Quand ","Lorsque ","Lorsqu'"]},ga:{and:["* ","Agus"],background:["Cúlra"],but:["* ","Ach"],examples:["Samplaí"],feature:["Gné"],given:["* ","Cuir i gcás go","Cuir i gcás nach","Cuir i gcás gur","Cuir i gcás nár"],name:"Irish",native:"Gaeilge",scenario:["Sampla","Cás"],scenarioOutline:["Cás Achomair"],then:["* ","Ansin"],when:["* ","Nuair a","Nuair nach","Nuair ba","Nuair nár"]},gj:{and:["* ","અને "],background:["બેકગ્રાઉન્ડ"],but:["* ","પણ "],examples:["ઉદાહરણો"],feature:["લક્ષણ","વ્યાપાર જરૂર","ક્ષમતા"],given:["* ","આપેલ છે "],name:"Gujarati",native:"ગુજરાતી",scenario:["ઉદાહરણ","સ્થિતિ"],scenarioOutline:["પરિદ્દશ્ય રૂપરેખા","પરિદ્દશ્ય ઢાંચો"],then:["* ","પછી "],when:["* ","ક્યારે "]},gl:{and:["* ","E "],background:["Contexto"],but:["* ","Mais ","Pero "],examples:["Exemplos"],feature:["Característica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Galician",native:"galego",scenario:["Exemplo","Escenario"],scenarioOutline:["Esbozo do escenario"],then:["* ","Entón ","Logo "],when:["* ","Cando "]},he:{and:["* ","וגם "],background:["רקע"],but:["* ","אבל "],examples:["דוגמאות"],feature:["תכונה"],given:["* ","בהינתן "],name:"Hebrew",native:"עברית",scenario:["דוגמא","תרחיש"],scenarioOutline:["תבנית תרחיש"],then:["* ","אז ","אזי "],when:["* ","כאשר "]},hi:{and:["* ","और ","तथा "],background:["पृष्ठभूमि"],but:["* ","पर ","परन्तु ","किन्तु "],examples:["उदाहरण"],feature:["रूप लेख"],given:["* ","अगर ","यदि ","चूंकि "],name:"Hindi",native:"हिंदी",scenario:["परिदृश्य"],scenarioOutline:["परिदृश्य रूपरेखा"],then:["* ","तब ","तदा "],when:["* ","जब ","कदा "]},hr:{and:["* ","I "],background:["Pozadina"],but:["* ","Ali "],examples:["Primjeri","Scenariji"],feature:["Osobina","Mogućnost","Mogucnost"],given:["* ","Zadan ","Zadani ","Zadano "],name:"Croatian",native:"hrvatski",scenario:["Primjer","Scenarij"],scenarioOutline:["Skica","Koncept"],then:["* ","Onda "],when:["* ","Kada ","Kad "]},ht:{and:["* ","Ak ","Epi ","E "],background:["Kontèks","Istorik"],but:["* ","Men "],examples:["Egzanp"],feature:["Karakteristik","Mak","Fonksyonalite"],given:["* ","Sipoze ","Sipoze ke ","Sipoze Ke "],name:"Creole",native:"kreyòl",scenario:["Senaryo"],scenarioOutline:["Plan senaryo","Plan Senaryo","Senaryo deskripsyon","Senaryo Deskripsyon","Dyagram senaryo","Dyagram Senaryo"],then:["* ","Lè sa a ","Le sa a "],when:["* ","Lè ","Le "]},hu:{and:["* ","És "],background:["Háttér"],but:["* ","De "],examples:["Példák"],feature:["Jellemző"],given:["* ","Amennyiben ","Adott "],name:"Hungarian",native:"magyar",scenario:["Példa","Forgatókönyv"],scenarioOutline:["Forgatókönyv vázlat"],then:["* ","Akkor "],when:["* ","Majd ","Ha ","Amikor "]},id:{and:["* ","Dan "],background:["Dasar"],but:["* ","Tapi "],examples:["Contoh"],feature:["Fitur"],given:["* ","Dengan "],name:"Indonesian",native:"Bahasa Indonesia",scenario:["Skenario"],scenarioOutline:["Skenario konsep"],then:["* ","Maka "],when:["* ","Ketika "]},is:{and:["* ","Og "],background:["Bakgrunnur"],but:["* ","En "],examples:["Dæmi","Atburðarásir"],feature:["Eiginleiki"],given:["* ","Ef "],name:"Icelandic",native:"Íslenska",scenario:["Atburðarás"],scenarioOutline:["Lýsing Atburðarásar","Lýsing Dæma"],then:["* ","Þá "],when:["* ","Þegar "]},it:{and:["* ","E "],background:["Contesto"],but:["* ","Ma "],examples:["Esempi"],feature:["Funzionalità"],given:["* ","Dato ","Data ","Dati ","Date "],name:"Italian",native:"italiano",scenario:["Esempio","Scenario"],scenarioOutline:["Schema dello scenario"],then:["* ","Allora "],when:["* ","Quando "]},ja:{and:["* ","かつ"],background:["背景"],but:["* ","しかし","但し","ただし"],examples:["例","サンプル"],feature:["フィーチャ","機能"],given:["* ","前提"],name:"Japanese",native:"日本語",scenario:["シナリオ"],scenarioOutline:["シナリオアウトライン","シナリオテンプレート","テンプレ","シナリオテンプレ"],then:["* ","ならば"],when:["* ","もし"]},jv:{and:["* ","Lan "],background:["Dasar"],but:["* ","Tapi ","Nanging ","Ananging "],examples:["Conto","Contone"],feature:["Fitur"],given:["* ","Nalika ","Nalikaning "],name:"Javanese",native:"Basa Jawa",scenario:["Skenario"],scenarioOutline:["Konsep skenario"],then:["* ","Njuk ","Banjur "],when:["* ","Manawa ","Menawa "]},ka:{and:["* ","და"],background:["კონტექსტი"],but:["* ","მაგ­რამ"],examples:["მაგალითები"],feature:["თვისება"],given:["* ","მოცემული"],name:"Georgian",native:"ქართველი",scenario:["მაგალითად","სცენარის"],scenarioOutline:["სცენარის ნიმუში"],then:["* ","მაშინ"],when:["* ","როდესაც"]},kn:{and:["* ","ಮತ್ತು "],background:["ಹಿನ್ನೆಲೆ"],but:["* ","ಆದರೆ "],examples:["ಉದಾಹರಣೆಗಳು"],feature:["ಹೆಚ್ಚಳ"],given:["* ","ನೀಡಿದ "],name:"Kannada",native:"ಕನ್ನಡ",scenario:["ಉದಾಹರಣೆ","ಕಥಾಸಾರಾಂಶ"],scenarioOutline:["ವಿವರಣೆ"],then:["* ","ನಂತರ "],when:["* ","ಸ್ಥಿತಿಯನ್ನು "]},ko:{and:["* ","그리고"],background:["배경"],but:["* ","하지만","단"],examples:["예"],feature:["기능"],given:["* ","조건","먼저"],name:"Korean",native:"한국어",scenario:["시나리오"],scenarioOutline:["시나리오 개요"],then:["* ","그러면"],when:["* ","만일","만약"]},lt:{and:["* ","Ir "],background:["Kontekstas"],but:["* ","Bet "],examples:["Pavyzdžiai","Scenarijai","Variantai"],feature:["Savybė"],given:["* ","Duota "],name:"Lithuanian",native:"lietuvių kalba",scenario:["Pavyzdys","Scenarijus"],scenarioOutline:["Scenarijaus šablonas"],then:["* ","Tada "],when:["* ","Kai "]},lu:{and:["* ","an ","a "],background:["Hannergrond"],but:["* ","awer ","mä "],examples:["Beispiller"],feature:["Funktionalitéit"],given:["* ","ugeholl "],name:"Luxemburgish",native:"Lëtzebuergesch",scenario:["Beispill","Szenario"],scenarioOutline:["Plang vum Szenario"],then:["* ","dann "],when:["* ","wann "]},lv:{and:["* ","Un "],background:["Konteksts","Situācija"],but:["* ","Bet "],examples:["Piemēri","Paraugs"],feature:["Funkcionalitāte","Fīča"],given:["* ","Kad "],name:"Latvian",native:"latviešu",scenario:["Piemērs","Scenārijs"],scenarioOutline:["Scenārijs pēc parauga"],then:["* ","Tad "],when:["* ","Ja "]},"mk-Cyrl":{and:["* ","И "],background:["Контекст","Содржина"],but:["* ","Но "],examples:["Примери","Сценарија"],feature:["Функционалност","Бизнис потреба","Можност"],given:["* ","Дадено ","Дадена "],name:"Macedonian",native:"Македонски",scenario:["Пример","Сценарио","На пример"],scenarioOutline:["Преглед на сценарија","Скица","Концепт"],then:["* ","Тогаш "],when:["* ","Кога "]},"mk-Latn":{and:["* ","I "],background:["Kontekst","Sodrzhina"],but:["* ","No "],examples:["Primeri","Scenaria"],feature:["Funkcionalnost","Biznis potreba","Mozhnost"],given:["* ","Dadeno ","Dadena "],name:"Macedonian (Latin)",native:"Makedonski (Latinica)",scenario:["Scenario","Na primer"],scenarioOutline:["Pregled na scenarija","Skica","Koncept"],then:["* ","Togash "],when:["* ","Koga "]},mn:{and:["* ","Мөн ","Тэгээд "],background:["Агуулга"],but:["* ","Гэхдээ ","Харин "],examples:["Тухайлбал"],feature:["Функц","Функционал"],given:["* ","Өгөгдсөн нь ","Анх "],name:"Mongolian",native:"монгол",scenario:["Сценар"],scenarioOutline:["Сценарын төлөвлөгөө"],then:["* ","Тэгэхэд ","Үүний дараа "],when:["* ","Хэрэв "]},nl:{and:["* ","En "],background:["Achtergrond"],but:["* ","Maar "],examples:["Voorbeelden"],feature:["Functionaliteit"],given:["* ","Gegeven ","Stel "],name:"Dutch",native:"Nederlands",scenario:["Voorbeeld","Scenario"],scenarioOutline:["Abstract Scenario"],then:["* ","Dan "],when:["* ","Als ","Wanneer "]},no:{and:["* ","Og "],background:["Bakgrunn"],but:["* ","Men "],examples:["Eksempler"],feature:["Egenskap"],given:["* ","Gitt "],name:"Norwegian",native:"norsk",scenario:["Eksempel","Scenario"],scenarioOutline:["Scenariomal","Abstrakt Scenario"],then:["* ","Så "],when:["* ","Når "]},pa:{and:["* ","ਅਤੇ "],background:["ਪਿਛੋਕੜ"],but:["* ","ਪਰ "],examples:["ਉਦਾਹਰਨਾਂ"],feature:["ਖਾਸੀਅਤ","ਮੁਹਾਂਦਰਾ","ਨਕਸ਼ ਨੁਹਾਰ"],given:["* ","ਜੇਕਰ ","ਜਿਵੇਂ ਕਿ "],name:"Panjabi",native:"ਪੰਜਾਬੀ",scenario:["ਉਦਾਹਰਨ","ਪਟਕਥਾ"],scenarioOutline:["ਪਟਕਥਾ ਢਾਂਚਾ","ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ"],then:["* ","ਤਦ "],when:["* ","ਜਦੋਂ "]},pl:{and:["* ","Oraz ","I "],background:["Założenia"],but:["* ","Ale "],examples:["Przykłady"],feature:["Właściwość","Funkcja","Aspekt","Potrzeba biznesowa"],given:["* ","Zakładając ","Mając ","Zakładając, że "],name:"Polish",native:"polski",scenario:["Przykład","Scenariusz"],scenarioOutline:["Szablon scenariusza"],then:["* ","Wtedy "],when:["* ","Jeżeli ","Jeśli ","Gdy ","Kiedy "]},pt:{and:["* ","E "],background:["Contexto","Cenário de Fundo","Cenario de Fundo","Fundo"],but:["* ","Mas "],examples:["Exemplos","Cenários","Cenarios"],feature:["Funcionalidade","Característica","Caracteristica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Portuguese",native:"português",scenario:["Exemplo","Cenário","Cenario"],scenarioOutline:["Esquema do Cenário","Esquema do Cenario","Delineação do Cenário","Delineacao do Cenario"],then:["* ","Então ","Entao "],when:["* ","Quando "]},ro:{and:["* ","Si ","Și ","Şi "],background:["Context"],but:["* ","Dar "],examples:["Exemple"],feature:["Functionalitate","Funcționalitate","Funcţionalitate"],given:["* ","Date fiind ","Dat fiind ","Dată fiind","Dati fiind ","Dați fiind ","Daţi fiind "],name:"Romanian",native:"română",scenario:["Exemplu","Scenariu"],scenarioOutline:["Structura scenariu","Structură scenariu"],then:["* ","Atunci "],when:["* ","Cand ","Când "]},ru:{and:["* ","И ","К тому же ","Также "],background:["Предыстория","Контекст"],but:["* ","Но ","А ","Иначе "],examples:["Примеры"],feature:["Функция","Функциональность","Функционал","Свойство"],given:["* ","Допустим ","Дано ","Пусть "],name:"Russian",native:"русский",scenario:["Пример","Сценарий"],scenarioOutline:["Структура сценария"],then:["* ","То ","Затем ","Тогда "],when:["* ","Когда ","Если "]},sk:{and:["* ","A ","A tiež ","A taktiež ","A zároveň "],background:["Pozadie"],but:["* ","Ale "],examples:["Príklady"],feature:["Požiadavka","Funkcia","Vlastnosť"],given:["* ","Pokiaľ ","Za predpokladu "],name:"Slovak",native:"Slovensky",scenario:["Príklad","Scenár"],scenarioOutline:["Náčrt Scenáru","Náčrt Scenára","Osnova Scenára"],then:["* ","Tak ","Potom "],when:["* ","Keď ","Ak "]},sl:{and:["In ","Ter "],background:["Kontekst","Osnova","Ozadje"],but:["Toda ","Ampak ","Vendar "],examples:["Primeri","Scenariji"],feature:["Funkcionalnost","Funkcija","Možnosti","Moznosti","Lastnost","Značilnost"],given:["Dano ","Podano ","Zaradi ","Privzeto "],name:"Slovenian",native:"Slovenski",scenario:["Primer","Scenarij"],scenarioOutline:["Struktura scenarija","Skica","Koncept","Oris scenarija","Osnutek"],then:["Nato ","Potem ","Takrat "],when:["Ko ","Ce ","Če ","Kadar "]},"sr-Cyrl":{and:["* ","И "],background:["Контекст","Основа","Позадина"],but:["* ","Али "],examples:["Примери","Сценарији"],feature:["Функционалност","Могућност","Особина"],given:["* ","За дато ","За дате ","За дати "],name:"Serbian",native:"Српски",scenario:["Пример","Сценарио","Пример"],scenarioOutline:["Структура сценарија","Скица","Концепт"],then:["* ","Онда "],when:["* ","Када ","Кад "]},"sr-Latn":{and:["* ","I "],background:["Kontekst","Osnova","Pozadina"],but:["* ","Ali "],examples:["Primeri","Scenariji"],feature:["Funkcionalnost","Mogućnost","Mogucnost","Osobina"],given:["* ","Za dato ","Za date ","Za dati "],name:"Serbian (Latin)",native:"Srpski (Latinica)",scenario:["Scenario","Primer"],scenarioOutline:["Struktura scenarija","Skica","Koncept"],then:["* ","Onda "],when:["* ","Kada ","Kad "]},sv:{and:["* ","Och "],background:["Bakgrund"],but:["* ","Men "],examples:["Exempel"],feature:["Egenskap"],given:["* ","Givet "],name:"Swedish",native:"Svenska",scenario:["Scenario"],scenarioOutline:["Abstrakt Scenario","Scenariomall"],then:["* ","Så "],when:["* ","När "]},ta:{and:["* ","மேலும் ","மற்றும் "],background:["பின்னணி"],but:["* ","ஆனால் "],examples:["எடுத்துக்காட்டுகள்","காட்சிகள்","நிலைமைகளில்"],feature:["அம்சம்","வணிக தேவை","திறன்"],given:["* ","கொடுக்கப்பட்ட "],name:"Tamil",native:"தமிழ்",scenario:["உதாரணமாக","காட்சி"],scenarioOutline:["காட்சி சுருக்கம்","காட்சி வார்ப்புரு"],then:["* ","அப்பொழுது "],when:["* ","எப்போது "]},th:{and:["* ","และ "],background:["แนวคิด"],but:["* ","แต่ "],examples:["ชุดของตัวอย่าง","ชุดของเหตุการณ์"],feature:["โครงหลัก","ความต้องการทางธุรกิจ","ความสามารถ"],given:["* ","กำหนดให้ "],name:"Thai",native:"ไทย",scenario:["เหตุการณ์"],scenarioOutline:["สรุปเหตุการณ์","โครงสร้างของเหตุการณ์"],then:["* ","ดังนั้น "],when:["* ","เมื่อ "]},tl:{and:["* ","మరియు "],background:["నేపథ్యం"],but:["* ","కాని "],examples:["ఉదాహరణలు"],feature:["గుణము"],given:["* ","చెప్పబడినది "],name:"Telugu",native:"తెలుగు",scenario:["ఉదాహరణ","సన్నివేశం"],scenarioOutline:["కథనం"],then:["* ","అప్పుడు "], -when:["* ","ఈ పరిస్థితిలో "]},tlh:{and:["* ","'ej ","latlh "],background:["mo'"],but:["* ","'ach ","'a "],examples:["ghantoH","lutmey"],feature:["Qap","Qu'meH 'ut","perbogh","poQbogh malja'","laH"],given:["* ","ghu' noblu' ","DaH ghu' bejlu' "],name:"Klingon",native:"tlhIngan",scenario:["lut"],scenarioOutline:["lut chovnatlh"],then:["* ","vaj "],when:["* ","qaSDI' "]},tr:{and:["* ","Ve "],background:["Geçmiş"],but:["* ","Fakat ","Ama "],examples:["Örnekler"],feature:["Özellik"],given:["* ","Diyelim ki "],name:"Turkish",native:"Türkçe",scenario:["Örnek","Senaryo"],scenarioOutline:["Senaryo taslağı"],then:["* ","O zaman "],when:["* ","Eğer ki "]},tt:{and:["* ","Һәм ","Вә "],background:["Кереш"],but:["* ","Ләкин ","Әмма "],examples:["Үрнәкләр","Мисаллар"],feature:["Мөмкинлек","Үзенчәлеклелек"],given:["* ","Әйтик "],name:"Tatar",native:"Татарча",scenario:["Сценарий"],scenarioOutline:["Сценарийның төзелеше"],then:["* ","Нәтиҗәдә "],when:["* ","Әгәр "]},uk:{and:["* ","І ","А також ","Та "],background:["Передумова"],but:["* ","Але "],examples:["Приклади"],feature:["Функціонал"],given:["* ","Припустимо ","Припустимо, що ","Нехай ","Дано "],name:"Ukrainian",native:"Українська",scenario:["Приклад","Сценарій"],scenarioOutline:["Структура сценарію"],then:["* ","То ","Тоді "],when:["* ","Якщо ","Коли "]},ur:{and:["* ","اور "],background:["پس منظر"],but:["* ","لیکن "],examples:["مثالیں"],feature:["صلاحیت","کاروبار کی ضرورت","خصوصیت"],given:["* ","اگر ","بالفرض ","فرض کیا "],name:"Urdu",native:"اردو",scenario:["منظرنامہ"],scenarioOutline:["منظر نامے کا خاکہ"],then:["* ","پھر ","تب "],when:["* ","جب "]},uz:{and:["* ","Ва "],background:["Тарих"],but:["* ","Лекин ","Бирок ","Аммо "],examples:["Мисоллар"],feature:["Функционал"],given:["* ","Агар "],name:"Uzbek",native:"Узбекча",scenario:["Сценарий"],scenarioOutline:["Сценарий структураси"],then:["* ","Унда "],when:["* ","Агар "]},vi:{and:["* ","Và "],background:["Bối cảnh"],but:["* ","Nhưng "],examples:["Dữ liệu"],feature:["Tính năng"],given:["* ","Biết ","Cho "],name:"Vietnamese",native:"Tiếng Việt",scenario:["Tình huống","Kịch bản"],scenarioOutline:["Khung tình huống","Khung kịch bản"],then:["* ","Thì "],when:["* ","Khi "]},"zh-CN":{and:["* ","而且","并且","同时"],background:["背景"],but:["* ","但是"],examples:["例子"],feature:["功能"],given:["* ","假如","假设","假定"],name:"Chinese simplified",native:"简体中文",scenario:["场景","剧本"],scenarioOutline:["场景大纲","剧本大纲"],then:["* ","那么"],when:["* ","当"]},"zh-TW":{and:["* ","而且","並且","同時"],background:["背景"],but:["* ","但是"],examples:["例子"],feature:["功能"],given:["* ","假如","假設","假定"],name:"Chinese traditional",native:"繁體中文",scenario:["場景","劇本"],scenarioOutline:["場景大綱","劇本大綱"],then:["* ","那麼"],when:["* ","當"]}}},{}],9:[function(require,module,exports){var countSymbols=require("./count_symbols");function GherkinLine(lineText,lineNumber){this.lineText=lineText;this.lineNumber=lineNumber;this.trimmedLineText=lineText.replace(/^\s+/g,"");this.isEmpty=this.trimmedLineText.length==0;this.indent=countSymbols(lineText)-countSymbols(this.trimmedLineText)}GherkinLine.prototype.startsWith=function startsWith(prefix){return this.trimmedLineText.indexOf(prefix)==0};GherkinLine.prototype.startsWithTitleKeyword=function startsWithTitleKeyword(keyword){return this.startsWith(keyword+":")};GherkinLine.prototype.getLineText=function getLineText(indentToRemove){if(indentToRemove<0||indentToRemove>this.indent){return this.trimmedLineText}else{return this.lineText.substring(indentToRemove)}};GherkinLine.prototype.getRestTrimmed=function getRestTrimmed(length){return this.trimmedLineText.substring(length).trim()};GherkinLine.prototype.getTableCells=function getTableCells(){var cells=[];var col=0;var startCol=col+1;var cell="";var firstCell=true;while(col0){throw Errors.CompositeParserException.create(context.errors)}return getResult()};function addError(context,error){context.errors.push(error);if(context.errors.length>10)throw Errors.CompositeParserException.create(context.errors)}function startRule(context,ruleType){handleAstError(context,function(){builder.startRule(ruleType)})}function endRule(context,ruleType){handleAstError(context,function(){builder.endRule(ruleType)})}function build(context,token){handleAstError(context,function(){builder.build(token)})}function getResult(){return builder.getResult()}function handleAstError(context,action){handleExternalError(context,true,action)}function handleExternalError(context,defaultValue,action){if(self.stopAtFirstError)return action();try{return action()}catch(e){if(e instanceof Errors.CompositeParserException){e.errors.forEach(function(error){addError(context,error)})}else if(e instanceof Errors.ParserException||e instanceof Errors.AstBuilderException||e instanceof Errors.UnexpectedTokenException||e instanceof Errors.NoSuchLanguageException){addError(context,e)}else{throw e}}return defaultValue}function readToken(context){return context.tokenQueue.length>0?context.tokenQueue.shift():context.tokenScanner.read()}function matchToken(state,token,context){switch(state){case 0:return matchTokenAt_0(token,context);case 1:return matchTokenAt_1(token,context);case 2:return matchTokenAt_2(token,context);case 3:return matchTokenAt_3(token,context);case 4:return matchTokenAt_4(token,context);case 5:return matchTokenAt_5(token,context);case 6:return matchTokenAt_6(token,context);case 7:return matchTokenAt_7(token,context);case 8:return matchTokenAt_8(token,context);case 9:return matchTokenAt_9(token,context);case 10:return matchTokenAt_10(token,context);case 11:return matchTokenAt_11(token,context);case 12:return matchTokenAt_12(token,context);case 13:return matchTokenAt_13(token,context);case 14:return matchTokenAt_14(token,context);case 15:return matchTokenAt_15(token,context);case 16:return matchTokenAt_16(token,context);case 17:return matchTokenAt_17(token,context);case 18:return matchTokenAt_18(token,context);case 19:return matchTokenAt_19(token,context);case 20:return matchTokenAt_20(token,context);case 21:return matchTokenAt_21(token,context);case 23:return matchTokenAt_23(token,context);case 24:return matchTokenAt_24(token,context);case 25:return matchTokenAt_25(token,context);case 26:return matchTokenAt_26(token,context);default:throw new Error("Unknown state: "+state)}}function matchTokenAt_0(token,context){if(match_EOF(context,token)){build(context,token);return 22}if(match_Language(context,token)){startRule(context,"Feature");startRule(context,"FeatureHeader");build(context,token);return 1}if(match_TagLine(context,token)){startRule(context,"Feature");startRule(context,"FeatureHeader");startRule(context,"Tags");build(context,token);return 2}if(match_FeatureLine(context,token)){startRule(context,"Feature");startRule(context,"FeatureHeader");build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 0}if(match_Empty(context,token)){build(context,token);return 0}var stateComment="State: 0 - Start";token.detach();var expectedTokens=["#EOF","#Language","#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 0}function matchTokenAt_1(token,context){if(match_TagLine(context,token)){startRule(context,"Tags");build(context,token);return 2}if(match_FeatureLine(context,token)){build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 1}if(match_Empty(context,token)){build(context,token);return 1}var stateComment="State: 1 - GherkinDocument:0>Feature:0>FeatureHeader:0>#Language:0";token.detach();var expectedTokens=["#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 1}function matchTokenAt_2(token,context){if(match_TagLine(context,token)){build(context,token);return 2}if(match_FeatureLine(context,token)){endRule(context,"Tags");build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 2}if(match_Empty(context,token)){build(context,token);return 2}var stateComment="State: 2 - GherkinDocument:0>Feature:0>FeatureHeader:1>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 2}function matchTokenAt_3(token,context){if(match_EOF(context,token)){endRule(context,"FeatureHeader");endRule(context,"Feature");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 4}var stateComment="State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 3}function matchTokenAt_4(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");endRule(context,"Feature");build(context,token);return 22}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Other(context,token)){build(context,token);return 4}var stateComment="State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 4}function matchTokenAt_5(token,context){if(match_EOF(context,token)){endRule(context,"FeatureHeader");endRule(context,"Feature");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Empty(context,token)){build(context,token);return 5}var stateComment="State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 5}function matchTokenAt_6(token,context){if(match_EOF(context,token)){endRule(context,"Background");endRule(context,"Feature");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 6}if(match_Comment(context,token)){build(context,token);return 8}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 7}var stateComment="State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 6}function matchTokenAt_7(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 22}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 8}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Other(context,token)){build(context,token);return 7}var stateComment="State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 7}function matchTokenAt_8(token,context){if(match_EOF(context,token)){endRule(context,"Background");endRule(context,"Feature");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 8}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Empty(context,token)){build(context,token);return 8}var stateComment="State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 8}function matchTokenAt_9(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 22}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 10}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 25}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 9}if(match_Empty(context,token)){build(context,token);return 9}var stateComment="State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 9}function matchTokenAt_10(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 22}if(match_TableRow(context,token)){build(context,token);return 10}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 10}if(match_Empty(context,token)){build(context,token);return 10}var stateComment="State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 10}function matchTokenAt_11(token,context){if(match_TagLine(context,token)){build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Tags");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 11}if(match_Empty(context,token)){build(context,token);return 11}var stateComment="State: 11 - GherkinDocument:0>Feature:2>ScenarioDefinition:0>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 11}function matchTokenAt_12(token,context){if(match_EOF(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 14}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 13}var stateComment="State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 12}function matchTokenAt_13(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 14}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Description");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Description");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Other(context,token)){build(context,token);return 13}var stateComment="State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 13}function matchTokenAt_14(token,context){if(match_EOF(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 14}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Empty(context,token)){build(context,token);return 14}var stateComment="State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 14}function matchTokenAt_15(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 16}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 23}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 15}if(match_Empty(context,token)){build(context,token);return 15}var stateComment="State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 15}function matchTokenAt_16(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_TableRow(context,token)){build(context,token);return 16}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 16}if(match_Empty(context,token)){build(context,token);return 16}var stateComment="State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 16}function matchTokenAt_17(token,context){if(match_TagLine(context,token)){build(context,token);return 17}if(match_ExamplesLine(context,token)){endRule(context,"Tags");startRule(context,"Examples");build(context,token);return 18}if(match_Comment(context,token)){build(context,token);return 17}if(match_Empty(context,token)){build(context,token);return 17}var stateComment="State: 17 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#ExamplesLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 17}function matchTokenAt_18(token,context){if(match_EOF(context,token)){endRule(context,"Examples") -;endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 18}if(match_Comment(context,token)){build(context,token);return 20}if(match_TableRow(context,token)){startRule(context,"ExamplesTable");build(context,token);return 21}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 19}var stateComment="State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 18}function matchTokenAt_19(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 20}if(match_TableRow(context,token)){endRule(context,"Description");startRule(context,"ExamplesTable");build(context,token);return 21}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Other(context,token)){build(context,token);return 19}var stateComment="State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 19}function matchTokenAt_20(token,context){if(match_EOF(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 20}if(match_TableRow(context,token)){startRule(context,"ExamplesTable");build(context,token);return 21}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Empty(context,token)){build(context,token);return 20}var stateComment="State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 20}function matchTokenAt_21(token,context){if(match_EOF(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_TableRow(context,token)){build(context,token);return 21}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 21}if(match_Empty(context,token)){build(context,token);return 21}var stateComment="State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 21}function matchTokenAt_23(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 24}if(match_Other(context,token)){build(context,token);return 23}var stateComment="State: 23 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 23}function matchTokenAt_24(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 22}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 24}if(match_Empty(context,token)){build(context,token);return 24}var stateComment="State: 24 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 24}function matchTokenAt_25(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 26}if(match_Other(context,token)){build(context,token);return 25}var stateComment="State: 25 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 25}function matchTokenAt_26(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 22}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 26}if(match_Empty(context,token)){build(context,token);return 26}var stateComment="State: 26 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 26}function match_EOF(context,token){return handleExternalError(context,false,function(){return context.tokenMatcher.match_EOF(token)})}function match_Empty(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Empty(token)})}function match_Comment(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Comment(token)})}function match_TagLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_TagLine(token)})}function match_FeatureLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_FeatureLine(token)})}function match_BackgroundLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_BackgroundLine(token)})}function match_ScenarioLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_ScenarioLine(token)})}function match_ExamplesLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_ExamplesLine(token)})}function match_StepLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_StepLine(token)})}function match_DocStringSeparator(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_DocStringSeparator(token)})}function match_TableRow(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_TableRow(token)})}function match_Language(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Language(token)})}function match_Other(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Other(token)})}function lookahead_0(context,currentToken){currentToken.detach();var token;var queue=[];var match=false;do{token=readToken(context);token.detach();queue.push(token);if(false||match_ExamplesLine(context,token)){match=true;break}}while(false||match_Empty(context,token)||match_Comment(context,token)||match_TagLine(context,token));context.tokenQueue=context.tokenQueue.concat(queue);return match}}},{"./ast_builder":2,"./errors":6,"./token_matcher":13,"./token_scanner":14}],11:[function(require,module,exports){var countSymbols=require("../count_symbols");function Compiler(){this.compile=function(gherkin_document){var pickles=[];if(gherkin_document.feature==null)return pickles;var feature=gherkin_document.feature;var language=feature.language;var featureTags=feature.tags;var backgroundSteps=[];feature.children.forEach(function(stepsContainer){if(stepsContainer.type==="Background"){backgroundSteps=pickleSteps(stepsContainer)}else if(stepsContainer.examples.length===0){compileScenario(featureTags,backgroundSteps,stepsContainer,language,pickles)}else{compileScenarioOutline(featureTags,backgroundSteps,stepsContainer,language,pickles)}});return pickles};function compileScenario(featureTags,backgroundSteps,scenario,language,pickles){var steps=scenario.steps.length==0?[]:[].concat(backgroundSteps);var tags=[].concat(featureTags).concat(scenario.tags);scenario.steps.forEach(function(step){steps.push(pickleStep(step))});var pickle={tags:pickleTags(tags),name:scenario.name,language:language,locations:[pickleLocation(scenario.location)],steps:steps};pickles.push(pickle)}function compileScenarioOutline(featureTags,backgroundSteps,scenario,language,pickles){scenario.examples.filter(function(e){return e.tableHeader!=undefined}).forEach(function(examples){var variableCells=examples.tableHeader.cells;examples.tableBody.forEach(function(values){var valueCells=values.cells;var steps=scenario.steps.length==0?[]:[].concat(backgroundSteps);var tags=[].concat(featureTags).concat(scenario.tags).concat(examples.tags);scenario.steps.forEach(function(scenarioOutlineStep){var stepText=interpolate(scenarioOutlineStep.text,variableCells,valueCells);var args=createPickleArguments(scenarioOutlineStep.argument,variableCells,valueCells);var pickleStep={text:stepText,arguments:args,locations:[pickleLocation(values.location),pickleStepLocation(scenarioOutlineStep)]};steps.push(pickleStep)});var pickle={name:interpolate(scenario.name,variableCells,valueCells),language:language,steps:steps,tags:pickleTags(tags),locations:[pickleLocation(values.location),pickleLocation(scenario.location)]};pickles.push(pickle)})})}function createPickleArguments(argument,variableCells,valueCells){var result=[];if(!argument)return result;if(argument.type==="DataTable"){var table={rows:argument.rows.map(function(row){return{cells:row.cells.map(function(cell){return{location:pickleLocation(cell.location),value:interpolate(cell.value,variableCells,valueCells)}})}})};result.push(table)}else if(argument.type==="DocString"){var docString={location:pickleLocation(argument.location),content:interpolate(argument.content,variableCells,valueCells)};if(argument.contentType){docString.contentType=interpolate(argument.contentType,variableCells,valueCells)}result.push(docString)}else{throw Error("Internal error")}return result}function interpolate(name,variableCells,valueCells){variableCells.forEach(function(variableCell,n){var valueCell=valueCells[n];var search=new RegExp("<"+variableCell.value+">","g");var replacement=valueCell.value.replace(new RegExp("\\$","g"),"$$$$");name=name.replace(search,replacement)});return name}function pickleSteps(scenarioDefinition){return scenarioDefinition.steps.map(function(step){return pickleStep(step)})}function pickleStep(step){return{text:step.text,arguments:createPickleArguments(step.argument,[],[]),locations:[pickleStepLocation(step)]}}function pickleStepLocation(step){return{line:step.location.line,column:step.location.column+(step.keyword?countSymbols(step.keyword):0)}}function pickleLocation(location){return{line:location.line,column:location.column}}function pickleTags(tags){return tags.map(function(tag){return pickleTag(tag)})}function pickleTag(tag){return{name:tag.name,location:pickleLocation(tag.location)}}}module.exports=Compiler},{"../count_symbols":4}],12:[function(require,module,exports){function Token(line,location){this.line=line;this.location=location;this.isEof=line==null}Token.prototype.getTokenValue=function(){return this.isEof?"EOF":this.line.getLineText(-1)};Token.prototype.detach=function(){};module.exports=Token},{}],13:[function(require,module,exports){var DIALECTS=require("./dialects");var Errors=require("./errors");var LANGUAGE_PATTERN=/^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/;module.exports=function TokenMatcher(defaultDialectName){defaultDialectName=defaultDialectName||"en";var dialect;var dialectName;var activeDocStringSeparator;var indentToRemove;function changeDialect(newDialectName,location){var newDialect=DIALECTS[newDialectName];if(!newDialect){throw Errors.NoSuchLanguageException.create(newDialectName,location)}dialectName=newDialectName;dialect=newDialect}this.reset=function(){if(dialectName!=defaultDialectName)changeDialect(defaultDialectName);activeDocStringSeparator=null;indentToRemove=0};this.reset();this.match_TagLine=function match_TagLine(token){if(token.line.startsWith("@")){setTokenMatched(token,"TagLine",null,null,null,token.line.getTags());return true}return false};this.match_FeatureLine=function match_FeatureLine(token){return matchTitleLine(token,"FeatureLine",dialect.feature)};this.match_ScenarioLine=function match_ScenarioLine(token){return matchTitleLine(token,"ScenarioLine",dialect.scenario)||matchTitleLine(token,"ScenarioLine",dialect.scenarioOutline)};this.match_BackgroundLine=function match_BackgroundLine(token){return matchTitleLine(token,"BackgroundLine",dialect.background)};this.match_ExamplesLine=function match_ExamplesLine(token){return matchTitleLine(token,"ExamplesLine",dialect.examples)};this.match_TableRow=function match_TableRow(token){if(token.line.startsWith("|")){setTokenMatched(token,"TableRow",null,null,null,token.line.getTableCells());return true}return false};this.match_Empty=function match_Empty(token){if(token.line.isEmpty){setTokenMatched(token,"Empty",null,null,0);return true}return false};this.match_Comment=function match_Comment(token){if(token.line.startsWith("#")){var text=token.line.getLineText(0);setTokenMatched(token,"Comment",text,null,0);return true}return false};this.match_Language=function match_Language(token){var match;if(match=token.line.trimmedLineText.match(LANGUAGE_PATTERN)){var newDialectName=match[1];setTokenMatched(token,"Language",newDialectName);changeDialect(newDialectName,token.location);return true}return false};this.match_DocStringSeparator=function match_DocStringSeparator(token){return activeDocStringSeparator==null?_match_DocStringSeparator(token,'"""',true)||_match_DocStringSeparator(token,"```",true):_match_DocStringSeparator(token,activeDocStringSeparator,false)};function _match_DocStringSeparator(token,separator,isOpen){if(token.line.startsWith(separator)){var contentType=null;if(isOpen){contentType=token.line.getRestTrimmed(separator.length);activeDocStringSeparator=separator;indentToRemove=token.line.indent}else{activeDocStringSeparator=null;indentToRemove=0}setTokenMatched(token,"DocStringSeparator",contentType);return true}return false}this.match_EOF=function match_EOF(token){if(token.isEof){setTokenMatched(token,"EOF");return true}return false};this.match_StepLine=function match_StepLine(token){var keywords=[].concat(dialect.given).concat(dialect.when).concat(dialect.then).concat(dialect.and).concat(dialect.but);var length=keywords.length;for(var i=0,keyword;i0&&lines[lines.length-1].trim()==""){lines.pop()}var lineNumber=0;this.read=function(){var line=lines[lineNumber++];var location={line:lineNumber,column:0};return line==null?new Token(null,location):new Token(new GherkinLine(line,lineNumber),location)}}},{"./gherkin_line":9,"./token":12}]},{},[1]); +(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i0?separatorToken.matchedText:undefined;var lineTokens=node.getTokens("Other");var content=lineTokens.map(function(t){return t.matchedText}).join("\n");var result={type:node.ruleType,location:getLocation(separatorToken),content:content};if(contentType){result.contentType=contentType}return result;case"DataTable":var rows=getTableRows(node);return{type:node.ruleType,location:rows[0].location,rows:rows};case"Background":var backgroundLine=node.getToken("BackgroundLine");var description=getDescription(node);var steps=getSteps(node);return{type:node.ruleType,location:getLocation(backgroundLine),keyword:backgroundLine.matchedKeyword,name:backgroundLine.matchedText,description:description,steps:steps};case"ScenarioDefinition":var tags=getTags(node);var scenarioNode=node.getSingle("Scenario");var scenarioLine=scenarioNode.getToken("ScenarioLine");var description=getDescription(scenarioNode);var steps=getSteps(scenarioNode);var examples=scenarioNode.getItems("ExamplesDefinition");return{type:scenarioNode.ruleType,tags:tags,location:getLocation(scenarioLine),keyword:scenarioLine.matchedKeyword,name:scenarioLine.matchedText,description:description,steps:steps,examples:examples};case"ExamplesDefinition":var tags=getTags(node);var examplesNode=node.getSingle("Examples");var examplesLine=examplesNode.getToken("ExamplesLine");var description=getDescription(examplesNode);var exampleTable=examplesNode.getSingle("ExamplesTable");return{type:examplesNode.ruleType,tags:tags,location:getLocation(examplesLine),keyword:examplesLine.matchedKeyword,name:examplesLine.matchedText,description:description,tableHeader:exampleTable!=undefined?exampleTable.tableHeader:undefined,tableBody:exampleTable!=undefined?exampleTable.tableBody:undefined};case"ExamplesTable":var rows=getTableRows(node);return{tableHeader:rows!=undefined?rows[0]:undefined,tableBody:rows!=undefined?rows.slice(1):undefined};case"Description":var lineTokens=node.getTokens("Other");var end=lineTokens.length;while(end>0&&lineTokens[end-1].line.trimmedLineText===""){end--}lineTokens=lineTokens.slice(0,end);var description=lineTokens.map(function(token){return token.matchedText}).join("\n");return description;case"Feature":var header=node.getSingle("FeatureHeader");if(!header)return null;var tags=getTags(header);var featureLine=header.getToken("FeatureLine");if(!featureLine)return null;var children=[];var background=node.getSingle("Background");if(background)children.push(background);children=children.concat(node.getItems("ScenarioDefinition"));children=children.concat(node.getItems("Rule"));var description=getDescription(header);var language=featureLine.matchedGherkinDialect;return{type:node.ruleType,tags:tags,location:getLocation(featureLine),language:language,keyword:featureLine.matchedKeyword,name:featureLine.matchedText,description:description,children:children};case"Rule":var header=node.getSingle("RuleHeader");if(!header)return null;var ruleLine=header.getToken("RuleLine");if(!ruleLine)return null;var children=[];var background=node.getSingle("Background");if(background)children.push(background);children=children.concat(node.getItems("ScenarioDefinition"));var description=getDescription(header);return{type:node.ruleType,location:getLocation(ruleLine),keyword:ruleLine.matchedKeyword,name:ruleLine.matchedText,description:description,children:children};case"GherkinDocument":var feature=node.getSingle("Feature");return{type:node.ruleType,feature:feature,comments:comments};default:return node}}}},{"./ast_node":3,"./errors":6}],3:[function(require,module,exports){function AstNode(ruleType){this.ruleType=ruleType;this._subItems={}}AstNode.prototype.add=function(ruleType,obj){var items=this._subItems[ruleType];if(items===undefined)this._subItems[ruleType]=items=[];items.push(obj)};AstNode.prototype.getSingle=function(ruleType){return(this._subItems[ruleType]||[])[0]};AstNode.prototype.getItems=function(ruleType){return this._subItems[ruleType]||[]};AstNode.prototype.getToken=function(tokenType){return this.getSingle(tokenType)};AstNode.prototype.getTokens=function(tokenType){return this._subItems[tokenType]||[]};module.exports=AstNode},{}],4:[function(require,module,exports){var regexAstralSymbols=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;module.exports=function countSymbols(string){return string.replace(regexAstralSymbols,"_").length}},{}],5:[function(require,module,exports){module.exports=require("./gherkin-languages.json")},{"./gherkin-languages.json":8}],6:[function(require,module,exports){var Errors={};["ParserException","CompositeParserException","UnexpectedTokenException","UnexpectedEOFException","AstBuilderException","NoSuchLanguageException"].forEach(function(name){function ErrorProto(message){this.message=message||"Unspecified "+name;if(Error.captureStackTrace){Error.captureStackTrace(this,arguments.callee)}}ErrorProto.prototype=Object.create(Error.prototype);ErrorProto.prototype.name=name;ErrorProto.prototype.constructor=ErrorProto;Errors[name]=ErrorProto});Errors.CompositeParserException.create=function(errors){var message="Parser errors:\n"+errors.map(function(e){return e.message}).join("\n");var err=new Errors.CompositeParserException(message);err.errors=errors;return err};Errors.UnexpectedTokenException.create=function(token,expectedTokenTypes,stateComment){var message="expected: "+expectedTokenTypes.join(", ")+", got '"+token.getTokenValue().trim()+"'";var location=!token.location.column?{line:token.location.line,column:token.line.indent+1}:token.location;return createError(Errors.UnexpectedEOFException,message,location)};Errors.UnexpectedEOFException.create=function(token,expectedTokenTypes,stateComment){var message="unexpected end of file, expected: "+expectedTokenTypes.join(", ");return createError(Errors.UnexpectedTokenException,message,token.location)};Errors.AstBuilderException.create=function(message,location){return createError(Errors.AstBuilderException,message,location)};Errors.NoSuchLanguageException.create=function(language,location){var message="Language not supported: "+language;return createError(Errors.NoSuchLanguageException,message,location)};function createError(Ctor,message,location){var fullMessage="("+location.line+":"+location.column+"): "+message;var error=new Ctor(fullMessage);error.location=location;return error}module.exports=Errors},{}],7:[function(require,module,exports){var Parser=require("./parser");var Compiler=require("./pickles/compiler");var compiler=new Compiler;var parser=new Parser;parser.stopAtFirstError=false;function generateEvents(data,uri,types,language){types=Object.assign({source:true,"gherkin-document":true,pickle:true},types||{});result=[];try{if(types["source"]){result.push({type:"source",uri:uri,data:data,media:{encoding:"utf-8",type:"text/x.cucumber.gherkin+plain"}})}if(!types["gherkin-document"]&&!types["pickle"])return result;var gherkinDocument=parser.parse(data,language);if(types["gherkin-document"]){result.push({type:"gherkin-document",uri:uri,document:gherkinDocument})}if(types["pickle"]){var pickles=compiler.compile(gherkinDocument);for(var p in pickles){result.push({type:"pickle",uri:uri,pickle:pickles[p]})}}}catch(err){var errors=err.errors||[err];for(var e in errors){result.push({type:"attachment",source:{uri:uri,start:{line:errors[e].location.line,column:errors[e].location.column}},data:errors[e].message,media:{encoding:"utf-8",type:"text/x.cucumber.stacktrace+plain"}})}}return result}module.exports=generateEvents},{"./parser":10,"./pickles/compiler":11}],8:[function(require,module,exports){module.exports={af:{and:["* ","En "],background:["Agtergrond"],but:["* ","Maar "],examples:["Voorbeelde"],feature:["Funksie","Besigheid Behoefte","Vermoë"],given:["* ","Gegewe "],name:"Afrikaans",native:"Afrikaans",scenario:["Voorbeeld","Situasie"],scenarioOutline:["Situasie Uiteensetting"],then:["* ","Dan "],when:["* ","Wanneer "]},am:{and:["* ","Եվ "],background:["Կոնտեքստ"],but:["* ","Բայց "],examples:["Օրինակներ"],feature:["Ֆունկցիոնալություն","Հատկություն"],given:["* ","Դիցուք "],name:"Armenian",native:"հայերեն",scenario:["Օրինակ","Սցենար"],scenarioOutline:["Սցենարի կառուցվացքը"],then:["* ","Ապա "],when:["* ","Եթե ","Երբ "]},an:{and:["* ","Y ","E "],background:["Antecedents"],but:["* ","Pero "],examples:["Eixemplos"],feature:["Caracteristica"],given:["* ","Dau ","Dada ","Daus ","Dadas "],name:"Aragonese",native:"Aragonés",scenario:["Eixemplo","Caso"],scenarioOutline:["Esquema del caso"],then:["* ","Alavez ","Allora ","Antonces "],when:["* ","Cuan "]},ar:{and:["* ","و "],background:["الخلفية"],but:["* ","لكن "],examples:["امثلة"],feature:["خاصية"],given:["* ","بفرض "],name:"Arabic",native:"العربية",scenario:["مثال","سيناريو"],scenarioOutline:["سيناريو مخطط"],then:["* ","اذاً ","ثم "],when:["* ","متى ","عندما "]},ast:{and:["* ","Y ","Ya "],background:["Antecedentes"],but:["* ","Peru "],examples:["Exemplos"],feature:["Carauterística"],given:["* ","Dáu ","Dada ","Daos ","Daes "],name:"Asturian",native:"asturianu",scenario:["Exemplo","Casu"],scenarioOutline:["Esbozu del casu"],then:["* ","Entós "],when:["* ","Cuando "]},az:{and:["* ","Və ","Həm "],background:["Keçmiş","Kontekst"],but:["* ","Amma ","Ancaq "],examples:["Nümunələr"],feature:["Özəllik"],given:["* ","Tutaq ki ","Verilir "],name:"Azerbaijani",native:"Azərbaycanca",scenario:["Nümunələr","Ssenari"],scenarioOutline:["Ssenarinin strukturu"],then:["* ","O halda "],when:["* ","Əgər ","Nə vaxt ki "]},bg:{and:["* ","И "],background:["Предистория"],but:["* ","Но "],examples:["Примери"],feature:["Функционалност"],given:["* ","Дадено "],name:"Bulgarian",native:"български",scenario:["Пример","Сценарий"],scenarioOutline:["Рамка на сценарий"],then:["* ","То "],when:["* ","Когато "]},bm:{and:["* ","Dan "],background:["Latar Belakang"],but:["* ","Tetapi ","Tapi "],examples:["Contoh"],feature:["Fungsi"],given:["* ","Diberi ","Bagi "],name:"Malay",native:"Bahasa Melayu",scenario:["Senario","Situasi","Keadaan"],scenarioOutline:["Kerangka Senario","Kerangka Situasi","Kerangka Keadaan","Garis Panduan Senario"],then:["* ","Maka ","Kemudian "],when:["* ","Apabila "]},bs:{and:["* ","I ","A "],background:["Pozadina"],but:["* ","Ali "],examples:["Primjeri"],feature:["Karakteristika"],given:["* ","Dato "],name:"Bosnian",native:"Bosanski",scenario:["Primjer","Scenariju","Scenario"],scenarioOutline:["Scenariju-obris","Scenario-outline"],then:["* ","Zatim "],when:["* ","Kada "]},ca:{and:["* ","I "],background:["Rerefons","Antecedents"],but:["* ","Però "],examples:["Exemples"],feature:["Característica","Funcionalitat"],given:["* ","Donat ","Donada ","Atès ","Atesa "],name:"Catalan",native:"català",scenario:["Exemple","Escenari"],scenarioOutline:["Esquema de l'escenari"],then:["* ","Aleshores ","Cal "],when:["* ","Quan "]},cs:{and:["* ","A také ","A "],background:["Pozadí","Kontext"],but:["* ","Ale "],examples:["Příklady"],feature:["Požadavek"],given:["* ","Pokud ","Za předpokladu "],name:"Czech",native:"Česky",scenario:["Příklad","Scénář"],scenarioOutline:["Náčrt Scénáře","Osnova scénáře"],then:["* ","Pak "],when:["* ","Když "]},"cy-GB":{and:["* ","A "],background:["Cefndir"],but:["* ","Ond "],examples:["Enghreifftiau"],feature:["Arwedd"],given:["* ","Anrhegedig a "],name:"Welsh",native:"Cymraeg",scenario:["Enghraifft","Scenario"],scenarioOutline:["Scenario Amlinellol"],then:["* ","Yna "],when:["* ","Pryd "]},da:{and:["* ","Og "],background:["Baggrund"],but:["* ","Men "],examples:["Eksempler"],feature:["Egenskab"],given:["* ","Givet "],name:"Danish",native:"dansk",scenario:["Eksempel","Scenarie"],scenarioOutline:["Abstrakt Scenario"],then:["* ","Så "],when:["* ","Når "]},de:{and:["* ","Und "],background:["Grundlage"],but:["* ","Aber "],examples:["Beispiele"],feature:["Funktionalität"],given:["* ","Angenommen ","Gegeben sei ","Gegeben seien "],name:"German",native:"Deutsch",scenario:["Beispiel","Szenario"],scenarioOutline:["Szenariogrundriss"],then:["* ","Dann "],when:["* ","Wenn "]},el:{and:["* ","Και "],background:["Υπόβαθρο"],but:["* ","Αλλά "],examples:["Παραδείγματα","Σενάρια"],feature:["Δυνατότητα","Λειτουργία"],given:["* ","Δεδομένου "],name:"Greek",native:"Ελληνικά",scenario:["Παράδειγμα","Σενάριο"],scenarioOutline:["Περιγραφή Σεναρίου","Περίγραμμα Σεναρίου"],then:["* ","Τότε "],when:["* ","Όταν "]},em:{and:["* ","😂"],background:["💤"],but:["* ","😔"],examples:["📓"],feature:["📚"],given:["* ","😐"],name:"Emoji",native:"😀",scenario:["🥒","📕"],scenarioOutline:["📖"],then:["* ","🙏"],when:["* ","🎬"]},en:{and:["* ","And "],background:["Background"],but:["* ","But "],examples:["Examples","Scenarios"],feature:["Feature","Business Need","Ability"],given:["* ","Given "],name:"English",native:"English",rule:["Rule"],scenario:["Example","Scenario"],scenarioOutline:["Scenario Outline","Scenario Template"],then:["* ","Then "],when:["* ","When "]},"en-Scouse":{and:["* ","An "],background:["Dis is what went down"],but:["* ","Buh "],examples:["Examples"],feature:["Feature"],given:["* ","Givun ","Youse know when youse got "],name:"Scouse",native:"Scouse",scenario:["The thing of it is"],scenarioOutline:["Wharrimean is"],then:["* ","Dun ","Den youse gotta "],when:["* ","Wun ","Youse know like when "]},"en-au":{and:["* ","Too right "],background:["First off"],but:["* ","Yeah nah "],examples:["You'll wanna"],feature:["Pretty much"],given:["* ","Y'know "],name:"Australian",native:"Australian",scenario:["Awww, look mate"],scenarioOutline:["Reckon it's like"],then:["* ","But at the end of the day I reckon "],when:["* ","It's just unbelievable "]},"en-lol":{and:["* ","AN "],background:["B4"],but:["* ","BUT "],examples:["EXAMPLZ"],feature:["OH HAI"],given:["* ","I CAN HAZ "],name:"LOLCAT",native:"LOLCAT",scenario:["MISHUN"],scenarioOutline:["MISHUN SRSLY"],then:["* ","DEN "],when:["* ","WEN "]},"en-old":{and:["* ","Ond ","7 "],background:["Aer","Ær"],but:["* ","Ac "],examples:["Se the","Se þe","Se ðe"],feature:["Hwaet","Hwæt"],given:["* ","Thurh ","Þurh ","Ðurh "],name:"Old English",native:"Englisc",scenario:["Swa"],scenarioOutline:["Swa hwaer swa","Swa hwær swa"],then:["* ","Tha ","Þa ","Ða ","Tha the ","Þa þe ","Ða ðe "],when:["* ","Tha ","Þa ","Ða "]},"en-pirate":{and:["* ","Aye "],background:["Yo-ho-ho"],but:["* ","Avast! "],examples:["Dead men tell no tales"],feature:["Ahoy matey!"],given:["* ","Gangway! "],name:"Pirate",native:"Pirate",scenario:["Heave to"],scenarioOutline:["Shiver me timbers"],then:["* ","Let go and haul "],when:["* ","Blimey! "]},eo:{and:["* ","Kaj "],background:["Fono"],but:["* ","Sed "],examples:["Ekzemploj"],feature:["Trajto"],given:["* ","Donitaĵo ","Komence "],name:"Esperanto",native:"Esperanto",scenario:["Ekzemplo","Scenaro","Kazo"],scenarioOutline:["Konturo de la scenaro","Skizo","Kazo-skizo"],then:["* ","Do "],when:["* ","Se "]},es:{and:["* ","Y ","E "],background:["Antecedentes"],but:["* ","Pero "],examples:["Ejemplos"],feature:["Característica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Spanish",native:"español",scenario:["Ejemplo","Escenario"],scenarioOutline:["Esquema del escenario"],then:["* ","Entonces "],when:["* ","Cuando "]},et:{and:["* ","Ja "],background:["Taust"],but:["* ","Kuid "],examples:["Juhtumid"],feature:["Omadus"],given:["* ","Eeldades "],name:"Estonian",native:"eesti keel",scenario:["Juhtum","Stsenaarium"],scenarioOutline:["Raamstjuhtum","Raamstsenaarium"],then:["* ","Siis "],when:["* ","Kui "]},fa:{and:["* ","و "],background:["زمینه"],but:["* ","اما "],examples:["نمونه ها"],feature:["وِیژگی"],given:["* ","با فرض "],name:"Persian",native:"فارسی",scenario:["مثال","سناریو"],scenarioOutline:["الگوی سناریو"],then:["* ","آنگاه "],when:["* ","هنگامی "]},fi:{and:["* ","Ja "],background:["Tausta"],but:["* ","Mutta "],examples:["Tapaukset"],feature:["Ominaisuus"],given:["* ","Oletetaan "],name:"Finnish",native:"suomi",scenario:["Tapaus"],scenarioOutline:["Tapausaihio"],then:["* ","Niin "],when:["* ","Kun "]},fr:{and:["* ","Et que ","Et qu'","Et "],background:["Contexte"],but:["* ","Mais que ","Mais qu'","Mais "],examples:["Exemples"],feature:["Fonctionnalité"],given:["* ","Soit ","Etant donné que ","Etant donné qu'","Etant donné ","Etant donnée ","Etant donnés ","Etant données ","Étant donné que ","Étant donné qu'","Étant donné ","Étant donnée ","Étant donnés ","Étant données "],name:"French",native:"français",rule:["Règle"],scenario:["Exemple","Scénario"],scenarioOutline:["Plan du scénario","Plan du Scénario"],then:["* ","Alors "],when:["* ","Quand ","Lorsque ","Lorsqu'"]},ga:{and:["* ","Agus"],background:["Cúlra"],but:["* ","Ach"],examples:["Samplaí"],feature:["Gné"],given:["* ","Cuir i gcás go","Cuir i gcás nach","Cuir i gcás gur","Cuir i gcás nár"],name:"Irish",native:"Gaeilge",scenario:["Sampla","Cás"],scenarioOutline:["Cás Achomair"],then:["* ","Ansin"],when:["* ","Nuair a","Nuair nach","Nuair ba","Nuair nár"]},gj:{and:["* ","અને "],background:["બેકગ્રાઉન્ડ"],but:["* ","પણ "],examples:["ઉદાહરણો"],feature:["લક્ષણ","વ્યાપાર જરૂર","ક્ષમતા"],given:["* ","આપેલ છે "],name:"Gujarati",native:"ગુજરાતી",scenario:["ઉદાહરણ","સ્થિતિ"],scenarioOutline:["પરિદ્દશ્ય રૂપરેખા","પરિદ્દશ્ય ઢાંચો"],then:["* ","પછી "],when:["* ","ક્યારે "]},gl:{and:["* ","E "],background:["Contexto"],but:["* ","Mais ","Pero "],examples:["Exemplos"],feature:["Característica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Galician",native:"galego",scenario:["Exemplo","Escenario"],scenarioOutline:["Esbozo do escenario"],then:["* ","Entón ","Logo "],when:["* ","Cando "]},he:{and:["* ","וגם "],background:["רקע"],but:["* ","אבל "],examples:["דוגמאות"],feature:["תכונה"],given:["* ","בהינתן "],name:"Hebrew",native:"עברית",scenario:["דוגמא","תרחיש"],scenarioOutline:["תבנית תרחיש"],then:["* ","אז ","אזי "],when:["* ","כאשר "]},hi:{and:["* ","और ","तथा "],background:["पृष्ठभूमि"],but:["* ","पर ","परन्तु ","किन्तु "],examples:["उदाहरण"],feature:["रूप लेख"],given:["* ","अगर ","यदि ","चूंकि "],name:"Hindi",native:"हिंदी",scenario:["परिदृश्य"],scenarioOutline:["परिदृश्य रूपरेखा"],then:["* ","तब ","तदा "],when:["* ","जब ","कदा "]},hr:{and:["* ","I "],background:["Pozadina"],but:["* ","Ali "],examples:["Primjeri","Scenariji"],feature:["Osobina","Mogućnost","Mogucnost"],given:["* ","Zadan ","Zadani ","Zadano "],name:"Croatian",native:"hrvatski",scenario:["Primjer","Scenarij"],scenarioOutline:["Skica","Koncept"],then:["* ","Onda "],when:["* ","Kada ","Kad "]},ht:{and:["* ","Ak ","Epi ","E "],background:["Kontèks","Istorik"],but:["* ","Men "],examples:["Egzanp"],feature:["Karakteristik","Mak","Fonksyonalite"],given:["* ","Sipoze ","Sipoze ke ","Sipoze Ke "],name:"Creole",native:"kreyòl",scenario:["Senaryo"],scenarioOutline:["Plan senaryo","Plan Senaryo","Senaryo deskripsyon","Senaryo Deskripsyon","Dyagram senaryo","Dyagram Senaryo"],then:["* ","Lè sa a ","Le sa a "],when:["* ","Lè ","Le "]},hu:{and:["* ","És "],background:["Háttér"],but:["* ","De "],examples:["Példák"],feature:["Jellemző"],given:["* ","Amennyiben ","Adott "],name:"Hungarian",native:"magyar",scenario:["Példa","Forgatókönyv"],scenarioOutline:["Forgatókönyv vázlat"],then:["* ","Akkor "],when:["* ","Majd ","Ha ","Amikor "]},id:{and:["* ","Dan "],background:["Dasar"],but:["* ","Tapi "],examples:["Contoh"],feature:["Fitur"],given:["* ","Dengan "],name:"Indonesian",native:"Bahasa Indonesia",scenario:["Skenario"],scenarioOutline:["Skenario konsep"],then:["* ","Maka "],when:["* ","Ketika "]},is:{and:["* ","Og "],background:["Bakgrunnur"],but:["* ","En "],examples:["Dæmi","Atburðarásir"],feature:["Eiginleiki"],given:["* ","Ef "],name:"Icelandic",native:"Íslenska",scenario:["Atburðarás"],scenarioOutline:["Lýsing Atburðarásar","Lýsing Dæma"],then:["* ","Þá "],when:["* ","Þegar "]},it:{and:["* ","E "],background:["Contesto"],but:["* ","Ma "],examples:["Esempi"],feature:["Funzionalità"],given:["* ","Dato ","Data ","Dati ","Date "],name:"Italian",native:"italiano",scenario:["Esempio","Scenario"],scenarioOutline:["Schema dello scenario"],then:["* ","Allora "],when:["* ","Quando "]},ja:{and:["* ","かつ"],background:["背景"],but:["* ","しかし","但し","ただし"],examples:["例","サンプル"],feature:["フィーチャ","機能"],given:["* ","前提"],name:"Japanese",native:"日本語",scenario:["シナリオ"],scenarioOutline:["シナリオアウトライン","シナリオテンプレート","テンプレ","シナリオテンプレ"],then:["* ","ならば"],when:["* ","もし"]},jv:{and:["* ","Lan "],background:["Dasar"],but:["* ","Tapi ","Nanging ","Ananging "],examples:["Conto","Contone"],feature:["Fitur"],given:["* ","Nalika ","Nalikaning "],name:"Javanese",native:"Basa Jawa",scenario:["Skenario"],scenarioOutline:["Konsep skenario"],then:["* ","Njuk ","Banjur "],when:["* ","Manawa ","Menawa "]},ka:{and:["* ","და"],background:["კონტექსტი"],but:["* ","მაგ­რამ"],examples:["მაგალითები"],feature:["თვისება"],given:["* ","მოცემული"],name:"Georgian",native:"ქართველი",scenario:["მაგალითად","სცენარის"],scenarioOutline:["სცენარის ნიმუში"],then:["* ","მაშინ"],when:["* ","როდესაც"]},kn:{and:["* ","ಮತ್ತು "],background:["ಹಿನ್ನೆಲೆ"],but:["* ","ಆದರೆ "],examples:["ಉದಾಹರಣೆಗಳು"],feature:["ಹೆಚ್ಚಳ"],given:["* ","ನೀಡಿದ "],name:"Kannada",native:"ಕನ್ನಡ",scenario:["ಉದಾಹರಣೆ","ಕಥಾಸಾರಾಂಶ"],scenarioOutline:["ವಿವರಣೆ"],then:["* ","ನಂತರ "],when:["* ","ಸ್ಥಿತಿಯನ್ನು "]},ko:{and:["* ","그리고"],background:["배경"],but:["* ","하지만","단"],examples:["예"],feature:["기능"],given:["* ","조건","먼저"],name:"Korean",native:"한국어",scenario:["시나리오"],scenarioOutline:["시나리오 개요"],then:["* ","그러면"],when:["* ","만일","만약"]},lt:{and:["* ","Ir "],background:["Kontekstas"],but:["* ","Bet "],examples:["Pavyzdžiai","Scenarijai","Variantai"],feature:["Savybė"],given:["* ","Duota "],name:"Lithuanian",native:"lietuvių kalba",scenario:["Pavyzdys","Scenarijus"],scenarioOutline:["Scenarijaus šablonas"],then:["* ","Tada "],when:["* ","Kai "]},lu:{and:["* ","an ","a "],background:["Hannergrond"],but:["* ","awer ","mä "],examples:["Beispiller"],feature:["Funktionalitéit"],given:["* ","ugeholl "],name:"Luxemburgish",native:"Lëtzebuergesch",scenario:["Beispill","Szenario"],scenarioOutline:["Plang vum Szenario"],then:["* ","dann "],when:["* ","wann "]},lv:{and:["* ","Un "],background:["Konteksts","Situācija"],but:["* ","Bet "],examples:["Piemēri","Paraugs"],feature:["Funkcionalitāte","Fīča"],given:["* ","Kad "],name:"Latvian",native:"latviešu",scenario:["Piemērs","Scenārijs"],scenarioOutline:["Scenārijs pēc parauga"],then:["* ","Tad "],when:["* ","Ja "]},"mk-Cyrl":{and:["* ","И "],background:["Контекст","Содржина"],but:["* ","Но "],examples:["Примери","Сценарија"],feature:["Функционалност","Бизнис потреба","Можност"],given:["* ","Дадено ","Дадена "],name:"Macedonian",native:"Македонски",scenario:["Пример","Сценарио","На пример"],scenarioOutline:["Преглед на сценарија","Скица","Концепт"],then:["* ","Тогаш "],when:["* ","Кога "]},"mk-Latn":{and:["* ","I "],background:["Kontekst","Sodrzhina"],but:["* ","No "],examples:["Primeri","Scenaria"],feature:["Funkcionalnost","Biznis potreba","Mozhnost"],given:["* ","Dadeno ","Dadena "],name:"Macedonian (Latin)",native:"Makedonski (Latinica)",scenario:["Scenario","Na primer"],scenarioOutline:["Pregled na scenarija","Skica","Koncept"],then:["* ","Togash "],when:["* ","Koga "]},mn:{and:["* ","Мөн ","Тэгээд "],background:["Агуулга"],but:["* ","Гэхдээ ","Харин "],examples:["Тухайлбал"],feature:["Функц","Функционал"],given:["* ","Өгөгдсөн нь ","Анх "],name:"Mongolian",native:"монгол",scenario:["Сценар"],scenarioOutline:["Сценарын төлөвлөгөө"],then:["* ","Тэгэхэд ","Үүний дараа "],when:["* ","Хэрэв "]},nl:{and:["* ","En "],background:["Achtergrond"],but:["* ","Maar "],examples:["Voorbeelden"],feature:["Functionaliteit"],given:["* ","Gegeven ","Stel "],name:"Dutch",native:"Nederlands",scenario:["Voorbeeld","Scenario"],scenarioOutline:["Abstract Scenario"],then:["* ","Dan "],when:["* ","Als ","Wanneer "]},no:{and:["* ","Og "],background:["Bakgrunn"],but:["* ","Men "],examples:["Eksempler"],feature:["Egenskap"],given:["* ","Gitt "],name:"Norwegian",native:"norsk",rule:["Regel"],scenario:["Eksempel","Scenario"],scenarioOutline:["Scenariomal","Abstrakt Scenario"],then:["* ","Så "],when:["* ","Når "]},pa:{and:["* ","ਅਤੇ "],background:["ਪਿਛੋਕੜ"],but:["* ","ਪਰ "],examples:["ਉਦਾਹਰਨਾਂ"],feature:["ਖਾਸੀਅਤ","ਮੁਹਾਂਦਰਾ","ਨਕਸ਼ ਨੁਹਾਰ"],given:["* ","ਜੇਕਰ ","ਜਿਵੇਂ ਕਿ "],name:"Panjabi",native:"ਪੰਜਾਬੀ",scenario:["ਉਦਾਹਰਨ","ਪਟਕਥਾ"],scenarioOutline:["ਪਟਕਥਾ ਢਾਂਚਾ","ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ"],then:["* ","ਤਦ "],when:["* ","ਜਦੋਂ "]},pl:{and:["* ","Oraz ","I "],background:["Założenia"],but:["* ","Ale "],examples:["Przykłady"],feature:["Właściwość","Funkcja","Aspekt","Potrzeba biznesowa"],given:["* ","Zakładając ","Mając ","Zakładając, że "],name:"Polish",native:"polski",scenario:["Przykład","Scenariusz"],scenarioOutline:["Szablon scenariusza"],then:["* ","Wtedy "],when:["* ","Jeżeli ","Jeśli ","Gdy ","Kiedy "]},pt:{and:["* ","E "],background:["Contexto","Cenário de Fundo","Cenario de Fundo","Fundo"],but:["* ","Mas "],examples:["Exemplos","Cenários","Cenarios"],feature:["Funcionalidade","Característica","Caracteristica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Portuguese",native:"português",scenario:["Exemplo","Cenário","Cenario"],scenarioOutline:["Esquema do Cenário","Esquema do Cenario","Delineação do Cenário","Delineacao do Cenario"],then:["* ","Então ","Entao "],when:["* ","Quando "]},ro:{and:["* ","Si ","Și ","Şi "],background:["Context"],but:["* ","Dar "],examples:["Exemple"],feature:["Functionalitate","Funcționalitate","Funcţionalitate"],given:["* ","Date fiind ","Dat fiind ","Dată fiind","Dati fiind ","Dați fiind ","Daţi fiind "],name:"Romanian",native:"română",scenario:["Exemplu","Scenariu"],scenarioOutline:["Structura scenariu","Structură scenariu"],then:["* ","Atunci "],when:["* ","Cand ","Când "]},ru:{and:["* ","И ","К тому же ","Также "],background:["Предыстория","Контекст"],but:["* ","Но ","А ","Иначе "],examples:["Примеры"],feature:["Функция","Функциональность","Функционал","Свойство"],given:["* ","Допустим ","Дано ","Пусть "],name:"Russian",native:"русский",scenario:["Пример","Сценарий"],scenarioOutline:["Структура сценария"],then:["* ","То ","Затем ","Тогда "],when:["* ","Когда ","Если "]},sk:{and:["* ","A ","A tiež ","A taktiež ","A zároveň "],background:["Pozadie"],but:["* ","Ale "],examples:["Príklady"],feature:["Požiadavka","Funkcia","Vlastnosť"],given:["* ","Pokiaľ ","Za predpokladu "],name:"Slovak",native:"Slovensky",scenario:["Príklad","Scenár"],scenarioOutline:["Náčrt Scenáru","Náčrt Scenára","Osnova Scenára"],then:["* ","Tak ","Potom "],when:["* ","Keď ","Ak "]},sl:{and:["In ","Ter "],background:["Kontekst","Osnova","Ozadje"],but:["Toda ","Ampak ","Vendar "],examples:["Primeri","Scenariji"],feature:["Funkcionalnost","Funkcija","Možnosti","Moznosti","Lastnost","Značilnost"],given:["Dano ","Podano ","Zaradi ","Privzeto "],name:"Slovenian",native:"Slovenski",scenario:["Primer","Scenarij"],scenarioOutline:["Struktura scenarija","Skica","Koncept","Oris scenarija","Osnutek"],then:["Nato ","Potem ","Takrat "],when:["Ko ","Ce ","Če ","Kadar "]},"sr-Cyrl":{and:["* ","И "],background:["Контекст","Основа","Позадина"],but:["* ","Али "],examples:["Примери","Сценарији"],feature:["Функционалност","Могућност","Особина"],given:["* ","За дато ","За дате ","За дати "],name:"Serbian",native:"Српски",scenario:["Пример","Сценарио","Пример"],scenarioOutline:["Структура сценарија","Скица","Концепт"],then:["* ","Онда "],when:["* ","Када ","Кад "]},"sr-Latn":{and:["* ","I "],background:["Kontekst","Osnova","Pozadina"],but:["* ","Ali "],examples:["Primeri","Scenariji"],feature:["Funkcionalnost","Mogućnost","Mogucnost","Osobina"],given:["* ","Za dato ","Za date ","Za dati "],name:"Serbian (Latin)",native:"Srpski (Latinica)",scenario:["Scenario","Primer"],scenarioOutline:["Struktura scenarija","Skica","Koncept"],then:["* ","Onda "],when:["* ","Kada ","Kad "]},sv:{and:["* ","Och "],background:["Bakgrund"],but:["* ","Men "],examples:["Exempel"],feature:["Egenskap"],given:["* ","Givet "],name:"Swedish",native:"Svenska",scenario:["Scenario"],scenarioOutline:["Abstrakt Scenario","Scenariomall"],then:["* ","Så "],when:["* ","När "]},ta:{and:["* ","மேலும் ","மற்றும் "],background:["பின்னணி"],but:["* ","ஆனால் "],examples:["எடுத்துக்காட்டுகள்","காட்சிகள்","நிலைமைகளில்"],feature:["அம்சம்","வணிக தேவை","திறன்"],given:["* ","கொடுக்கப்பட்ட "],name:"Tamil",native:"தமிழ்",scenario:["உதாரணமாக","காட்சி"],scenarioOutline:["காட்சி சுருக்கம்","காட்சி வார்ப்புரு"],then:["* ","அப்பொழுது "],when:["* ","எப்போது "]},th:{ +and:["* ","และ "],background:["แนวคิด"],but:["* ","แต่ "],examples:["ชุดของตัวอย่าง","ชุดของเหตุการณ์"],feature:["โครงหลัก","ความต้องการทางธุรกิจ","ความสามารถ"],given:["* ","กำหนดให้ "],name:"Thai",native:"ไทย",scenario:["เหตุการณ์"],scenarioOutline:["สรุปเหตุการณ์","โครงสร้างของเหตุการณ์"],then:["* ","ดังนั้น "],when:["* ","เมื่อ "]},tl:{and:["* ","మరియు "],background:["నేపథ్యం"],but:["* ","కాని "],examples:["ఉదాహరణలు"],feature:["గుణము"],given:["* ","చెప్పబడినది "],name:"Telugu",native:"తెలుగు",scenario:["ఉదాహరణ","సన్నివేశం"],scenarioOutline:["కథనం"],then:["* ","అప్పుడు "],when:["* ","ఈ పరిస్థితిలో "]},tlh:{and:["* ","'ej ","latlh "],background:["mo'"],but:["* ","'ach ","'a "],examples:["ghantoH","lutmey"],feature:["Qap","Qu'meH 'ut","perbogh","poQbogh malja'","laH"],given:["* ","ghu' noblu' ","DaH ghu' bejlu' "],name:"Klingon",native:"tlhIngan",scenario:["lut"],scenarioOutline:["lut chovnatlh"],then:["* ","vaj "],when:["* ","qaSDI' "]},tr:{and:["* ","Ve "],background:["Geçmiş"],but:["* ","Fakat ","Ama "],examples:["Örnekler"],feature:["Özellik"],given:["* ","Diyelim ki "],name:"Turkish",native:"Türkçe",scenario:["Örnek","Senaryo"],scenarioOutline:["Senaryo taslağı"],then:["* ","O zaman "],when:["* ","Eğer ki "]},tt:{and:["* ","Һәм ","Вә "],background:["Кереш"],but:["* ","Ләкин ","Әмма "],examples:["Үрнәкләр","Мисаллар"],feature:["Мөмкинлек","Үзенчәлеклелек"],given:["* ","Әйтик "],name:"Tatar",native:"Татарча",scenario:["Сценарий"],scenarioOutline:["Сценарийның төзелеше"],then:["* ","Нәтиҗәдә "],when:["* ","Әгәр "]},uk:{and:["* ","І ","А також ","Та "],background:["Передумова"],but:["* ","Але "],examples:["Приклади"],feature:["Функціонал"],given:["* ","Припустимо ","Припустимо, що ","Нехай ","Дано "],name:"Ukrainian",native:"Українська",scenario:["Приклад","Сценарій"],scenarioOutline:["Структура сценарію"],then:["* ","То ","Тоді "],when:["* ","Якщо ","Коли "]},ur:{and:["* ","اور "],background:["پس منظر"],but:["* ","لیکن "],examples:["مثالیں"],feature:["صلاحیت","کاروبار کی ضرورت","خصوصیت"],given:["* ","اگر ","بالفرض ","فرض کیا "],name:"Urdu",native:"اردو",scenario:["منظرنامہ"],scenarioOutline:["منظر نامے کا خاکہ"],then:["* ","پھر ","تب "],when:["* ","جب "]},uz:{and:["* ","Ва "],background:["Тарих"],but:["* ","Лекин ","Бирок ","Аммо "],examples:["Мисоллар"],feature:["Функционал"],given:["* ","Агар "],name:"Uzbek",native:"Узбекча",scenario:["Сценарий"],scenarioOutline:["Сценарий структураси"],then:["* ","Унда "],when:["* ","Агар "]},vi:{and:["* ","Và "],background:["Bối cảnh"],but:["* ","Nhưng "],examples:["Dữ liệu"],feature:["Tính năng"],given:["* ","Biết ","Cho "],name:"Vietnamese",native:"Tiếng Việt",scenario:["Tình huống","Kịch bản"],scenarioOutline:["Khung tình huống","Khung kịch bản"],then:["* ","Thì "],when:["* ","Khi "]},"zh-CN":{and:["* ","而且","并且","同时"],background:["背景"],but:["* ","但是"],examples:["例子"],feature:["功能"],given:["* ","假如","假设","假定"],name:"Chinese simplified",native:"简体中文",scenario:["场景","剧本"],scenarioOutline:["场景大纲","剧本大纲"],then:["* ","那么"],when:["* ","当"]},"zh-TW":{and:["* ","而且","並且","同時"],background:["背景"],but:["* ","但是"],examples:["例子"],feature:["功能"],given:["* ","假如","假設","假定"],name:"Chinese traditional",native:"繁體中文",scenario:["場景","劇本"],scenarioOutline:["場景大綱","劇本大綱"],then:["* ","那麼"],when:["* ","當"]}}},{}],9:[function(require,module,exports){var countSymbols=require("./count_symbols");function GherkinLine(lineText,lineNumber){this.lineText=lineText;this.lineNumber=lineNumber;this.trimmedLineText=lineText.replace(/^\s+/g,"");this.isEmpty=this.trimmedLineText.length==0;this.indent=countSymbols(lineText)-countSymbols(this.trimmedLineText)}GherkinLine.prototype.startsWith=function startsWith(prefix){return this.trimmedLineText.indexOf(prefix)==0};GherkinLine.prototype.startsWithTitleKeyword=function startsWithTitleKeyword(keyword){return this.startsWith(keyword+":")};GherkinLine.prototype.getLineText=function getLineText(indentToRemove){if(indentToRemove<0||indentToRemove>this.indent){return this.trimmedLineText}else{return this.lineText.substring(indentToRemove)}};GherkinLine.prototype.getRestTrimmed=function getRestTrimmed(length){return this.trimmedLineText.substring(length).trim()};GherkinLine.prototype.getTableCells=function getTableCells(){var cells=[];var col=0;var startCol=col+1;var cell="";var firstCell=true;while(col0){throw Errors.CompositeParserException.create(context.errors)}return getResult()};function addError(context,error){context.errors.push(error);if(context.errors.length>10)throw Errors.CompositeParserException.create(context.errors)}function startRule(context,ruleType){handleAstError(context,function(){builder.startRule(ruleType)})}function endRule(context,ruleType){handleAstError(context,function(){builder.endRule(ruleType)})}function build(context,token){handleAstError(context,function(){builder.build(token)})}function getResult(){return builder.getResult()}function handleAstError(context,action){handleExternalError(context,true,action)}function handleExternalError(context,defaultValue,action){if(self.stopAtFirstError)return action();try{return action()}catch(e){if(e instanceof Errors.CompositeParserException){e.errors.forEach(function(error){addError(context,error)})}else if(e instanceof Errors.ParserException||e instanceof Errors.AstBuilderException||e instanceof Errors.UnexpectedTokenException||e instanceof Errors.NoSuchLanguageException){addError(context,e)}else{throw e}}return defaultValue}function readToken(context){return context.tokenQueue.length>0?context.tokenQueue.shift():context.tokenScanner.read()}function matchToken(state,token,context){switch(state){case 0:return matchTokenAt_0(token,context);case 1:return matchTokenAt_1(token,context);case 2:return matchTokenAt_2(token,context);case 3:return matchTokenAt_3(token,context);case 4:return matchTokenAt_4(token,context);case 5:return matchTokenAt_5(token,context);case 6:return matchTokenAt_6(token,context);case 7:return matchTokenAt_7(token,context);case 8:return matchTokenAt_8(token,context);case 9:return matchTokenAt_9(token,context);case 10:return matchTokenAt_10(token,context);case 11:return matchTokenAt_11(token,context);case 12:return matchTokenAt_12(token,context);case 13:return matchTokenAt_13(token,context);case 14:return matchTokenAt_14(token,context);case 15:return matchTokenAt_15(token,context);case 16:return matchTokenAt_16(token,context);case 17:return matchTokenAt_17(token,context);case 18:return matchTokenAt_18(token,context);case 19:return matchTokenAt_19(token,context);case 20:return matchTokenAt_20(token,context);case 21:return matchTokenAt_21(token,context);case 22:return matchTokenAt_22(token,context);case 23:return matchTokenAt_23(token,context);case 24:return matchTokenAt_24(token,context);case 25:return matchTokenAt_25(token,context);case 26:return matchTokenAt_26(token,context);case 27:return matchTokenAt_27(token,context);case 28:return matchTokenAt_28(token,context);case 29:return matchTokenAt_29(token,context);case 30:return matchTokenAt_30(token,context);case 31:return matchTokenAt_31(token,context);case 32:return matchTokenAt_32(token,context);case 33:return matchTokenAt_33(token,context);case 34:return matchTokenAt_34(token,context);case 35:return matchTokenAt_35(token,context);case 36:return matchTokenAt_36(token,context);case 37:return matchTokenAt_37(token,context);case 38:return matchTokenAt_38(token,context);case 39:return matchTokenAt_39(token,context);case 40:return matchTokenAt_40(token,context);case 42:return matchTokenAt_42(token,context);case 43:return matchTokenAt_43(token,context);case 44:return matchTokenAt_44(token,context);case 45:return matchTokenAt_45(token,context);case 46:return matchTokenAt_46(token,context);case 47:return matchTokenAt_47(token,context);case 48:return matchTokenAt_48(token,context);case 49:return matchTokenAt_49(token,context);default:throw new Error("Unknown state: "+state)}}function matchTokenAt_0(token,context){if(match_EOF(context,token)){build(context,token);return 41}if(match_Language(context,token)){startRule(context,"Feature");startRule(context,"FeatureHeader");build(context,token);return 1}if(match_TagLine(context,token)){startRule(context,"Feature");startRule(context,"FeatureHeader");startRule(context,"Tags");build(context,token);return 2}if(match_FeatureLine(context,token)){startRule(context,"Feature");startRule(context,"FeatureHeader");build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 0}if(match_Empty(context,token)){build(context,token);return 0}var stateComment="State: 0 - Start";token.detach();var expectedTokens=["#EOF","#Language","#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 0}function matchTokenAt_1(token,context){if(match_TagLine(context,token)){startRule(context,"Tags");build(context,token);return 2}if(match_FeatureLine(context,token)){build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 1}if(match_Empty(context,token)){build(context,token);return 1}var stateComment="State: 1 - GherkinDocument:0>Feature:0>FeatureHeader:0>#Language:0";token.detach();var expectedTokens=["#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 1}function matchTokenAt_2(token,context){if(match_TagLine(context,token)){build(context,token);return 2}if(match_FeatureLine(context,token)){endRule(context,"Tags");build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 2}if(match_Empty(context,token)){build(context,token);return 2}var stateComment="State: 2 - GherkinDocument:0>Feature:0>FeatureHeader:1>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 2}function matchTokenAt_3(token,context){if(match_EOF(context,token)){endRule(context,"FeatureHeader");endRule(context,"Feature");build(context,token);return 41}if(match_Empty(context,token)){build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 4}var stateComment="State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 3}function matchTokenAt_4(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Description");endRule(context,"FeatureHeader");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){build(context,token);return 4}var stateComment="State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 4}function matchTokenAt_5(token,context){if(match_EOF(context,token)){endRule(context,"FeatureHeader");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"FeatureHeader");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 5}var stateComment="State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 5}function matchTokenAt_6(token,context){if(match_EOF(context,token)){endRule(context,"Background");endRule(context,"Feature");build(context,token);return 41}if(match_Empty(context,token)){build(context,token);return 6}if(match_Comment(context,token)){build(context,token);return 8}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Background");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 7}var stateComment="State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 6}function matchTokenAt_7(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 8}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){build(context,token);return 7}var stateComment="State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 7}function matchTokenAt_8(token,context){if(match_EOF(context,token)){endRule(context,"Background");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){build(context,token);return 8}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Background");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 8}var stateComment="State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 8}function matchTokenAt_9(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 10}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 48}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 9}if(match_Empty(context,token)){build(context,token);return 9}var stateComment="State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 9}function matchTokenAt_10(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){build(context,token);return 10}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 10}if(match_Empty(context,token)){build(context,token);return 10}var stateComment="State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 10}function matchTokenAt_11(token,context){if(match_TagLine(context,token)){build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Tags");startRule(context,"Scenario");build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 11}if(match_Empty(context,token)){build(context,token);return 11}var stateComment="State: 11 - GherkinDocument:0>Feature:2>ScenarioDefinition:0>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 11}function matchTokenAt_12(token,context){if(match_EOF(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_Empty(context,token)){build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 14}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 13}var stateComment="State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 12}function matchTokenAt_13(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 14}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Description");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Description");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){build(context,token);return 13}var stateComment="State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 13}function matchTokenAt_14(token,context){if(match_EOF(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){build(context,token);return 14}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 14}var stateComment="State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 14}function matchTokenAt_15(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 16}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 46}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18} +if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 15}if(match_Empty(context,token)){build(context,token);return 15}var stateComment="State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 15}function matchTokenAt_16(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){build(context,token);return 16}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 16}if(match_Empty(context,token)){build(context,token);return 16}var stateComment="State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 16}function matchTokenAt_17(token,context){if(match_TagLine(context,token)){build(context,token);return 17}if(match_ExamplesLine(context,token)){endRule(context,"Tags");startRule(context,"Examples");build(context,token);return 18}if(match_Comment(context,token)){build(context,token);return 17}if(match_Empty(context,token)){build(context,token);return 17}var stateComment="State: 17 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#ExamplesLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 17}function matchTokenAt_18(token,context){if(match_EOF(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_Empty(context,token)){build(context,token);return 18}if(match_Comment(context,token)){build(context,token);return 20}if(match_TableRow(context,token)){startRule(context,"ExamplesTable");build(context,token);return 21}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 19}var stateComment="State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 18}function matchTokenAt_19(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 20}if(match_TableRow(context,token)){endRule(context,"Description");startRule(context,"ExamplesTable");build(context,token);return 21}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){build(context,token);return 19}var stateComment="State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 19}function matchTokenAt_20(token,context){if(match_EOF(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){build(context,token);return 20}if(match_TableRow(context,token)){startRule(context,"ExamplesTable");build(context,token);return 21}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 20}var stateComment="State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 20}function matchTokenAt_21(token,context){if(match_EOF(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){build(context,token);return 21}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 21}if(match_Empty(context,token)){build(context,token);return 21}var stateComment="State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 21}function matchTokenAt_22(token,context){if(match_EOF(context,token)){endRule(context,"RuleHeader");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Empty(context,token)){build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 24}if(match_BackgroundLine(context,token)){endRule(context,"RuleHeader");startRule(context,"Background");build(context,token);return 25}if(match_TagLine(context,token)){endRule(context,"RuleHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"RuleHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"RuleHeader");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 23}var stateComment="State: 22 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 22}function matchTokenAt_23(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"RuleHeader");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 24}if(match_BackgroundLine(context,token)){endRule(context,"Description");endRule(context,"RuleHeader");startRule(context,"Background");build(context,token);return 25}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"RuleHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"RuleHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Description");endRule(context,"RuleHeader");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){build(context,token);return 23}var stateComment="State: 23 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 23}function matchTokenAt_24(token,context){if(match_EOF(context,token)){endRule(context,"RuleHeader");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){build(context,token);return 24}if(match_BackgroundLine(context,token)){endRule(context,"RuleHeader");startRule(context,"Background");build(context,token);return 25}if(match_TagLine(context,token)){endRule(context,"RuleHeader");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"RuleHeader");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"RuleHeader");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 24}var stateComment="State: 24 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#RuleLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 24}function matchTokenAt_25(token,context){if(match_EOF(context,token)){endRule(context,"Background");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Empty(context,token)){build(context,token);return 25}if(match_Comment(context,token)){build(context,token);return 27}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 28}if(match_TagLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Background");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 26}var stateComment="State: 25 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 25}function matchTokenAt_26(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Background");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 27}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 28}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Description");endRule(context,"Background");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){build(context,token);return 26}var stateComment="State: 26 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 26}function matchTokenAt_27(token,context){if(match_EOF(context,token)){endRule(context,"Background");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){build(context,token);return 27}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 28}if(match_TagLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Background");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 27}var stateComment="State: 27 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 27}function matchTokenAt_28(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"Background");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 29}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 44}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 28}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Step");endRule(context,"Background");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 28}if(match_Empty(context,token)){build(context,token);return 28}var stateComment="State: 28 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 28}function matchTokenAt_29(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){build(context,token);return 29}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 28}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 29}if(match_Empty(context,token)){build(context,token);return 29}var stateComment="State: 29 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 29}function matchTokenAt_30(token,context){if(match_TagLine(context,token)){build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"Tags");startRule(context,"Scenario");build(context,token);return 31}if(match_Comment(context,token)){build(context,token);return 30}if(match_Empty(context,token)){build(context,token);return 30}var stateComment="State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#ScenarioLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 30}function matchTokenAt_31(token,context){if(match_EOF(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Empty(context,token)){build(context,token);return 31}if(match_Comment(context,token)){build(context,token);return 33}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 34}if(match_TagLine(context,token)){if(lookahead_0(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 32}var stateComment="State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 31}function matchTokenAt_32(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 33}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 34}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Description");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){endRule(context,"Description");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){build(context,token);return 32}var stateComment="State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 32}function matchTokenAt_33(token,context){if(match_EOF(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){build(context,token);return 33}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 34}if(match_TagLine(context,token)){if(lookahead_0(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule") +;startRule(context,"RuleHeader");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 33}var stateComment="State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 33}function matchTokenAt_34(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 35}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 42}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 34}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 34}if(match_Empty(context,token)){build(context,token);return 34}var stateComment="State: 34 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 34}function matchTokenAt_35(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){build(context,token);return 35}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 34}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 35}if(match_Empty(context,token)){build(context,token);return 35}var stateComment="State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 35}function matchTokenAt_36(token,context){if(match_TagLine(context,token)){build(context,token);return 36}if(match_ExamplesLine(context,token)){endRule(context,"Tags");startRule(context,"Examples");build(context,token);return 37}if(match_Comment(context,token)){build(context,token);return 36}if(match_Empty(context,token)){build(context,token);return 36}var stateComment="State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#ExamplesLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 36}function matchTokenAt_37(token,context){if(match_EOF(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Empty(context,token)){build(context,token);return 37}if(match_Comment(context,token)){build(context,token);return 39}if(match_TableRow(context,token)){startRule(context,"ExamplesTable");build(context,token);return 40}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 38}var stateComment="State: 37 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 37}function matchTokenAt_38(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 39}if(match_TableRow(context,token)){endRule(context,"Description");startRule(context,"ExamplesTable");build(context,token);return 40}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Other(context,token)){build(context,token);return 38}var stateComment="State: 38 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 38}function matchTokenAt_39(token,context){if(match_EOF(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_Comment(context,token)){build(context,token);return 39}if(match_TableRow(context,token)){startRule(context,"ExamplesTable");build(context,token);return 40}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 39}var stateComment="State: 39 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 39}function matchTokenAt_40(token,context){if(match_EOF(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_TableRow(context,token)){build(context,token);return 40}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"ExamplesTable");endRule(context,"Examples");endRule(context,"ExamplesDefinition");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 40}if(match_Empty(context,token)){build(context,token);return 40}var stateComment="State: 40 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 40}function matchTokenAt_42(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 43}if(match_Other(context,token)){build(context,token);return 42}var stateComment="State: 42 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 42}function matchTokenAt_43(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 34}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 36}}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ExamplesLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 37}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 43}if(match_Empty(context,token)){build(context,token);return 43}var stateComment="State: 43 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 43}function matchTokenAt_44(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 45}if(match_Other(context,token)){build(context,token);return 44}var stateComment="State: 44 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 44}function matchTokenAt_45(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");endRule(context,"Rule");endRule(context,"Feature");build(context,token);return 41}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 28}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 30}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 31}if(match_RuleLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");endRule(context,"Rule");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 45}if(match_Empty(context,token)){build(context,token);return 45}var stateComment="State: 45 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 45}function matchTokenAt_46(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 47}if(match_Other(context,token)){build(context,token);return 46}var stateComment="State: 46 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 46}function matchTokenAt_47(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");endRule(context,"Feature");build(context,token);return 41}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Tags");build(context,token);return 17}}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"ExamplesDefinition");startRule(context,"Examples");build(context,token);return 18}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"ScenarioDefinition");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 47}if(match_Empty(context,token)){build(context,token);return 47}var stateComment="State: 47 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 47}function matchTokenAt_48(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 49}if(match_Other(context,token)){build(context,token);return 48}var stateComment="State: 48 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 48}function matchTokenAt_49(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 41}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"ScenarioDefinition");startRule(context,"Scenario");build(context,token);return 12}if(match_RuleLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"Rule");startRule(context,"RuleHeader");build(context,token);return 22}if(match_Comment(context,token)){build(context,token);return 49}if(match_Empty(context,token)){build(context,token);return 49}var stateComment="State: 49 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ScenarioLine","#RuleLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 49}function match_EOF(context,token){return handleExternalError(context,false,function(){return context.tokenMatcher.match_EOF(token)})}function match_Empty(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Empty(token)})}function match_Comment(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Comment(token)})}function match_TagLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_TagLine(token)})}function match_FeatureLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_FeatureLine(token)})}function match_RuleLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_RuleLine(token)})}function match_BackgroundLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_BackgroundLine(token)})}function match_ScenarioLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_ScenarioLine(token)})}function match_ExamplesLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_ExamplesLine(token)})}function match_StepLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_StepLine(token)})}function match_DocStringSeparator(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_DocStringSeparator(token)})}function match_TableRow(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_TableRow(token)})}function match_Language(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Language(token)})}function match_Other(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Other(token)})}function lookahead_0(context,currentToken){currentToken.detach();var token;var queue=[];var match=false;do{token=readToken(context);token.detach();queue.push(token);if(false||match_ExamplesLine(context,token)){match=true;break}}while(false||match_Empty(context,token)||match_Comment(context,token)||match_TagLine(context,token));context.tokenQueue=context.tokenQueue.concat(queue);return match}}},{"./ast_builder":2,"./errors":6,"./token_matcher":13,"./token_scanner":14}],11:[function(require,module,exports){var countSymbols=require("../count_symbols");function Compiler(){this.compile=function(gherkin_document){var pickles=[];if(gherkin_document.feature==null)return pickles;var feature=gherkin_document.feature;var language=feature.language;var tags=feature.tags;var backgroundSteps=[];build(pickles,language,tags,backgroundSteps,feature);return pickles};function build(pickles,language,tags,parentBackgroundSteps,parent){var backgroundSteps=parentBackgroundSteps.slice(0);parent.children.forEach(function(child){if(child.type==="Background"){backgroundSteps=backgroundSteps.concat(pickleSteps(child))}else if(child.type==="Rule"){build(pickles,language,tags,backgroundSteps,child)}else{var scenario=child;if(scenario.examples.length===0){compileScenario(tags,backgroundSteps,scenario,language,pickles)}else{compileScenarioOutline(tags,backgroundSteps,scenario,language,pickles)}}})}function compileScenario(featureTags,backgroundSteps,scenario,language,pickles){var steps=scenario.steps.length==0?[]:[].concat(backgroundSteps);var tags=[].concat(featureTags).concat(scenario.tags);scenario.steps.forEach(function(step){steps.push(pickleStep(step))});var pickle={tags:pickleTags(tags),name:scenario.name,language:language,locations:[pickleLocation(scenario.location)],steps:steps};pickles.push(pickle)}function compileScenarioOutline(featureTags,backgroundSteps,scenario,language,pickles){scenario.examples.filter(function(e){return e.tableHeader!=undefined}).forEach(function(examples){var variableCells=examples.tableHeader.cells;examples.tableBody.forEach(function(values){var valueCells=values.cells;var steps=scenario.steps.length==0?[]:[].concat(backgroundSteps);var tags=[].concat(featureTags).concat(scenario.tags).concat(examples.tags);scenario.steps.forEach(function(scenarioOutlineStep){var stepText=interpolate(scenarioOutlineStep.text,variableCells,valueCells);var args=createPickleArguments(scenarioOutlineStep.argument,variableCells,valueCells);var pickleStep={text:stepText,arguments:args,locations:[pickleLocation(values.location),pickleStepLocation(scenarioOutlineStep)]};steps.push(pickleStep)});var pickle={name:interpolate(scenario.name,variableCells,valueCells),language:language,steps:steps,tags:pickleTags(tags),locations:[pickleLocation(values.location),pickleLocation(scenario.location)]};pickles.push(pickle)})})}function createPickleArguments(argument,variableCells,valueCells){var result=[];if(!argument)return result;if(argument.type==="DataTable"){var table={rows:argument.rows.map(function(row){return{cells:row.cells.map(function(cell){return{location:pickleLocation(cell.location),value:interpolate(cell.value,variableCells,valueCells)}})}})};result.push(table)}else if(argument.type==="DocString"){var docString={location:pickleLocation(argument.location),content:interpolate(argument.content,variableCells,valueCells)};if(argument.contentType){docString.contentType=interpolate(argument.contentType,variableCells,valueCells)}result.push(docString)}else{throw Error("Internal error")}return result}function interpolate(name,variableCells,valueCells){variableCells.forEach(function(variableCell,n){var valueCell=valueCells[n];var search=new RegExp("<"+variableCell.value+">","g") +;var replacement=valueCell.value.replace(new RegExp("\\$","g"),"$$$$");name=name.replace(search,replacement)});return name}function pickleSteps(scenarioDefinition){return scenarioDefinition.steps.map(function(step){return pickleStep(step)})}function pickleStep(step){return{text:step.text,arguments:createPickleArguments(step.argument,[],[]),locations:[pickleStepLocation(step)]}}function pickleStepLocation(step){return{line:step.location.line,column:step.location.column+(step.keyword?countSymbols(step.keyword):0)}}function pickleLocation(location){return{line:location.line,column:location.column}}function pickleTags(tags){return tags.map(function(tag){return pickleTag(tag)})}function pickleTag(tag){return{name:tag.name,location:pickleLocation(tag.location)}}}module.exports=Compiler},{"../count_symbols":4}],12:[function(require,module,exports){function Token(line,location){this.line=line;this.location=location;this.isEof=line==null}Token.prototype.getTokenValue=function(){return this.isEof?"EOF":this.line.getLineText(-1)};Token.prototype.detach=function(){};module.exports=Token},{}],13:[function(require,module,exports){var DIALECTS=require("./dialects");var Errors=require("./errors");var LANGUAGE_PATTERN=/^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/;module.exports=function TokenMatcher(defaultDialectName){defaultDialectName=defaultDialectName||"en";var dialect;var dialectName;var activeDocStringSeparator;var indentToRemove;function changeDialect(newDialectName,location){var newDialect=DIALECTS[newDialectName];if(!newDialect){throw Errors.NoSuchLanguageException.create(newDialectName,location)}dialectName=newDialectName;dialect=newDialect}this.reset=function(){if(dialectName!=defaultDialectName)changeDialect(defaultDialectName);activeDocStringSeparator=null;indentToRemove=0};this.reset();this.match_TagLine=function match_TagLine(token){if(token.line.startsWith("@")){setTokenMatched(token,"TagLine",null,null,null,token.line.getTags());return true}return false};this.match_FeatureLine=function match_FeatureLine(token){return matchTitleLine(token,"FeatureLine",dialect.feature)};this.match_RuleLine=function match_RuleLine(token){return matchTitleLine(token,"RuleLine",dialect.rule)};this.match_ScenarioLine=function match_ScenarioLine(token){return matchTitleLine(token,"ScenarioLine",dialect.scenario)||matchTitleLine(token,"ScenarioLine",dialect.scenarioOutline)};this.match_BackgroundLine=function match_BackgroundLine(token){return matchTitleLine(token,"BackgroundLine",dialect.background)};this.match_ExamplesLine=function match_ExamplesLine(token){return matchTitleLine(token,"ExamplesLine",dialect.examples)};this.match_TableRow=function match_TableRow(token){if(token.line.startsWith("|")){setTokenMatched(token,"TableRow",null,null,null,token.line.getTableCells());return true}return false};this.match_Empty=function match_Empty(token){if(token.line.isEmpty){setTokenMatched(token,"Empty",null,null,0);return true}return false};this.match_Comment=function match_Comment(token){if(token.line.startsWith("#")){var text=token.line.getLineText(0);setTokenMatched(token,"Comment",text,null,0);return true}return false};this.match_Language=function match_Language(token){var match;if(match=token.line.trimmedLineText.match(LANGUAGE_PATTERN)){var newDialectName=match[1];setTokenMatched(token,"Language",newDialectName);changeDialect(newDialectName,token.location);return true}return false};this.match_DocStringSeparator=function match_DocStringSeparator(token){return activeDocStringSeparator==null?_match_DocStringSeparator(token,'"""',true)||_match_DocStringSeparator(token,"```",true):_match_DocStringSeparator(token,activeDocStringSeparator,false)};function _match_DocStringSeparator(token,separator,isOpen){if(token.line.startsWith(separator)){var contentType=null;if(isOpen){contentType=token.line.getRestTrimmed(separator.length);activeDocStringSeparator=separator;indentToRemove=token.line.indent}else{activeDocStringSeparator=null;indentToRemove=0}setTokenMatched(token,"DocStringSeparator",contentType);return true}return false}this.match_EOF=function match_EOF(token){if(token.isEof){setTokenMatched(token,"EOF");return true}return false};this.match_StepLine=function match_StepLine(token){var keywords=[].concat(dialect.given).concat(dialect.when).concat(dialect.then).concat(dialect.and).concat(dialect.but);var length=keywords.length;for(var i=0,keyword;i0&&lines[lines.length-1].trim()==""){lines.pop()}var lineNumber=0;this.read=function(){var line=lines[lineNumber++];var location={line:lineNumber,column:0};return line==null?new Token(null,location):new Token(new GherkinLine(line,lineNumber),location)}}},{"./gherkin_line":9,"./token":12}]},{},[1]); diff --git a/gherkin/javascript/gherkin.berp b/gherkin/javascript/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/javascript/gherkin.berp +++ b/gherkin/javascript/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/javascript/lib/gherkin/ast_builder.js b/gherkin/javascript/lib/gherkin/ast_builder.js index 1d040b57e29..e94db07a696 100644 --- a/gherkin/javascript/lib/gherkin/ast_builder.js +++ b/gherkin/javascript/lib/gherkin/ast_builder.js @@ -215,6 +215,7 @@ module.exports = function AstBuilder () { var background = node.getSingle('Background'); if(background) children.push(background); children = children.concat(node.getItems('ScenarioDefinition')); + children = children.concat(node.getItems('Rule')); var description = getDescription(header); var language = featureLine.matchedGherkinDialect; @@ -228,6 +229,25 @@ module.exports = function AstBuilder () { description: description, children: children, }; + case 'Rule': + var header = node.getSingle('RuleHeader'); + if(!header) return null; + var ruleLine = header.getToken('RuleLine'); + if(!ruleLine) return null; + var children = [] + var background = node.getSingle('Background'); + if(background) children.push(background); + children = children.concat(node.getItems('ScenarioDefinition')); + var description = getDescription(header); + + return { + type: node.ruleType, + location: getLocation(ruleLine), + keyword: ruleLine.matchedKeyword, + name: ruleLine.matchedText, + description: description, + children: children, + }; case 'GherkinDocument': var feature = node.getSingle('Feature'); diff --git a/gherkin/javascript/lib/gherkin/gherkin-languages.json b/gherkin/javascript/lib/gherkin/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/javascript/lib/gherkin/gherkin-languages.json +++ b/gherkin/javascript/lib/gherkin/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/javascript/lib/gherkin/parser.js b/gherkin/javascript/lib/gherkin/parser.js index 48c17ad19ff..b0372c9df7d 100644 --- a/gherkin/javascript/lib/gherkin/parser.js +++ b/gherkin/javascript/lib/gherkin/parser.js @@ -11,6 +11,7 @@ var RULE_TYPES = [ '_Comment', // #Comment '_TagLine', // #TagLine '_FeatureLine', // #FeatureLine + '_RuleLine', // #RuleLine '_BackgroundLine', // #BackgroundLine '_ScenarioLine', // #ScenarioLine '_ExamplesLine', // #ExamplesLine @@ -20,8 +21,10 @@ var RULE_TYPES = [ '_Language', // #Language '_Other', // #Other 'GherkinDocument', // GherkinDocument! := Feature? - 'Feature', // Feature! := FeatureHeader Background? ScenarioDefinition* + 'Feature', // Feature! := FeatureHeader Background? ScenarioDefinition* Rule* 'FeatureHeader', // FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper + 'Rule', // Rule! := RuleHeader Background? ScenarioDefinition* + 'RuleHeader', // RuleHeader! := #RuleLine DescriptionHelper 'Background', // Background! := #BackgroundLine DescriptionHelper Step* 'ScenarioDefinition', // ScenarioDefinition! := Tags? Scenario 'Scenario', // Scenario! := #ScenarioLine DescriptionHelper Step* ExamplesDefinition* @@ -183,6 +186,8 @@ module.exports = function Parser(builder) { return matchTokenAt_20(token, context); case 21: return matchTokenAt_21(token, context); + case 22: + return matchTokenAt_22(token, context); case 23: return matchTokenAt_23(token, context); case 24: @@ -191,6 +196,50 @@ module.exports = function Parser(builder) { return matchTokenAt_25(token, context); case 26: return matchTokenAt_26(token, context); + case 27: + return matchTokenAt_27(token, context); + case 28: + return matchTokenAt_28(token, context); + case 29: + return matchTokenAt_29(token, context); + case 30: + return matchTokenAt_30(token, context); + case 31: + return matchTokenAt_31(token, context); + case 32: + return matchTokenAt_32(token, context); + case 33: + return matchTokenAt_33(token, context); + case 34: + return matchTokenAt_34(token, context); + case 35: + return matchTokenAt_35(token, context); + case 36: + return matchTokenAt_36(token, context); + case 37: + return matchTokenAt_37(token, context); + case 38: + return matchTokenAt_38(token, context); + case 39: + return matchTokenAt_39(token, context); + case 40: + return matchTokenAt_40(token, context); + case 42: + return matchTokenAt_42(token, context); + case 43: + return matchTokenAt_43(token, context); + case 44: + return matchTokenAt_44(token, context); + case 45: + return matchTokenAt_45(token, context); + case 46: + return matchTokenAt_46(token, context); + case 47: + return matchTokenAt_47(token, context); + case 48: + return matchTokenAt_48(token, context); + case 49: + return matchTokenAt_49(token, context); default: throw new Error("Unknown state: " + state); } @@ -201,7 +250,7 @@ module.exports = function Parser(builder) { function matchTokenAt_0(token, context) { if(match_EOF(context, token)) { build(context, token); - return 22; + return 41; } if(match_Language(context, token)) { startRule(context, 'Feature'); @@ -313,7 +362,7 @@ module.exports = function Parser(builder) { endRule(context, 'FeatureHeader'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Empty(context, token)) { build(context, token); @@ -343,6 +392,13 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'FeatureHeader'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { startRule(context, 'Description'); build(context, token); @@ -351,7 +407,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -368,7 +424,7 @@ module.exports = function Parser(builder) { endRule(context, 'FeatureHeader'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { endRule(context, 'Description'); @@ -398,6 +454,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'FeatureHeader'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { build(context, token); return 4; @@ -405,7 +469,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -421,7 +485,7 @@ module.exports = function Parser(builder) { endRule(context, 'FeatureHeader'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { build(context, token); @@ -447,6 +511,13 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'FeatureHeader'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Empty(context, token)) { build(context, token); return 5; @@ -454,7 +525,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -470,7 +541,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Empty(context, token)) { build(context, token); @@ -499,6 +570,13 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { startRule(context, 'Description'); build(context, token); @@ -507,7 +585,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -524,7 +602,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { endRule(context, 'Description'); @@ -553,6 +631,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { build(context, token); return 7; @@ -560,7 +646,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -576,7 +662,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { build(context, token); @@ -601,6 +687,13 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Empty(context, token)) { build(context, token); return 8; @@ -608,7 +701,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -625,7 +718,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { startRule(context, 'DataTable'); @@ -635,7 +728,7 @@ module.exports = function Parser(builder) { if(match_DocStringSeparator(context, token)) { startRule(context, 'DocString'); build(context, token); - return 25; + return 48; } if(match_StepLine(context, token)) { endRule(context, 'Step'); @@ -659,6 +752,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 9; @@ -670,7 +771,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -688,7 +789,7 @@ module.exports = function Parser(builder) { endRule(context, 'Background'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { build(context, token); @@ -719,6 +820,15 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 10; @@ -730,7 +840,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -780,7 +890,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Empty(context, token)) { build(context, token); @@ -825,6 +935,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { startRule(context, 'Description'); build(context, token); @@ -833,7 +951,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -851,7 +969,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { endRule(context, 'Description'); @@ -898,6 +1016,15 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { build(context, token); return 13; @@ -905,7 +1032,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -922,7 +1049,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { build(context, token); @@ -963,6 +1090,14 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Empty(context, token)) { build(context, token); return 14; @@ -970,7 +1105,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -988,7 +1123,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { startRule(context, 'DataTable'); @@ -998,7 +1133,7 @@ module.exports = function Parser(builder) { if(match_DocStringSeparator(context, token)) { startRule(context, 'DocString'); build(context, token); - return 23; + return 46; } if(match_StepLine(context, token)) { endRule(context, 'Step'); @@ -1040,6 +1175,15 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 15; @@ -1051,7 +1195,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -1070,7 +1214,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { build(context, token); @@ -1121,6 +1265,16 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 16; @@ -1132,7 +1286,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -1184,7 +1338,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Empty(context, token)) { build(context, token); @@ -1237,6 +1391,16 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { startRule(context, 'Description'); build(context, token); @@ -1245,7 +1409,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0"; token.detach(); - var expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -1265,7 +1429,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { endRule(context, 'Description'); @@ -1320,6 +1484,17 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { build(context, token); return 19; @@ -1327,7 +1502,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -1346,7 +1521,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_Comment(context, token)) { build(context, token); @@ -1395,6 +1570,16 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Empty(context, token)) { build(context, token); return 20; @@ -1402,7 +1587,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -1422,7 +1607,7 @@ module.exports = function Parser(builder) { endRule(context, 'ScenarioDefinition'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } if(match_TableRow(context, token)) { build(context, token); @@ -1470,6 +1655,17 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); return 21; @@ -1481,7 +1677,7 @@ module.exports = function Parser(builder) { var stateComment = "State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0"; token.detach(); - var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); @@ -1491,147 +1687,1724 @@ module.exports = function Parser(builder) { } - // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - function matchTokenAt_23(token, context) { - if(match_DocStringSeparator(context, token)) { + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0 + function matchTokenAt_22(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Empty(context, token)) { + build(context, token); + return 22; + } + if(match_Comment(context, token)) { build(context, token); return 24; } + if(match_BackgroundLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'Background'); + build(context, token); + return 25; + } + if(match_TagLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Other(context, token)) { + startRule(context, 'Description'); build(context, token); return 23; } - var stateComment = "State: 23 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + var stateComment = "State: 22 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0"; token.detach(); - var expectedTokens = ["#DocStringSeparator", "#Other"]; + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); if (self.stopAtFirstError) throw error; addError(context, error); - return 23; + return 22; } - // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - function matchTokenAt_24(token, context) { + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0 + function matchTokenAt_23(token, context) { if(match_EOF(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - endRule(context, 'Scenario'); - endRule(context, 'ScenarioDefinition'); + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } - if(match_StepLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - startRule(context, 'Step'); + if(match_Comment(context, token)) { + endRule(context, 'Description'); build(context, token); - return 15; + return 24; } - if(match_TagLine(context, token)) { - if(lookahead_0(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - startRule(context, 'ExamplesDefinition'); - startRule(context, 'Tags'); + if(match_BackgroundLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); + startRule(context, 'Background'); build(context, token); - return 17; - } + return 25; } if(match_TagLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - endRule(context, 'Scenario'); - endRule(context, 'ScenarioDefinition'); + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); startRule(context, 'ScenarioDefinition'); startRule(context, 'Tags'); build(context, token); - return 11; - } - if(match_ExamplesLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - startRule(context, 'ExamplesDefinition'); - startRule(context, 'Examples'); - build(context, token); - return 18; + return 30; } if(match_ScenarioLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - endRule(context, 'Scenario'); - endRule(context, 'ScenarioDefinition'); + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); startRule(context, 'ScenarioDefinition'); startRule(context, 'Scenario'); build(context, token); - return 12; + return 31; } - if(match_Comment(context, token)) { + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); build(context, token); - return 24; + return 22; } - if(match_Empty(context, token)) { + if(match_Other(context, token)) { build(context, token); - return 24; + return 23; } - var stateComment = "State: 24 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + var stateComment = "State: 23 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0"; token.detach(); - var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); if (self.stopAtFirstError) throw error; addError(context, error); - return 24; + return 23; } - // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - function matchTokenAt_25(token, context) { - if(match_DocStringSeparator(context, token)) { + // GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0 + function matchTokenAt_24(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); build(context, token); - return 26; + return 41; } - if(match_Other(context, token)) { + if(match_Comment(context, token)) { + build(context, token); + return 24; + } + if(match_BackgroundLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'Background'); build(context, token); return 25; } + if(match_TagLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'RuleHeader'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'RuleHeader'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Empty(context, token)) { + build(context, token); + return 24; + } - var stateComment = "State: 25 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + var stateComment = "State: 24 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0"; token.detach(); - var expectedTokens = ["#DocStringSeparator", "#Other"]; + var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); if (self.stopAtFirstError) throw error; addError(context, error); - return 25; + return 24; } - // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - function matchTokenAt_26(token, context) { + // GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0 + function matchTokenAt_25(token, context) { if(match_EOF(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); endRule(context, 'Background'); + endRule(context, 'Rule'); endRule(context, 'Feature'); build(context, token); - return 22; + return 41; } - if(match_StepLine(context, token)) { - endRule(context, 'DocString'); - endRule(context, 'Step'); - startRule(context, 'Step'); + if(match_Empty(context, token)) { build(context, token); - return 9; + return 25; } - if(match_TagLine(context, token)) { + if(match_Comment(context, token)) { + build(context, token); + return 27; + } + if(match_StepLine(context, token)) { + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + startRule(context, 'Description'); + build(context, token); + return 26; + } + + var stateComment = "State: 25 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 25; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0 + function matchTokenAt_26(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + endRule(context, 'Description'); + build(context, token); + return 27; + } + if(match_StepLine(context, token)) { + endRule(context, 'Description'); + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + build(context, token); + return 26; + } + + var stateComment = "State: 26 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 26; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0 + function matchTokenAt_27(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + build(context, token); + return 27; + } + if(match_StepLine(context, token)) { + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Empty(context, token)) { + build(context, token); + return 27; + } + + var stateComment = "State: 27 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 27; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0 + function matchTokenAt_28(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + startRule(context, 'DataTable'); + build(context, token); + return 29; + } + if(match_DocStringSeparator(context, token)) { + startRule(context, 'DocString'); + build(context, token); + return 44; + } + if(match_StepLine(context, token)) { + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 28; + } + if(match_Empty(context, token)) { + build(context, token); + return 28; + } + + var stateComment = "State: 28 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 28; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + function matchTokenAt_29(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + build(context, token); + return 29; + } + if(match_StepLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 29; + } + if(match_Empty(context, token)) { + build(context, token); + return 29; + } + + var stateComment = "State: 29 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 29; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0 + function matchTokenAt_30(token, context) { + if(match_TagLine(context, token)) { + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Tags'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_Comment(context, token)) { + build(context, token); + return 30; + } + if(match_Empty(context, token)) { + build(context, token); + return 30; + } + + var stateComment = "State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0"; + token.detach(); + var expectedTokens = ["#TagLine", "#ScenarioLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 30; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0 + function matchTokenAt_31(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Empty(context, token)) { + build(context, token); + return 31; + } + if(match_Comment(context, token)) { + build(context, token); + return 33; + } + if(match_StepLine(context, token)) { + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + startRule(context, 'Description'); + build(context, token); + return 32; + } + + var stateComment = "State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 31; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0 + function matchTokenAt_32(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + endRule(context, 'Description'); + build(context, token); + return 33; + } + if(match_StepLine(context, token)) { + endRule(context, 'Description'); + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Description'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Description'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + build(context, token); + return 32; + } + + var stateComment = "State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 32; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0 + function matchTokenAt_33(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + build(context, token); + return 33; + } + if(match_StepLine(context, token)) { + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Empty(context, token)) { + build(context, token); + return 33; + } + + var stateComment = "State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 33; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0 + function matchTokenAt_34(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + startRule(context, 'DataTable'); + build(context, token); + return 35; + } + if(match_DocStringSeparator(context, token)) { + startRule(context, 'DocString'); + build(context, token); + return 42; + } + if(match_StepLine(context, token)) { + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 34; + } + if(match_Empty(context, token)) { + build(context, token); + return 34; + } + + var stateComment = "State: 34 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 34; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + function matchTokenAt_35(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + build(context, token); + return 35; + } + if(match_StepLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DataTable'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 35; + } + if(match_Empty(context, token)) { + build(context, token); + return 35; + } + + var stateComment = "State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 35; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0 + function matchTokenAt_36(token, context) { + if(match_TagLine(context, token)) { + build(context, token); + return 36; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Tags'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_Comment(context, token)) { + build(context, token); + return 36; + } + if(match_Empty(context, token)) { + build(context, token); + return 36; + } + + var stateComment = "State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0"; + token.detach(); + var expectedTokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 36; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0 + function matchTokenAt_37(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Empty(context, token)) { + build(context, token); + return 37; + } + if(match_Comment(context, token)) { + build(context, token); + return 39; + } + if(match_TableRow(context, token)) { + startRule(context, 'ExamplesTable'); + build(context, token); + return 40; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + startRule(context, 'Description'); + build(context, token); + return 38; + } + + var stateComment = "State: 37 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 37; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0 + function matchTokenAt_38(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + endRule(context, 'Description'); + build(context, token); + return 39; + } + if(match_TableRow(context, token)) { + endRule(context, 'Description'); + startRule(context, 'ExamplesTable'); + build(context, token); + return 40; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Description'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Other(context, token)) { + build(context, token); + return 38; + } + + var stateComment = "State: 38 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 38; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0 + function matchTokenAt_39(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_Comment(context, token)) { + build(context, token); + return 39; + } + if(match_TableRow(context, token)) { + startRule(context, 'ExamplesTable'); + build(context, token); + return 40; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Empty(context, token)) { + build(context, token); + return 39; + } + + var stateComment = "State: 39 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0"; + token.detach(); + var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 39; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0 + function matchTokenAt_40(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_TableRow(context, token)) { + build(context, token); + return 40; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'ExamplesTable'); + endRule(context, 'Examples'); + endRule(context, 'ExamplesDefinition'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 40; + } + if(match_Empty(context, token)) { + build(context, token); + return 40; + } + + var stateComment = "State: 40 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0"; + token.detach(); + var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 40; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + function matchTokenAt_42(token, context) { + if(match_DocStringSeparator(context, token)) { + build(context, token); + return 43; + } + if(match_Other(context, token)) { + build(context, token); + return 42; + } + + var stateComment = "State: 42 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#DocStringSeparator", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 42; + } + + + // GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + function matchTokenAt_43(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_StepLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 34; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 36; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 37; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 43; + } + if(match_Empty(context, token)) { + build(context, token); + return 43; + } + + var stateComment = "State: 43 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 43; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + function matchTokenAt_44(token, context) { + if(match_DocStringSeparator(context, token)) { + build(context, token); + return 45; + } + if(match_Other(context, token)) { + build(context, token); + return 44; + } + + var stateComment = "State: 44 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#DocStringSeparator", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 44; + } + + + // GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + function matchTokenAt_45(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_StepLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 28; + } + if(match_TagLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 30; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 31; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Rule'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 45; + } + if(match_Empty(context, token)) { + build(context, token); + return 45; + } + + var stateComment = "State: 45 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 45; + } + + + // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + function matchTokenAt_46(token, context) { + if(match_DocStringSeparator(context, token)) { + build(context, token); + return 47; + } + if(match_Other(context, token)) { + build(context, token); + return 46; + } + + var stateComment = "State: 46 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#DocStringSeparator", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 46; + } + + + // GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + function matchTokenAt_47(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_StepLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 15; + } + if(match_TagLine(context, token)) { + if(lookahead_0(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 17; + } + } + if(match_TagLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Tags'); + build(context, token); + return 11; + } + if(match_ExamplesLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'ExamplesDefinition'); + startRule(context, 'Examples'); + build(context, token); + return 18; + } + if(match_ScenarioLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'ScenarioDefinition'); + startRule(context, 'Scenario'); + build(context, token); + return 12; + } + if(match_RuleLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Scenario'); + endRule(context, 'ScenarioDefinition'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } + if(match_Comment(context, token)) { + build(context, token); + return 47; + } + if(match_Empty(context, token)) { + build(context, token); + return 47; + } + + var stateComment = "State: 47 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 47; + } + + + // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + function matchTokenAt_48(token, context) { + if(match_DocStringSeparator(context, token)) { + build(context, token); + return 49; + } + if(match_Other(context, token)) { + build(context, token); + return 48; + } + + var stateComment = "State: 48 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0"; + token.detach(); + var expectedTokens = ["#DocStringSeparator", "#Other"]; + var error = token.isEof ? + Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : + Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); + if (self.stopAtFirstError) throw error; + addError(context, error); + return 48; + } + + + // GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + function matchTokenAt_49(token, context) { + if(match_EOF(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + endRule(context, 'Feature'); + build(context, token); + return 41; + } + if(match_StepLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + startRule(context, 'Step'); + build(context, token); + return 9; + } + if(match_TagLine(context, token)) { endRule(context, 'DocString'); endRule(context, 'Step'); endRule(context, 'Background'); @@ -1649,24 +3422,33 @@ module.exports = function Parser(builder) { build(context, token); return 12; } + if(match_RuleLine(context, token)) { + endRule(context, 'DocString'); + endRule(context, 'Step'); + endRule(context, 'Background'); + startRule(context, 'Rule'); + startRule(context, 'RuleHeader'); + build(context, token); + return 22; + } if(match_Comment(context, token)) { build(context, token); - return 26; + return 49; } if(match_Empty(context, token)) { build(context, token); - return 26; + return 49; } - var stateComment = "State: 26 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; + var stateComment = "State: 49 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0"; token.detach(); - var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"]; + var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"]; var error = token.isEof ? Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) : Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment); if (self.stopAtFirstError) throw error; addError(context, error); - return 26; + return 49; } @@ -1710,6 +3492,14 @@ module.exports = function Parser(builder) { } + function match_RuleLine(context, token) { + if(token.isEof) return false; + return handleExternalError(context, false, function () { + return context.tokenMatcher.match_RuleLine(token); + }); + } + + function match_BackgroundLine(context, token) { if(token.isEof) return false; return handleExternalError(context, false, function () { diff --git a/gherkin/javascript/lib/gherkin/pickles/compiler.js b/gherkin/javascript/lib/gherkin/pickles/compiler.js index e2600093c83..6f7b4adcb5c 100644 --- a/gherkin/javascript/lib/gherkin/pickles/compiler.js +++ b/gherkin/javascript/lib/gherkin/pickles/compiler.js @@ -8,20 +8,30 @@ function Compiler() { var feature = gherkin_document.feature; var language = feature.language; - var featureTags = feature.tags; + var tags = feature.tags; var backgroundSteps = []; - feature.children.forEach(function (stepsContainer) { - if(stepsContainer.type === 'Background') { - backgroundSteps = pickleSteps(stepsContainer); - } else if(stepsContainer.examples.length === 0) { - compileScenario(featureTags, backgroundSteps, stepsContainer, language, pickles); + build(pickles, language, tags, backgroundSteps, feature); + return pickles; + }; + + function build(pickles, language, tags, parentBackgroundSteps, parent) { + var backgroundSteps = parentBackgroundSteps.slice(0); // dup + parent.children.forEach(function (child) { + if (child.type === 'Background') { + backgroundSteps = backgroundSteps.concat(pickleSteps(child)); + } else if (child.type === 'Rule') { + build(pickles, language, tags, backgroundSteps, child) } else { - compileScenarioOutline(featureTags, backgroundSteps, stepsContainer, language, pickles); + var scenario = child + if (scenario.examples.length === 0) { + compileScenario(tags, backgroundSteps, scenario, language, pickles); + } else { + compileScenarioOutline(tags, backgroundSteps, scenario, language, pickles); + } } }); - return pickles; - }; + } function compileScenario(featureTags, backgroundSteps, scenario, language, pickles) { var steps = scenario.steps.length == 0 ? [] : [].concat(backgroundSteps); diff --git a/gherkin/javascript/lib/gherkin/token_matcher.js b/gherkin/javascript/lib/gherkin/token_matcher.js index 5d5aa29091d..d35a0524c5f 100644 --- a/gherkin/javascript/lib/gherkin/token_matcher.js +++ b/gherkin/javascript/lib/gherkin/token_matcher.js @@ -40,6 +40,10 @@ module.exports = function TokenMatcher(defaultDialectName) { return matchTitleLine(token, 'FeatureLine', dialect.feature); }; + this.match_RuleLine = function match_RuleLine(token) { + return matchTitleLine(token, 'RuleLine', dialect.rule); + }; + this.match_ScenarioLine = function match_ScenarioLine(token) { return matchTitleLine(token, 'ScenarioLine', dialect.scenario) || matchTitleLine(token, 'ScenarioLine', dialect.scenarioOutline); @@ -157,7 +161,7 @@ module.exports = function TokenMatcher(defaultDialectName) { function matchTitleLine(token, tokenType, keywords) { var length = keywords.length; - for(var i = 0, keyword; i < length; i++) { + for(var i = 0; i < length; i++) { var keyword = keywords[i]; if (token.line.startsWithTitleKeyword(keyword)) { diff --git a/gherkin/javascript/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/javascript/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/javascript/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/javascript/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/javascript/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/javascript/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/javascript/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/javascript/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/javascript/testdata/good/rule.feature b/gherkin/javascript/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/javascript/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/javascript/testdata/good/rule.feature.ast.ndjson b/gherkin/javascript/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/javascript/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/javascript/testdata/good/rule.feature.pickles.ndjson b/gherkin/javascript/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/javascript/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/javascript/testdata/good/rule.feature.source.ndjson b/gherkin/javascript/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/javascript/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/javascript/testdata/good/rule.feature.tokens b/gherkin/javascript/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/javascript/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF diff --git a/gherkin/objective-c/GherkinLanguages/gherkin-languages.json b/gherkin/objective-c/GherkinLanguages/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/objective-c/GherkinLanguages/gherkin-languages.json +++ b/gherkin/objective-c/GherkinLanguages/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/objective-c/gherkin.berp b/gherkin/objective-c/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/objective-c/gherkin.berp +++ b/gherkin/objective-c/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/objective-c/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/objective-c/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/objective-c/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/objective-c/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/objective-c/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/objective-c/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/objective-c/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/objective-c/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/objective-c/testdata/good/rule.feature b/gherkin/objective-c/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/objective-c/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/objective-c/testdata/good/rule.feature.ast.ndjson b/gherkin/objective-c/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/objective-c/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/objective-c/testdata/good/rule.feature.pickles.ndjson b/gherkin/objective-c/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/objective-c/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/objective-c/testdata/good/rule.feature.source.ndjson b/gherkin/objective-c/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/objective-c/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/objective-c/testdata/good/rule.feature.tokens b/gherkin/objective-c/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/objective-c/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF diff --git a/gherkin/perl/CHANGES b/gherkin/perl/CHANGES index 10e451feb0f..68930cc72cc 100644 --- a/gherkin/perl/CHANGES +++ b/gherkin/perl/CHANGES @@ -10,8 +10,7 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ## [Unreleased] - In Git ### Added -* Added `Example` as synonym for `Scenario` and `Example Outline` as - synonym for `Scenario Outline` in English and many other languages. +* Added `Example` as synonym for `Scenario` in English and many other languages. This is to align Gherkin with BDD and Example Mapping terminology. ([aslakhellesoy]) diff --git a/gherkin/perl/gherkin-languages.json b/gherkin/perl/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/perl/gherkin-languages.json +++ b/gherkin/perl/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/perl/gherkin.berp b/gherkin/perl/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/perl/gherkin.berp +++ b/gherkin/perl/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/perl/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/perl/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/perl/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/perl/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/perl/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/perl/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/perl/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/perl/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/perl/testdata/good/rule.feature b/gherkin/perl/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/perl/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/perl/testdata/good/rule.feature.ast.ndjson b/gherkin/perl/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/perl/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/perl/testdata/good/rule.feature.pickles.ndjson b/gherkin/perl/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/perl/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/perl/testdata/good/rule.feature.source.ndjson b/gherkin/perl/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/perl/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/perl/testdata/good/rule.feature.tokens b/gherkin/perl/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/perl/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF diff --git a/gherkin/python/gherkin.berp b/gherkin/python/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/python/gherkin.berp +++ b/gherkin/python/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/python/gherkin/gherkin-languages.json b/gherkin/python/gherkin/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/python/gherkin/gherkin-languages.json +++ b/gherkin/python/gherkin/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/python/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/python/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/python/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/python/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/python/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/python/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/python/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/python/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/python/testdata/good/rule.feature b/gherkin/python/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/python/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/python/testdata/good/rule.feature.ast.ndjson b/gherkin/python/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/python/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/python/testdata/good/rule.feature.pickles.ndjson b/gherkin/python/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/python/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/python/testdata/good/rule.feature.source.ndjson b/gherkin/python/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/python/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/python/testdata/good/rule.feature.tokens b/gherkin/python/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/python/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF diff --git a/gherkin/ruby/gherkin.berp b/gherkin/ruby/gherkin.berp index 36ee8c82de6..b596cb0f8ca 100644 --- a/gherkin/ruby/gherkin.berp +++ b/gherkin/ruby/gherkin.berp @@ -1,14 +1,17 @@ [ - Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language + Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#RuleLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language IgnoredTokens -> #Comment,#Empty ClassName -> Parser Namespace -> Gherkin ] GherkinDocument! := Feature? -Feature! := FeatureHeader Background? ScenarioDefinition* +Feature! := FeatureHeader Background? ScenarioDefinition* Rule* FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper +Rule! := RuleHeader Background? ScenarioDefinition* +RuleHeader! := #RuleLine DescriptionHelper + Background! := #BackgroundLine DescriptionHelper Step* // we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance diff --git a/gherkin/ruby/lib/gherkin/ast_builder.rb b/gherkin/ruby/lib/gherkin/ast_builder.rb index 115a8a4dc09..9a4fc9539ed 100644 --- a/gherkin/ruby/lib/gherkin/ast_builder.rb +++ b/gherkin/ruby/lib/gherkin/ast_builder.rb @@ -205,6 +205,7 @@ def transform_node(node) background = node.get_single(:Background) children.push(background) if background children.concat(node.get_items(:ScenarioDefinition)) + children.concat(node.get_items(:Rule)) description = get_description(header) language = feature_line.matched_gherkin_dialect @@ -218,6 +219,25 @@ def transform_node(node) description: description, children: children, ) + when :Rule + header = node.get_single(:RuleHeader) + return unless header + rule_line = header.get_token(:RuleLine) + return unless rule_line + children = [] + background = node.get_single(:Background) + children.push(background) if background + children.concat(node.get_items(:ScenarioDefinition)) + description = get_description(header) + + reject_nils( + type: node.rule_type, + location: get_location(rule_line), + keyword: rule_line.matched_keyword, + name: rule_line.matched_text, + description: description, + children: children, + ) when :GherkinDocument feature = node.get_single(:Feature) reject_nils( diff --git a/gherkin/ruby/lib/gherkin/dialect.rb b/gherkin/ruby/lib/gherkin/dialect.rb index a39b0c2e3c0..fd868aed5b5 100644 --- a/gherkin/ruby/lib/gherkin/dialect.rb +++ b/gherkin/ruby/lib/gherkin/dialect.rb @@ -19,6 +19,10 @@ def feature_keywords @spec.fetch('feature') end + def rule_keywords + @spec.fetch('rule') + end + def scenario_keywords @spec.fetch('scenario') end diff --git a/gherkin/ruby/lib/gherkin/gherkin-languages.json b/gherkin/ruby/lib/gherkin/gherkin-languages.json index 8a3c68e8521..477c7005019 100644 --- a/gherkin/ruby/lib/gherkin/gherkin-languages.json +++ b/gherkin/ruby/lib/gherkin/gherkin-languages.json @@ -25,6 +25,9 @@ ], "name": "Afrikaans", "native": "Afrikaans", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Situasie" @@ -66,6 +69,9 @@ ], "name": "Armenian", "native": "հայերեն", + "rule": [ + "Rule" + ], "scenario": [ "Օրինակ", "Սցենար" @@ -111,6 +117,9 @@ ], "name": "Aragonese", "native": "Aragonés", + "rule": [ + "Rule" + ], "scenario": [ "Eixemplo", "Caso" @@ -153,6 +162,9 @@ ], "name": "Arabic", "native": "العربية", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سيناريو" @@ -199,6 +211,9 @@ ], "name": "Asturian", "native": "asturianu", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Casu" @@ -243,6 +258,9 @@ ], "name": "Azerbaijani", "native": "Azərbaycanca", + "rule": [ + "Rule" + ], "scenario": [ "Nümunələr", "Ssenari" @@ -284,6 +302,9 @@ ], "name": "Bulgarian", "native": "български", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -326,6 +347,9 @@ ], "name": "Malay", "native": "Bahasa Melayu", + "rule": [ + "Rule" + ], "scenario": [ "Senario", "Situasi", @@ -372,6 +396,9 @@ ], "name": "Bosnian", "native": "Bosanski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenariju", @@ -419,6 +446,9 @@ ], "name": "Catalan", "native": "català", + "rule": [ + "Rule" + ], "scenario": [ "Exemple", "Escenari" @@ -463,6 +493,9 @@ ], "name": "Czech", "native": "Česky", + "rule": [ + "Rule" + ], "scenario": [ "Příklad", "Scénář" @@ -504,6 +537,9 @@ ], "name": "Welsh", "native": "Cymraeg", + "rule": [ + "Rule" + ], "scenario": [ "Enghraifft", "Scenario" @@ -544,6 +580,9 @@ ], "name": "Danish", "native": "dansk", + "rule": [ + "Rule" + ], "scenario": [ "Eksempel", "Scenarie" @@ -586,6 +625,9 @@ ], "name": "German", "native": "Deutsch", + "rule": [ + "Rule" + ], "scenario": [ "Beispiel", "Szenario" @@ -628,6 +670,9 @@ ], "name": "Greek", "native": "Ελληνικά", + "rule": [ + "Rule" + ], "scenario": [ "Παράδειγμα", "Σενάριο" @@ -669,6 +714,9 @@ ], "name": "Emoji", "native": "😀", + "rule": [ + "Rule" + ], "scenario": [ "🥒", "📕" @@ -712,6 +760,9 @@ ], "name": "English", "native": "English", + "rule": [ + "Rule" + ], "scenario": [ "Example", "Scenario" @@ -754,6 +805,9 @@ ], "name": "Scouse", "native": "Scouse", + "rule": [ + "Rule" + ], "scenario": [ "The thing of it is" ], @@ -795,6 +849,9 @@ ], "name": "Australian", "native": "Australian", + "rule": [ + "Rule" + ], "scenario": [ "Awww, look mate" ], @@ -834,6 +891,9 @@ ], "name": "LOLCAT", "native": "LOLCAT", + "rule": [ + "Rule" + ], "scenario": [ "MISHUN" ], @@ -880,6 +940,9 @@ ], "name": "Old English", "native": "Englisc", + "rule": [ + "Rule" + ], "scenario": [ "Swa" ], @@ -927,6 +990,9 @@ ], "name": "Pirate", "native": "Pirate", + "rule": [ + "Rule" + ], "scenario": [ "Heave to" ], @@ -967,6 +1033,9 @@ ], "name": "Esperanto", "native": "Esperanto", + "rule": [ + "Rule" + ], "scenario": [ "Ekzemplo", "Scenaro", @@ -1014,6 +1083,9 @@ ], "name": "Spanish", "native": "español", + "rule": [ + "Rule" + ], "scenario": [ "Ejemplo", "Escenario" @@ -1054,6 +1126,9 @@ ], "name": "Estonian", "native": "eesti keel", + "rule": [ + "Rule" + ], "scenario": [ "Juhtum", "Stsenaarium" @@ -1095,6 +1170,9 @@ ], "name": "Persian", "native": "فارسی", + "rule": [ + "Rule" + ], "scenario": [ "مثال", "سناریو" @@ -1135,6 +1213,9 @@ ], "name": "Finnish", "native": "suomi", + "rule": [ + "Rule" + ], "scenario": [ "Tapaus" ], @@ -1190,6 +1271,9 @@ ], "name": "French", "native": "français", + "rule": [ + "Règle" + ], "scenario": [ "Exemple", "Scénario" @@ -1236,6 +1320,9 @@ ], "name": "Irish", "native": "Gaeilge", + "rule": [ + "Rule" + ], "scenario": [ "Sampla", "Cás" @@ -1281,6 +1368,9 @@ ], "name": "Gujarati", "native": "ગુજરાતી", + "rule": [ + "Rule" + ], "scenario": [ "ઉદાહરણ", "સ્થિતિ" @@ -1326,6 +1416,9 @@ ], "name": "Galician", "native": "galego", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Escenario" @@ -1367,6 +1460,9 @@ ], "name": "Hebrew", "native": "עברית", + "rule": [ + "Rule" + ], "scenario": [ "דוגמא", "תרחיש" @@ -1413,6 +1509,9 @@ ], "name": "Hindi", "native": "हिंदी", + "rule": [ + "Rule" + ], "scenario": [ "परिदृश्य" ], @@ -1459,6 +1558,9 @@ ], "name": "Croatian", "native": "hrvatski", + "rule": [ + "Rule" + ], "scenario": [ "Primjer", "Scenarij" @@ -1508,6 +1610,9 @@ ], "name": "Creole", "native": "kreyòl", + "rule": [ + "Rule" + ], "scenario": [ "Senaryo" ], @@ -1555,6 +1660,9 @@ ], "name": "Hungarian", "native": "magyar", + "rule": [ + "Rule" + ], "scenario": [ "Példa", "Forgatókönyv" @@ -1597,6 +1705,9 @@ ], "name": "Indonesian", "native": "Bahasa Indonesia", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1637,6 +1748,9 @@ ], "name": "Icelandic", "native": "Íslenska", + "rule": [ + "Rule" + ], "scenario": [ "Atburðarás" ], @@ -1680,6 +1794,9 @@ ], "name": "Italian", "native": "italiano", + "rule": [ + "Rule" + ], "scenario": [ "Esempio", "Scenario" @@ -1724,6 +1841,9 @@ ], "name": "Japanese", "native": "日本語", + "rule": [ + "Rule" + ], "scenario": [ "シナリオ" ], @@ -1770,6 +1890,9 @@ ], "name": "Javanese", "native": "Basa Jawa", + "rule": [ + "Rule" + ], "scenario": [ "Skenario" ], @@ -1811,6 +1934,9 @@ ], "name": "Georgian", "native": "ქართველი", + "rule": [ + "Rule" + ], "scenario": [ "მაგალითად", "სცენარის" @@ -1851,6 +1977,9 @@ ], "name": "Kannada", "native": "ಕನ್ನಡ", + "rule": [ + "Rule" + ], "scenario": [ "ಉದಾಹರಣೆ", "ಕಥಾಸಾರಾಂಶ" @@ -1893,6 +2022,9 @@ ], "name": "Korean", "native": "한국어", + "rule": [ + "Rule" + ], "scenario": [ "시나리오" ], @@ -1935,6 +2067,9 @@ ], "name": "Lithuanian", "native": "lietuvių kalba", + "rule": [ + "Rule" + ], "scenario": [ "Pavyzdys", "Scenarijus" @@ -1977,6 +2112,9 @@ ], "name": "Luxemburgish", "native": "Lëtzebuergesch", + "rule": [ + "Rule" + ], "scenario": [ "Beispill", "Szenario" @@ -2020,6 +2158,9 @@ ], "name": "Latvian", "native": "latviešu", + "rule": [ + "Rule" + ], "scenario": [ "Piemērs", "Scenārijs" @@ -2065,6 +2206,9 @@ ], "name": "Macedonian", "native": "Македонски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2113,6 +2257,9 @@ ], "name": "Macedonian (Latin)", "native": "Makedonski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Na primer" @@ -2159,6 +2306,9 @@ ], "name": "Mongolian", "native": "монгол", + "rule": [ + "Rule" + ], "scenario": [ "Сценар" ], @@ -2200,6 +2350,9 @@ ], "name": "Dutch", "native": "Nederlands", + "rule": [ + "Rule" + ], "scenario": [ "Voorbeeld", "Scenario" @@ -2241,6 +2394,9 @@ ], "name": "Norwegian", "native": "norsk", + "rule": [ + "Regel" + ], "scenario": [ "Eksempel", "Scenario" @@ -2285,6 +2441,9 @@ ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", + "rule": [ + "Rule" + ], "scenario": [ "ਉਦਾਹਰਨ", "ਪਟਕਥਾ" @@ -2332,6 +2491,9 @@ ], "name": "Polish", "native": "polski", + "rule": [ + "Rule" + ], "scenario": [ "Przykład", "Scenariusz" @@ -2385,6 +2547,9 @@ ], "name": "Portuguese", "native": "português", + "rule": [ + "Rule" + ], "scenario": [ "Exemplo", "Cenário", @@ -2439,6 +2604,9 @@ ], "name": "Romanian", "native": "română", + "rule": [ + "Rule" + ], "scenario": [ "Exemplu", "Scenariu" @@ -2491,6 +2659,9 @@ ], "name": "Russian", "native": "русский", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарий" @@ -2540,6 +2711,9 @@ ], "name": "Slovak", "native": "Slovensky", + "rule": [ + "Rule" + ], "scenario": [ "Príklad", "Scenár" @@ -2595,6 +2769,9 @@ ], "name": "Slovenian", "native": "Slovenski", + "rule": [ + "Rule" + ], "scenario": [ "Primer", "Scenarij" @@ -2649,6 +2826,9 @@ ], "name": "Serbian", "native": "Српски", + "rule": [ + "Rule" + ], "scenario": [ "Пример", "Сценарио", @@ -2701,6 +2881,9 @@ ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", + "rule": [ + "Rule" + ], "scenario": [ "Scenario", "Primer" @@ -2744,6 +2927,9 @@ ], "name": "Swedish", "native": "Svenska", + "rule": [ + "Rule" + ], "scenario": [ "Scenario" ], @@ -2789,6 +2975,9 @@ ], "name": "Tamil", "native": "தமிழ்", + "rule": [ + "Rule" + ], "scenario": [ "உதாரணமாக", "காட்சி" @@ -2833,6 +3022,9 @@ ], "name": "Thai", "native": "ไทย", + "rule": [ + "Rule" + ], "scenario": [ "เหตุการณ์" ], @@ -2873,6 +3065,9 @@ ], "name": "Telugu", "native": "తెలుగు", + "rule": [ + "Rule" + ], "scenario": [ "ఉదాహరణ", "సన్నివేశం" @@ -2921,6 +3116,9 @@ ], "name": "Klingon", "native": "tlhIngan", + "rule": [ + "Rule" + ], "scenario": [ "lut" ], @@ -2961,6 +3159,9 @@ ], "name": "Turkish", "native": "Türkçe", + "rule": [ + "Rule" + ], "scenario": [ "Örnek", "Senaryo" @@ -3005,6 +3206,9 @@ ], "name": "Tatar", "native": "Татарча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3049,6 +3253,9 @@ ], "name": "Ukrainian", "native": "Українська", + "rule": [ + "Rule" + ], "scenario": [ "Приклад", "Сценарій" @@ -3095,6 +3302,9 @@ ], "name": "Urdu", "native": "اردو", + "rule": [ + "Rule" + ], "scenario": [ "منظرنامہ" ], @@ -3137,6 +3347,9 @@ ], "name": "Uzbek", "native": "Узбекча", + "rule": [ + "Rule" + ], "scenario": [ "Сценарий" ], @@ -3177,6 +3390,9 @@ ], "name": "Vietnamese", "native": "Tiếng Việt", + "rule": [ + "Rule" + ], "scenario": [ "Tình huống", "Kịch bản" @@ -3222,6 +3438,9 @@ ], "name": "Chinese simplified", "native": "简体中文", + "rule": [ + "Rule" + ], "scenario": [ "场景", "剧本" @@ -3267,6 +3486,9 @@ ], "name": "Chinese traditional", "native": "繁體中文", + "rule": [ + "Rule" + ], "scenario": [ "場景", "劇本" diff --git a/gherkin/ruby/lib/gherkin/parser.rb b/gherkin/ruby/lib/gherkin/parser.rb index c5e9c762252..eeb3c79719b 100644 --- a/gherkin/ruby/lib/gherkin/parser.rb +++ b/gherkin/ruby/lib/gherkin/parser.rb @@ -13,6 +13,7 @@ module Gherkin :_Comment, # #Comment :_TagLine, # #TagLine :_FeatureLine, # #FeatureLine + :_RuleLine, # #RuleLine :_BackgroundLine, # #BackgroundLine :_ScenarioLine, # #ScenarioLine :_ExamplesLine, # #ExamplesLine @@ -22,8 +23,10 @@ module Gherkin :_Language, # #Language :_Other, # #Other :GherkinDocument, # GherkinDocument! := Feature? - :Feature, # Feature! := FeatureHeader Background? ScenarioDefinition* + :Feature, # Feature! := FeatureHeader Background? ScenarioDefinition* Rule* :FeatureHeader, # FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper + :Rule, # Rule! := RuleHeader Background? ScenarioDefinition* + :RuleHeader, # RuleHeader! := #RuleLine DescriptionHelper :Background, # Background! := #BackgroundLine DescriptionHelper Step* :ScenarioDefinition, # ScenarioDefinition! := Tags? Scenario :Scenario, # Scenario! := #ScenarioLine DescriptionHelper Step* ExamplesDefinition* @@ -150,6 +153,13 @@ def match_FeatureLine( context, token) end end + def match_RuleLine( context, token) + return false if token.eof? + return handle_external_error(context, false) do + context.token_matcher.match_RuleLine(token) + end + end + def match_BackgroundLine( context, token) return false if token.eof? return handle_external_error(context, false) do @@ -252,6 +262,8 @@ def match_token(state, token, context) match_token_at_20(token, context) when 21 match_token_at_21(token, context) + when 22 + match_token_at_22(token, context) when 23 match_token_at_23(token, context) when 24 @@ -260,6 +272,50 @@ def match_token(state, token, context) match_token_at_25(token, context) when 26 match_token_at_26(token, context) + when 27 + match_token_at_27(token, context) + when 28 + match_token_at_28(token, context) + when 29 + match_token_at_29(token, context) + when 30 + match_token_at_30(token, context) + when 31 + match_token_at_31(token, context) + when 32 + match_token_at_32(token, context) + when 33 + match_token_at_33(token, context) + when 34 + match_token_at_34(token, context) + when 35 + match_token_at_35(token, context) + when 36 + match_token_at_36(token, context) + when 37 + match_token_at_37(token, context) + when 38 + match_token_at_38(token, context) + when 39 + match_token_at_39(token, context) + when 40 + match_token_at_40(token, context) + when 42 + match_token_at_42(token, context) + when 43 + match_token_at_43(token, context) + when 44 + match_token_at_44(token, context) + when 45 + match_token_at_45(token, context) + when 46 + match_token_at_46(token, context) + when 47 + match_token_at_47(token, context) + when 48 + match_token_at_48(token, context) + when 49 + match_token_at_49(token, context) else raise InvalidOperationException, "Unknown state: #{state}" end @@ -270,7 +326,7 @@ def match_token(state, token, context) def match_token_at_0(token, context) if match_EOF(context, token) build(context, token); - return 22 + return 41 end if match_Language(context, token) start_rule(context, :Feature); @@ -373,7 +429,7 @@ def match_token_at_3(token, context) end_rule(context, :FeatureHeader); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Empty(context, token) build(context, token); @@ -403,6 +459,13 @@ def match_token_at_3(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :FeatureHeader); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) start_rule(context, :Description); build(context, token); @@ -411,7 +474,7 @@ def match_token_at_3(token, context) state_comment = "State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0" token.detach - expected_tokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"] + expected_tokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -425,7 +488,7 @@ def match_token_at_4(token, context) end_rule(context, :FeatureHeader); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Comment(context, token) end_rule(context, :Description); @@ -455,6 +518,14 @@ def match_token_at_4(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Description); + end_rule(context, :FeatureHeader); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) build(context, token); return 4 @@ -462,7 +533,7 @@ def match_token_at_4(token, context) state_comment = "State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0" token.detach - expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Other"] + expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -475,7 +546,7 @@ def match_token_at_5(token, context) end_rule(context, :FeatureHeader); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Comment(context, token) build(context, token); @@ -501,6 +572,13 @@ def match_token_at_5(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :FeatureHeader); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Empty(context, token) build(context, token); return 5 @@ -508,7 +586,7 @@ def match_token_at_5(token, context) state_comment = "State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0" token.detach - expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#Empty"] + expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -521,7 +599,7 @@ def match_token_at_6(token, context) end_rule(context, :Background); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Empty(context, token) build(context, token); @@ -550,6 +628,13 @@ def match_token_at_6(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Background); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) start_rule(context, :Description); build(context, token); @@ -558,7 +643,7 @@ def match_token_at_6(token, context) state_comment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0" token.detach - expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"] + expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -572,7 +657,7 @@ def match_token_at_7(token, context) end_rule(context, :Background); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Comment(context, token) end_rule(context, :Description); @@ -601,6 +686,14 @@ def match_token_at_7(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Description); + end_rule(context, :Background); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) build(context, token); return 7 @@ -608,7 +701,7 @@ def match_token_at_7(token, context) state_comment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0" token.detach - expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Other"] + expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -621,7 +714,7 @@ def match_token_at_8(token, context) end_rule(context, :Background); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Comment(context, token) build(context, token); @@ -646,6 +739,13 @@ def match_token_at_8(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Background); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Empty(context, token) build(context, token); return 8 @@ -653,7 +753,7 @@ def match_token_at_8(token, context) state_comment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0" token.detach - expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#Empty"] + expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -667,7 +767,7 @@ def match_token_at_9(token, context) end_rule(context, :Background); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_TableRow(context, token) start_rule(context, :DataTable); @@ -677,7 +777,7 @@ def match_token_at_9(token, context) if match_DocStringSeparator(context, token) start_rule(context, :DocString); build(context, token); - return 25 + return 48 end if match_StepLine(context, token) end_rule(context, :Step); @@ -701,6 +801,14 @@ def match_token_at_9(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Comment(context, token) build(context, token); return 9 @@ -712,7 +820,7 @@ def match_token_at_9(token, context) state_comment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0" token.detach - expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"] + expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -727,7 +835,7 @@ def match_token_at_10(token, context) end_rule(context, :Background); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_TableRow(context, token) build(context, token); @@ -758,6 +866,15 @@ def match_token_at_10(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Comment(context, token) build(context, token); return 10 @@ -769,7 +886,7 @@ def match_token_at_10(token, context) state_comment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0" token.detach - expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"] + expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -813,7 +930,7 @@ def match_token_at_12(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Empty(context, token) build(context, token); @@ -858,6 +975,14 @@ def match_token_at_12(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) start_rule(context, :Description); build(context, token); @@ -866,7 +991,7 @@ def match_token_at_12(token, context) state_comment = "State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0" token.detach - expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"] + expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -881,7 +1006,7 @@ def match_token_at_13(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Comment(context, token) end_rule(context, :Description); @@ -928,6 +1053,15 @@ def match_token_at_13(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Description); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) build(context, token); return 13 @@ -935,7 +1069,7 @@ def match_token_at_13(token, context) state_comment = "State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0" token.detach - expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"] + expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -949,7 +1083,7 @@ def match_token_at_14(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Comment(context, token) build(context, token); @@ -990,6 +1124,14 @@ def match_token_at_14(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Empty(context, token) build(context, token); return 14 @@ -997,7 +1139,7 @@ def match_token_at_14(token, context) state_comment = "State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0" token.detach - expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"] + expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -1012,7 +1154,7 @@ def match_token_at_15(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_TableRow(context, token) start_rule(context, :DataTable); @@ -1022,7 +1164,7 @@ def match_token_at_15(token, context) if match_DocStringSeparator(context, token) start_rule(context, :DocString); build(context, token); - return 23 + return 46 end if match_StepLine(context, token) end_rule(context, :Step); @@ -1064,6 +1206,15 @@ def match_token_at_15(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Comment(context, token) build(context, token); return 15 @@ -1075,7 +1226,7 @@ def match_token_at_15(token, context) state_comment = "State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0" token.detach - expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"] + expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -1091,7 +1242,7 @@ def match_token_at_16(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_TableRow(context, token) build(context, token); @@ -1142,6 +1293,16 @@ def match_token_at_16(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Comment(context, token) build(context, token); return 16 @@ -1153,7 +1314,7 @@ def match_token_at_16(token, context) state_comment = "State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0" token.detach - expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"] + expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -1199,7 +1360,7 @@ def match_token_at_18(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Empty(context, token) build(context, token); @@ -1252,6 +1413,16 @@ def match_token_at_18(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) start_rule(context, :Description); build(context, token); @@ -1260,7 +1431,7 @@ def match_token_at_18(token, context) state_comment = "State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0" token.detach - expected_tokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"] + expected_tokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -1277,7 +1448,7 @@ def match_token_at_19(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Comment(context, token) end_rule(context, :Description); @@ -1332,6 +1503,17 @@ def match_token_at_19(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Description); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) build(context, token); return 19 @@ -1339,7 +1521,7 @@ def match_token_at_19(token, context) state_comment = "State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0" token.detach - expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Other"] + expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -1355,7 +1537,7 @@ def match_token_at_20(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_Comment(context, token) build(context, token); @@ -1404,6 +1586,16 @@ def match_token_at_20(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Empty(context, token) build(context, token); return 20 @@ -1411,7 +1603,7 @@ def match_token_at_20(token, context) state_comment = "State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0" token.detach - expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Empty"] + expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) @@ -1428,7 +1620,7 @@ def match_token_at_21(token, context) end_rule(context, :ScenarioDefinition); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end if match_TableRow(context, token) build(context, token); @@ -1476,6 +1668,17 @@ def match_token_at_21(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :ExamplesTable); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Comment(context, token) build(context, token); return 21 @@ -1487,140 +1690,1648 @@ def match_token_at_21(token, context) state_comment = "State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0" token.detach - expected_tokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"] + expected_tokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 21 end - # GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - def match_token_at_23(token, context) - if match_DocStringSeparator(context, token) + # GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0 + def match_token_at_22(token, context) + if match_EOF(context, token) + end_rule(context, :RuleHeader); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Empty(context, token) + build(context, token); + return 22 + end + if match_Comment(context, token) build(context, token); return 24 end + if match_BackgroundLine(context, token) + end_rule(context, :RuleHeader); + start_rule(context, :Background); + build(context, token); + return 25 + end + if match_TagLine(context, token) + end_rule(context, :RuleHeader); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :RuleHeader); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :RuleHeader); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Other(context, token) + start_rule(context, :Description); build(context, token); return 23 end - state_comment = "State: 23 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + state_comment = "State: 22 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0" token.detach - expected_tokens = ["#DocStringSeparator", "#Other"] + expected_tokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) - return 23 + return 22 end - # GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - def match_token_at_24(token, context) + # GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0 + def match_token_at_23(token, context) if match_EOF(context, token) - end_rule(context, :DocString); - end_rule(context, :Step); - end_rule(context, :Scenario); - end_rule(context, :ScenarioDefinition); + end_rule(context, :Description); + end_rule(context, :RuleHeader); + end_rule(context, :Rule); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end - if match_StepLine(context, token) - end_rule(context, :DocString); - end_rule(context, :Step); - start_rule(context, :Step); + if match_Comment(context, token) + end_rule(context, :Description); build(context, token); - return 15 + return 24 end - if match_TagLine(context, token) - if lookahead_0(context, token) - end_rule(context, :DocString); - end_rule(context, :Step); - start_rule(context, :ExamplesDefinition); - start_rule(context, :Tags); + if match_BackgroundLine(context, token) + end_rule(context, :Description); + end_rule(context, :RuleHeader); + start_rule(context, :Background); build(context, token); - return 17 - end + return 25 end if match_TagLine(context, token) - end_rule(context, :DocString); - end_rule(context, :Step); - end_rule(context, :Scenario); - end_rule(context, :ScenarioDefinition); + end_rule(context, :Description); + end_rule(context, :RuleHeader); start_rule(context, :ScenarioDefinition); start_rule(context, :Tags); build(context, token); - return 11 - end - if match_ExamplesLine(context, token) - end_rule(context, :DocString); - end_rule(context, :Step); - start_rule(context, :ExamplesDefinition); - start_rule(context, :Examples); - build(context, token); - return 18 + return 30 end if match_ScenarioLine(context, token) - end_rule(context, :DocString); - end_rule(context, :Step); - end_rule(context, :Scenario); - end_rule(context, :ScenarioDefinition); + end_rule(context, :Description); + end_rule(context, :RuleHeader); start_rule(context, :ScenarioDefinition); start_rule(context, :Scenario); build(context, token); - return 12 + return 31 end - if match_Comment(context, token) + if match_RuleLine(context, token) + end_rule(context, :Description); + end_rule(context, :RuleHeader); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); build(context, token); - return 24 + return 22 end - if match_Empty(context, token) + if match_Other(context, token) build(context, token); - return 24 + return 23 end - state_comment = "State: 24 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + state_comment = "State: 23 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0" token.detach - expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#Comment", "#Empty"] + expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) - return 24 + return 23 end - # GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 - def match_token_at_25(token, context) - if match_DocStringSeparator(context, token) + # GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0 + def match_token_at_24(token, context) + if match_EOF(context, token) + end_rule(context, :RuleHeader); + end_rule(context, :Rule); + end_rule(context, :Feature); build(context, token); - return 26 + return 41 end - if match_Other(context, token) + if match_Comment(context, token) + build(context, token); + return 24 + end + if match_BackgroundLine(context, token) + end_rule(context, :RuleHeader); + start_rule(context, :Background); build(context, token); return 25 end + if match_TagLine(context, token) + end_rule(context, :RuleHeader); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :RuleHeader); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :RuleHeader); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Empty(context, token) + build(context, token); + return 24 + end - state_comment = "State: 25 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + state_comment = "State: 24 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0" token.detach - expected_tokens = ["#DocStringSeparator", "#Other"] + expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) - return 25 + return 24 end - # GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 - def match_token_at_26(token, context) + # GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0 + def match_token_at_25(token, context) if match_EOF(context, token) - end_rule(context, :DocString); - end_rule(context, :Step); end_rule(context, :Background); + end_rule(context, :Rule); end_rule(context, :Feature); build(context, token); - return 22 + return 41 end - if match_StepLine(context, token) - end_rule(context, :DocString); - end_rule(context, :Step); + if match_Empty(context, token) + build(context, token); + return 25 + end + if match_Comment(context, token) + build(context, token); + return 27 + end + if match_StepLine(context, token) + start_rule(context, :Step); + build(context, token); + return 28 + end + if match_TagLine(context, token) + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Background); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Other(context, token) + start_rule(context, :Description); + build(context, token); + return 26 + end + + state_comment = "State: 25 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0" + token.detach + expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 25 + end + + # GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0 + def match_token_at_26(token, context) + if match_EOF(context, token) + end_rule(context, :Description); + end_rule(context, :Background); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Comment(context, token) + end_rule(context, :Description); + build(context, token); + return 27 + end + if match_StepLine(context, token) + end_rule(context, :Description); + start_rule(context, :Step); + build(context, token); + return 28 + end + if match_TagLine(context, token) + end_rule(context, :Description); + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :Description); + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Description); + end_rule(context, :Background); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Other(context, token) + build(context, token); + return 26 + end + + state_comment = "State: 26 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0" + token.detach + expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 26 + end + + # GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0 + def match_token_at_27(token, context) + if match_EOF(context, token) + end_rule(context, :Background); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Comment(context, token) + build(context, token); + return 27 + end + if match_StepLine(context, token) + start_rule(context, :Step); + build(context, token); + return 28 + end + if match_TagLine(context, token) + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Background); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Empty(context, token) + build(context, token); + return 27 + end + + state_comment = "State: 27 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0" + token.detach + expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 27 + end + + # GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0 + def match_token_at_28(token, context) + if match_EOF(context, token) + end_rule(context, :Step); + end_rule(context, :Background); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_TableRow(context, token) + start_rule(context, :DataTable); + build(context, token); + return 29 + end + if match_DocStringSeparator(context, token) + start_rule(context, :DocString); + build(context, token); + return 44 + end + if match_StepLine(context, token) + end_rule(context, :Step); + start_rule(context, :Step); + build(context, token); + return 28 + end + if match_TagLine(context, token) + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Step); + end_rule(context, :Background); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Comment(context, token) + build(context, token); + return 28 + end + if match_Empty(context, token) + build(context, token); + return 28 + end + + state_comment = "State: 28 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0" + token.detach + expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 28 + end + + # GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + def match_token_at_29(token, context) + if match_EOF(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Background); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_TableRow(context, token) + build(context, token); + return 29 + end + if match_StepLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + start_rule(context, :Step); + build(context, token); + return 28 + end + if match_TagLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Background); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Comment(context, token) + build(context, token); + return 29 + end + if match_Empty(context, token) + build(context, token); + return 29 + end + + state_comment = "State: 29 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0" + token.detach + expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 29 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0 + def match_token_at_30(token, context) + if match_TagLine(context, token) + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :Tags); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_Comment(context, token) + build(context, token); + return 30 + end + if match_Empty(context, token) + build(context, token); + return 30 + end + + state_comment = "State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0" + token.detach + expected_tokens = ["#TagLine", "#ScenarioLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 30 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0 + def match_token_at_31(token, context) + if match_EOF(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Empty(context, token) + build(context, token); + return 31 + end + if match_Comment(context, token) + build(context, token); + return 33 + end + if match_StepLine(context, token) + start_rule(context, :Step); + build(context, token); + return 34 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Other(context, token) + start_rule(context, :Description); + build(context, token); + return 32 + end + + state_comment = "State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0" + token.detach + expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 31 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0 + def match_token_at_32(token, context) + if match_EOF(context, token) + end_rule(context, :Description); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Comment(context, token) + end_rule(context, :Description); + build(context, token); + return 33 + end + if match_StepLine(context, token) + end_rule(context, :Description); + start_rule(context, :Step); + build(context, token); + return 34 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :Description); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :Description); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + end_rule(context, :Description); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :Description); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Description); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Other(context, token) + build(context, token); + return 32 + end + + state_comment = "State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0" + token.detach + expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 32 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0 + def match_token_at_33(token, context) + if match_EOF(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Comment(context, token) + build(context, token); + return 33 + end + if match_StepLine(context, token) + start_rule(context, :Step); + build(context, token); + return 34 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Empty(context, token) + build(context, token); + return 33 + end + + state_comment = "State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0" + token.detach + expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 33 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0 + def match_token_at_34(token, context) + if match_EOF(context, token) + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_TableRow(context, token) + start_rule(context, :DataTable); + build(context, token); + return 35 + end + if match_DocStringSeparator(context, token) + start_rule(context, :DocString); + build(context, token); + return 42 + end + if match_StepLine(context, token) + end_rule(context, :Step); + start_rule(context, :Step); + build(context, token); + return 34 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :Step); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + end_rule(context, :Step); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Comment(context, token) + build(context, token); + return 34 + end + if match_Empty(context, token) + build(context, token); + return 34 + end + + state_comment = "State: 34 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0" + token.detach + expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 34 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 + def match_token_at_35(token, context) + if match_EOF(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_TableRow(context, token) + build(context, token); + return 35 + end + if match_StepLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + start_rule(context, :Step); + build(context, token); + return 34 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :DataTable); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Comment(context, token) + build(context, token); + return 35 + end + if match_Empty(context, token) + build(context, token); + return 35 + end + + state_comment = "State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0" + token.detach + expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 35 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0 + def match_token_at_36(token, context) + if match_TagLine(context, token) + build(context, token); + return 36 + end + if match_ExamplesLine(context, token) + end_rule(context, :Tags); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_Comment(context, token) + build(context, token); + return 36 + end + if match_Empty(context, token) + build(context, token); + return 36 + end + + state_comment = "State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0" + token.detach + expected_tokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 36 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0 + def match_token_at_37(token, context) + if match_EOF(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Empty(context, token) + build(context, token); + return 37 + end + if match_Comment(context, token) + build(context, token); + return 39 + end + if match_TableRow(context, token) + start_rule(context, :ExamplesTable); + build(context, token); + return 40 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Other(context, token) + start_rule(context, :Description); + build(context, token); + return 38 + end + + state_comment = "State: 37 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0" + token.detach + expected_tokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 37 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0 + def match_token_at_38(token, context) + if match_EOF(context, token) + end_rule(context, :Description); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Comment(context, token) + end_rule(context, :Description); + build(context, token); + return 39 + end + if match_TableRow(context, token) + end_rule(context, :Description); + start_rule(context, :ExamplesTable); + build(context, token); + return 40 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :Description); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :Description); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + end_rule(context, :Description); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :Description); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Description); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Other(context, token) + build(context, token); + return 38 + end + + state_comment = "State: 38 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0" + token.detach + expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 38 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0 + def match_token_at_39(token, context) + if match_EOF(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_Comment(context, token) + build(context, token); + return 39 + end + if match_TableRow(context, token) + start_rule(context, :ExamplesTable); + build(context, token); + return 40 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Empty(context, token) + build(context, token); + return 39 + end + + state_comment = "State: 39 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0" + token.detach + expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 39 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0 + def match_token_at_40(token, context) + if match_EOF(context, token) + end_rule(context, :ExamplesTable); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_TableRow(context, token) + build(context, token); + return 40 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :ExamplesTable); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :ExamplesTable); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + end_rule(context, :ExamplesTable); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :ExamplesTable); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :ExamplesTable); + end_rule(context, :Examples); + end_rule(context, :ExamplesDefinition); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Comment(context, token) + build(context, token); + return 40 + end + if match_Empty(context, token) + build(context, token); + return 40 + end + + state_comment = "State: 40 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0" + token.detach + expected_tokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 40 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + def match_token_at_42(token, context) + if match_DocStringSeparator(context, token) + build(context, token); + return 43 + end + if match_Other(context, token) + build(context, token); + return 42 + end + + state_comment = "State: 42 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + token.detach + expected_tokens = ["#DocStringSeparator", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 42 + end + + # GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + def match_token_at_43(token, context) + if match_EOF(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_StepLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + start_rule(context, :Step); + build(context, token); + return 34 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 36 + end + end + if match_TagLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ExamplesLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 37 + end + if match_ScenarioLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Comment(context, token) + build(context, token); + return 43 + end + if match_Empty(context, token) + build(context, token); + return 43 + end + + state_comment = "State: 43 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + token.detach + expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 43 + end + + # GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + def match_token_at_44(token, context) + if match_DocStringSeparator(context, token) + build(context, token); + return 45 + end + if match_Other(context, token) + build(context, token); + return 44 + end + + state_comment = "State: 44 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + token.detach + expected_tokens = ["#DocStringSeparator", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 44 + end + + # GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + def match_token_at_45(token, context) + if match_EOF(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Background); + end_rule(context, :Rule); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_StepLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + start_rule(context, :Step); + build(context, token); + return 28 + end + if match_TagLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 30 + end + if match_ScenarioLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 31 + end + if match_RuleLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Background); + end_rule(context, :Rule); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Comment(context, token) + build(context, token); + return 45 + end + if match_Empty(context, token) + build(context, token); + return 45 + end + + state_comment = "State: 45 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + token.detach + expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 45 + end + + # GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + def match_token_at_46(token, context) + if match_DocStringSeparator(context, token) + build(context, token); + return 47 + end + if match_Other(context, token) + build(context, token); + return 46 + end + + state_comment = "State: 46 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + token.detach + expected_tokens = ["#DocStringSeparator", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 46 + end + + # GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + def match_token_at_47(token, context) + if match_EOF(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_StepLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + start_rule(context, :Step); + build(context, token); + return 15 + end + if match_TagLine(context, token) + if lookahead_0(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Tags); + build(context, token); + return 17 + end + end + if match_TagLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Tags); + build(context, token); + return 11 + end + if match_ExamplesLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + start_rule(context, :ExamplesDefinition); + start_rule(context, :Examples); + build(context, token); + return 18 + end + if match_ScenarioLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :ScenarioDefinition); + start_rule(context, :Scenario); + build(context, token); + return 12 + end + if match_RuleLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Scenario); + end_rule(context, :ScenarioDefinition); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end + if match_Comment(context, token) + build(context, token); + return 47 + end + if match_Empty(context, token) + build(context, token); + return 47 + end + + state_comment = "State: 47 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + token.detach + expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 47 + end + + # GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 + def match_token_at_48(token, context) + if match_DocStringSeparator(context, token) + build(context, token); + return 49 + end + if match_Other(context, token) + build(context, token); + return 48 + end + + state_comment = "State: 48 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0" + token.detach + expected_tokens = ["#DocStringSeparator", "#Other"] + error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) + raise error if (stop_at_first_error) + add_error(context, error) + return 48 + end + + # GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 + def match_token_at_49(token, context) + if match_EOF(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Background); + end_rule(context, :Feature); + build(context, token); + return 41 + end + if match_StepLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 9 @@ -1643,22 +3354,31 @@ def match_token_at_26(token, context) build(context, token); return 12 end + if match_RuleLine(context, token) + end_rule(context, :DocString); + end_rule(context, :Step); + end_rule(context, :Background); + start_rule(context, :Rule); + start_rule(context, :RuleHeader); + build(context, token); + return 22 + end if match_Comment(context, token) build(context, token); - return 26 + return 49 end if match_Empty(context, token) build(context, token); - return 26 + return 49 end - state_comment = "State: 26 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" + state_comment = "State: 49 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0" token.detach - expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#Comment", "#Empty"] + expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) - return 26 + return 49 end diff --git a/gherkin/ruby/lib/gherkin/pickles/compiler.rb b/gherkin/ruby/lib/gherkin/pickles/compiler.rb index af253234faf..5936ce69552 100644 --- a/gherkin/ruby/lib/gherkin/pickles/compiler.rb +++ b/gherkin/ruby/lib/gherkin/pickles/compiler.rb @@ -6,23 +6,34 @@ def compile(gherkin_document) return pickles unless gherkin_document[:feature] feature = gherkin_document[:feature] - feature_tags = feature[:tags] + language = feature[:language] + tags = feature[:tags] background_steps = [] - feature[:children].each do |steps_container| - if(steps_container[:type] == :Background) - background_steps = pickle_steps(steps_container) - elsif(steps_container[:examples].empty?) - compile_scenario(feature_tags, background_steps, steps_container, feature[:language], pickles) + build(pickles, language, tags, background_steps, feature) + pickles + end + + private + + def build(pickles, language, tags, parent_background_steps, parent) + background_steps = parent_background_steps.dup + parent[:children].each do |child| + if child[:type] == :Background + background_steps.concat(pickle_steps(child)) + elsif child[:type] == :Rule + build(pickles, language, tags, background_steps, child) else - compile_scenario_outline(feature_tags, background_steps, steps_container, feature[:language], pickles) + scenario = child + if scenario[:examples].empty? + compile_scenario(tags, background_steps, scenario, language, pickles) + else + compile_scenario_outline(tags, background_steps, scenario, language, pickles) + end end end - return pickles end - private - def compile_scenario(feature_tags, background_steps, scenario, language, pickles) steps = scenario[:steps].empty? ? [] : [].concat(background_steps) diff --git a/gherkin/ruby/lib/gherkin/token_matcher.rb b/gherkin/ruby/lib/gherkin/token_matcher.rb index 8ae863be736..bfdf65179c7 100644 --- a/gherkin/ruby/lib/gherkin/token_matcher.rb +++ b/gherkin/ruby/lib/gherkin/token_matcher.rb @@ -28,6 +28,10 @@ def match_FeatureLine(token) match_title_line(token, :FeatureLine, @dialect.feature_keywords) end + def match_RuleLine(token) + match_title_line(token, :RuleLine, @dialect.rule_keywords) + end + def match_ScenarioLine(token) match_title_line(token, :ScenarioLine, @dialect.scenario_keywords) || match_title_line(token, :ScenarioLine, @dialect.scenario_outline_keywords) diff --git a/gherkin/ruby/ruby.iml b/gherkin/ruby/ruby.iml new file mode 100644 index 00000000000..0db3ee78bdb --- /dev/null +++ b/gherkin/ruby/ruby.iml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gherkin/ruby/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/ruby/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/ruby/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/ruby/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/ruby/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/ruby/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/ruby/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/ruby/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/ruby/testdata/good/rule.feature b/gherkin/ruby/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/ruby/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/ruby/testdata/good/rule.feature.ast.ndjson b/gherkin/ruby/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/ruby/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/ruby/testdata/good/rule.feature.pickles.ndjson b/gherkin/ruby/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/ruby/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/ruby/testdata/good/rule.feature.source.ndjson b/gherkin/ruby/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/ruby/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/ruby/testdata/good/rule.feature.tokens b/gherkin/ruby/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/ruby/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF diff --git a/gherkin/testdata/bad/multiple_parser_errors.feature.errors.ndjson b/gherkin/testdata/bad/multiple_parser_errors.feature.errors.ndjson index 5341859e246..ea4f23dd462 100644 --- a/gherkin/testdata/bad/multiple_parser_errors.feature.errors.ndjson +++ b/gherkin/testdata/bad/multiple_parser_errors.feature.errors.ndjson @@ -1,2 +1,2 @@ {"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} -{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} +{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #RuleLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"} diff --git a/gherkin/testdata/good/minimal-example.feature.ast.ndjson b/gherkin/testdata/good/minimal-example.feature.ast.ndjson index 666ea4f547b..3171c20a7b5 100644 --- a/gherkin/testdata/good/minimal-example.feature.ast.ndjson +++ b/gherkin/testdata/good/minimal-example.feature.ast.ndjson @@ -1,43 +1 @@ -{ - "document": { - "comments": [], - "feature": { - "children": [ - { - "examples": [], - "keyword": "Example", - "location": { - "column": 3, - "line": 3 - }, - "name": "minimalistic", - "steps": [ - { - "keyword": "Given ", - "location": { - "column": 5, - "line": 4 - }, - "text": "the minimalism", - "type": "Step" - } - ], - "tags": [], - "type": "Scenario" - } - ], - "keyword": "Feature", - "language": "en", - "location": { - "column": 1, - "line": 1 - }, - "name": "Minimal", - "tags": [], - "type": "Feature" - }, - "type": "GherkinDocument" - }, - "type": "gherkin-document", - "uri": "testdata/good/minimal-example.feature" -} +{"document":{"comments":[],"feature":{"children":[{"examples":[],"keyword":"Example","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Minimal","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/minimal-example.feature"} diff --git a/gherkin/testdata/good/rule.feature b/gherkin/testdata/good/rule.feature new file mode 100644 index 00000000000..c5c3e7f1232 --- /dev/null +++ b/gherkin/testdata/good/rule.feature @@ -0,0 +1,19 @@ +Feature: Some rules + + Background: + Given fb + + Rule: A + The rule A description + + Background: + Given ab + + Example: Example A + Given a + + Rule: B + The rule B description + + Example: Example B + Given b \ No newline at end of file diff --git a/gherkin/testdata/good/rule.feature.ast.ndjson b/gherkin/testdata/good/rule.feature.ast.ndjson new file mode 100644 index 00000000000..ab8e06740d4 --- /dev/null +++ b/gherkin/testdata/good/rule.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"fb","type":"Step"}],"type":"Background"},{"children":[{"keyword":"Background","location":{"column":5,"line":9},"name":"","steps":[{"keyword":"Given ","location":{"column":7,"line":10},"text":"ab","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Example","location":{"column":5,"line":12},"name":"Example A","steps":[{"keyword":"Given ","location":{"column":7,"line":13},"text":"a","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule A description","keyword":"Rule","location":{"column":3,"line":6},"name":"A","type":"Rule"},{"children":[{"examples":[],"keyword":"Example","location":{"column":5,"line":18},"name":"Example B","steps":[{"keyword":"Given ","location":{"column":7,"line":19},"text":"b","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The rule B description","keyword":"Rule","location":{"column":3,"line":15},"name":"B","type":"Rule"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Some rules","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/rule.feature"} diff --git a/gherkin/testdata/good/rule.feature.pickles.ndjson b/gherkin/testdata/good/rule.feature.pickles.ndjson new file mode 100644 index 00000000000..427057ced72 --- /dev/null +++ b/gherkin/testdata/good/rule.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":5,"line":12}],"name":"Example A","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":10}],"text":"ab"},{"arguments":[],"locations":[{"column":13,"line":13}],"text":"a"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} +{"pickle":{"language":"en","locations":[{"column":5,"line":18}],"name":"Example B","steps":[{"arguments":[],"locations":[{"column":11,"line":4}],"text":"fb"},{"arguments":[],"locations":[{"column":13,"line":19}],"text":"b"}],"tags":[]},"type":"pickle","uri":"testdata/good/rule.feature"} diff --git a/gherkin/testdata/good/rule.feature.source.ndjson b/gherkin/testdata/good/rule.feature.source.ndjson new file mode 100644 index 00000000000..e18933881b8 --- /dev/null +++ b/gherkin/testdata/good/rule.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Some rules\n\n Background:\n Given fb\n\n Rule: A\n The rule A description\n\n Background:\n Given ab\n\n Example: Example A\n Given a\n\n Rule: B\n The rule B description\n\n Example: Example B\n Given b","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/rule.feature"} diff --git a/gherkin/testdata/good/rule.feature.tokens b/gherkin/testdata/good/rule.feature.tokens new file mode 100644 index 00000000000..2985c8eb9dc --- /dev/null +++ b/gherkin/testdata/good/rule.feature.tokens @@ -0,0 +1,20 @@ +(1:1)FeatureLine:Feature/Some rules/ +(2:1)Empty:// +(3:3)BackgroundLine:Background// +(4:5)StepLine:Given /fb/ +(5:1)Empty:// +(6:3)RuleLine:Rule/A/ +(7:1)Other:/ The rule A description/ +(8:1)Other:// +(9:5)BackgroundLine:Background// +(10:7)StepLine:Given /ab/ +(11:1)Empty:// +(12:5)ScenarioLine:Example/Example A/ +(13:7)StepLine:Given /a/ +(14:1)Empty:// +(15:3)RuleLine:Rule/B/ +(16:1)Other:/ The rule B description/ +(17:1)Other:// +(18:5)ScenarioLine:Example/Example B/ +(19:7)StepLine:Given /b/ +EOF