How to use startsWithTitleKeyword method in Cucumber-gherkin

Best JavaScript code snippet using cucumber-gherkin

gherkin.js

Source:gherkin.js Github

copy

Full Screen

...3678};3679GherkinLine.prototype.startsWith = function startsWith(prefix) {3680  return this.trimmedLineText.indexOf(prefix) == 0;3681};3682GherkinLine.prototype.startsWithTitleKeyword = function startsWithTitleKeyword(keyword) {3683  return this.startsWith(keyword+':'); // The C# impl is more complicated. Find out why.3684};3685GherkinLine.prototype.getLineText = function getLineText(indentToRemove) {3686  if (indentToRemove < 0 || indentToRemove > this.indent) {3687    return this.trimmedLineText;3688  } else {3689    return this.lineText.substring(indentToRemove);3690  }3691};3692GherkinLine.prototype.getRestTrimmed = function getRestTrimmed(length) {3693  return this.trimmedLineText.substring(length).trim();3694};3695GherkinLine.prototype.getTableCells = function getTableCells() {3696  var cells = [];3697  var col = 0;3698  var startCol = col + 1;3699  var cell = '';3700  var firstCell = true;3701  while (col < this.trimmedLineText.length) {3702    var chr = this.trimmedLineText[col];3703    col++;3704    if (chr == '|') {3705      if (firstCell) {3706        // First cell (content before the first |) is skipped3707        firstCell = false;3708      } else {3709        var cellIndent = cell.length - cell.replace(/^\s+/g, '').length;3710        var span = {column: this.indent + startCol + cellIndent, text: cell.trim()};3711        cells.push(span);3712      }3713      cell = '';3714      startCol = col + 1;3715    } else if (chr == '\\') {3716      chr = this.trimmedLineText[col];3717      col += 1;3718      if (chr == 'n') {3719        cell += '\n';3720      } else {3721        if (chr != '|' && chr != '\\') {3722          cell += '\\';3723        }3724        cell += chr;3725      }3726    } else {3727      cell += chr;3728    }3729  }3730  return cells;3731};3732GherkinLine.prototype.getTags = function getTags() {3733  var column = this.indent + 1;3734  var items = this.trimmedLineText.trim().split('@');3735  items.shift();3736  return items.map(function (item) {3737    var length = item.length;3738    var span = {column: column, text: '@' + item.trim()};3739    column += length + 1;3740    return span;3741  });3742};3743module.exports = GherkinLine;3744},{"./count_symbols":4}],10:[function(require,module,exports){3745// This file is generated. Do not edit! Edit gherkin-javascript.razor instead.3746var Errors = require('./errors');3747var AstBuilder = require('./ast_builder');3748var TokenScanner = require('./token_scanner');3749var TokenMatcher = require('./token_matcher');3750var RULE_TYPES = [3751  'None',3752  '_EOF', // #EOF3753  '_Empty', // #Empty3754  '_Comment', // #Comment3755  '_TagLine', // #TagLine3756  '_FeatureLine', // #FeatureLine3757  '_BackgroundLine', // #BackgroundLine3758  '_ScenarioLine', // #ScenarioLine3759  '_ScenarioOutlineLine', // #ScenarioOutlineLine3760  '_ExamplesLine', // #ExamplesLine3761  '_StepLine', // #StepLine3762  '_DocStringSeparator', // #DocStringSeparator3763  '_TableRow', // #TableRow3764  '_Language', // #Language3765  '_Other', // #Other3766  'GherkinDocument', // GherkinDocument! := Feature?3767  'Feature', // Feature! := Feature_Header Background? Scenario_Definition*3768  'Feature_Header', // Feature_Header! := #Language? Tags? #FeatureLine Description_Helper3769  'Background', // Background! := #BackgroundLine Description_Helper Step*3770  'Scenario_Definition', // Scenario_Definition! := Tags? (Scenario | ScenarioOutline)3771  'Scenario', // Scenario! := #ScenarioLine Description_Helper Step*3772  'ScenarioOutline', // ScenarioOutline! := #ScenarioOutlineLine Description_Helper Step* Examples_Definition*3773  'Examples_Definition', // Examples_Definition! [#Empty|#Comment|#TagLine-&gt;#ExamplesLine] := Tags? Examples3774  'Examples', // Examples! := #ExamplesLine Description_Helper Examples_Table?3775  'Examples_Table', // Examples_Table! := #TableRow #TableRow*3776  'Step', // Step! := #StepLine Step_Arg?3777  'Step_Arg', // Step_Arg := (DataTable | DocString)3778  'DataTable', // DataTable! := #TableRow+3779  'DocString', // DocString! := #DocStringSeparator #Other* #DocStringSeparator3780  'Tags', // Tags! := #TagLine+3781  'Description_Helper', // Description_Helper := #Empty* Description? #Comment*3782  'Description', // Description! := #Other+3783];3784module.exports = function Parser(builder) {3785  builder = builder || new AstBuilder();3786  var self = this;3787  var context;3788  this.parse = function(tokenScanner, tokenMatcher) {3789    if(typeof tokenScanner == 'string') {3790      tokenScanner = new TokenScanner(tokenScanner);3791    }3792    tokenMatcher = tokenMatcher || new TokenMatcher();3793    builder.reset();3794    tokenMatcher.reset();3795    context = {3796      tokenScanner: tokenScanner,3797      tokenMatcher: tokenMatcher,3798      tokenQueue: [],3799      errors: []3800    };3801    startRule(context, "GherkinDocument");3802    var state = 0;3803    var token = null;3804    while(true) {3805      token = readToken(context);3806      state = matchToken(state, token, context);3807      if(token.isEof) break;3808    }3809    endRule(context, "GherkinDocument");3810    if(context.errors.length > 0) {3811      throw Errors.CompositeParserException.create(context.errors);3812    }3813    return getResult();3814  };3815  function addError(context, error) {3816    context.errors.push(error);3817    if (context.errors.length > 10)3818      throw Errors.CompositeParserException.create(context.errors);3819  }3820  function startRule(context, ruleType) {3821    handleAstError(context, function () {3822      builder.startRule(ruleType);3823    });3824  }3825  function endRule(context, ruleType) {3826    handleAstError(context, function () {3827      builder.endRule(ruleType);3828    });3829  }3830  function build(context, token) {3831    handleAstError(context, function () {3832      builder.build(token);3833    });3834  }3835  function getResult() {3836    return builder.getResult();3837  }3838  function handleAstError(context, action) {3839    handleExternalError(context, true, action)3840  }3841  function handleExternalError(context, defaultValue, action) {3842    if(self.stopAtFirstError) return action();3843    try {3844      return action();3845    } catch (e) {3846      if(e instanceof Errors.CompositeParserException) {3847        e.errors.forEach(function (error) {3848          addError(context, error);3849        });3850      } else if(3851        e instanceof Errors.ParserException ||3852        e instanceof Errors.AstBuilderException ||3853        e instanceof Errors.UnexpectedTokenException ||3854        e instanceof Errors.NoSuchLanguageException3855      ) {3856        addError(context, e);3857      } else {3858        throw e;3859      }3860    }3861    return defaultValue;3862  }3863  function readToken(context) {3864    return context.tokenQueue.length > 0 ?3865      context.tokenQueue.shift() :3866      context.tokenScanner.read();3867  }3868  function matchToken(state, token, context) {3869    switch(state) {3870    case 0:3871      return matchTokenAt_0(token, context);3872    case 1:3873      return matchTokenAt_1(token, context);3874    case 2:3875      return matchTokenAt_2(token, context);3876    case 3:3877      return matchTokenAt_3(token, context);3878    case 4:3879      return matchTokenAt_4(token, context);3880    case 5:3881      return matchTokenAt_5(token, context);3882    case 6:3883      return matchTokenAt_6(token, context);3884    case 7:3885      return matchTokenAt_7(token, context);3886    case 8:3887      return matchTokenAt_8(token, context);3888    case 9:3889      return matchTokenAt_9(token, context);3890    case 10:3891      return matchTokenAt_10(token, context);3892    case 11:3893      return matchTokenAt_11(token, context);3894    case 12:3895      return matchTokenAt_12(token, context);3896    case 13:3897      return matchTokenAt_13(token, context);3898    case 14:3899      return matchTokenAt_14(token, context);3900    case 15:3901      return matchTokenAt_15(token, context);3902    case 16:3903      return matchTokenAt_16(token, context);3904    case 17:3905      return matchTokenAt_17(token, context);3906    case 18:3907      return matchTokenAt_18(token, context);3908    case 19:3909      return matchTokenAt_19(token, context);3910    case 20:3911      return matchTokenAt_20(token, context);3912    case 21:3913      return matchTokenAt_21(token, context);3914    case 22:3915      return matchTokenAt_22(token, context);3916    case 23:3917      return matchTokenAt_23(token, context);3918    case 24:3919      return matchTokenAt_24(token, context);3920    case 25:3921      return matchTokenAt_25(token, context);3922    case 26:3923      return matchTokenAt_26(token, context);3924    case 28:3925      return matchTokenAt_28(token, context);3926    case 29:3927      return matchTokenAt_29(token, context);3928    case 30:3929      return matchTokenAt_30(token, context);3930    case 31:3931      return matchTokenAt_31(token, context);3932    case 32:3933      return matchTokenAt_32(token, context);3934    case 33:3935      return matchTokenAt_33(token, context);3936    default:3937      throw new Error("Unknown state: " + state);3938    }3939  }3940  // Start3941  function matchTokenAt_0(token, context) {3942    if(match_EOF(context, token)) {3943      build(context, token);3944      return 27;3945    }3946    if(match_Language(context, token)) {3947      startRule(context, 'Feature');3948      startRule(context, 'Feature_Header');3949      build(context, token);3950      return 1;3951    }3952    if(match_TagLine(context, token)) {3953      startRule(context, 'Feature');3954      startRule(context, 'Feature_Header');3955      startRule(context, 'Tags');3956      build(context, token);3957      return 2;3958    }3959    if(match_FeatureLine(context, token)) {3960      startRule(context, 'Feature');3961      startRule(context, 'Feature_Header');3962      build(context, token);3963      return 3;3964    }3965    if(match_Comment(context, token)) {3966      build(context, token);3967      return 0;3968    }3969    if(match_Empty(context, token)) {3970      build(context, token);3971      return 0;3972    }3973    3974    var stateComment = "State: 0 - Start";3975    token.detach();3976    var expectedTokens = ["#EOF", "#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"];3977    var error = token.isEof ?3978      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :3979      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);3980    if (self.stopAtFirstError) throw error;3981    addError(context, error);3982    return 0;3983  }3984  // GherkinDocument:0>Feature:0>Feature_Header:0>#Language:03985  function matchTokenAt_1(token, context) {3986    if(match_TagLine(context, token)) {3987      startRule(context, 'Tags');3988      build(context, token);3989      return 2;3990    }3991    if(match_FeatureLine(context, token)) {3992      build(context, token);3993      return 3;3994    }3995    if(match_Comment(context, token)) {3996      build(context, token);3997      return 1;3998    }3999    if(match_Empty(context, token)) {4000      build(context, token);4001      return 1;4002    }4003    4004    var stateComment = "State: 1 - GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0";4005    token.detach();4006    var expectedTokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"];4007    var error = token.isEof ?4008      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4009      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4010    if (self.stopAtFirstError) throw error;4011    addError(context, error);4012    return 1;4013  }4014  // GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:04015  function matchTokenAt_2(token, context) {4016    if(match_TagLine(context, token)) {4017      build(context, token);4018      return 2;4019    }4020    if(match_FeatureLine(context, token)) {4021      endRule(context, 'Tags');4022      build(context, token);4023      return 3;4024    }4025    if(match_Comment(context, token)) {4026      build(context, token);4027      return 2;4028    }4029    if(match_Empty(context, token)) {4030      build(context, token);4031      return 2;4032    }4033    4034    var stateComment = "State: 2 - GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0";4035    token.detach();4036    var expectedTokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"];4037    var error = token.isEof ?4038      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4039      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4040    if (self.stopAtFirstError) throw error;4041    addError(context, error);4042    return 2;4043  }4044  // GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:04045  function matchTokenAt_3(token, context) {4046    if(match_EOF(context, token)) {4047      endRule(context, 'Feature_Header');4048      endRule(context, 'Feature');4049      build(context, token);4050      return 27;4051    }4052    if(match_Empty(context, token)) {4053      build(context, token);4054      return 3;4055    }4056    if(match_Comment(context, token)) {4057      build(context, token);4058      return 5;4059    }4060    if(match_BackgroundLine(context, token)) {4061      endRule(context, 'Feature_Header');4062      startRule(context, 'Background');4063      build(context, token);4064      return 6;4065    }4066    if(match_TagLine(context, token)) {4067      endRule(context, 'Feature_Header');4068      startRule(context, 'Scenario_Definition');4069      startRule(context, 'Tags');4070      build(context, token);4071      return 11;4072    }4073    if(match_ScenarioLine(context, token)) {4074      endRule(context, 'Feature_Header');4075      startRule(context, 'Scenario_Definition');4076      startRule(context, 'Scenario');4077      build(context, token);4078      return 12;4079    }4080    if(match_ScenarioOutlineLine(context, token)) {4081      endRule(context, 'Feature_Header');4082      startRule(context, 'Scenario_Definition');4083      startRule(context, 'ScenarioOutline');4084      build(context, token);4085      return 17;4086    }4087    if(match_Other(context, token)) {4088      startRule(context, 'Description');4089      build(context, token);4090      return 4;4091    }4092    4093    var stateComment = "State: 3 - GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0";4094    token.detach();4095    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4096    var error = token.isEof ?4097      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4098      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4099    if (self.stopAtFirstError) throw error;4100    addError(context, error);4101    return 3;4102  }4103  // GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:1>Description:0>#Other:04104  function matchTokenAt_4(token, context) {4105    if(match_EOF(context, token)) {4106      endRule(context, 'Description');4107      endRule(context, 'Feature_Header');4108      endRule(context, 'Feature');4109      build(context, token);4110      return 27;4111    }4112    if(match_Comment(context, token)) {4113      endRule(context, 'Description');4114      build(context, token);4115      return 5;4116    }4117    if(match_BackgroundLine(context, token)) {4118      endRule(context, 'Description');4119      endRule(context, 'Feature_Header');4120      startRule(context, 'Background');4121      build(context, token);4122      return 6;4123    }4124    if(match_TagLine(context, token)) {4125      endRule(context, 'Description');4126      endRule(context, 'Feature_Header');4127      startRule(context, 'Scenario_Definition');4128      startRule(context, 'Tags');4129      build(context, token);4130      return 11;4131    }4132    if(match_ScenarioLine(context, token)) {4133      endRule(context, 'Description');4134      endRule(context, 'Feature_Header');4135      startRule(context, 'Scenario_Definition');4136      startRule(context, 'Scenario');4137      build(context, token);4138      return 12;4139    }4140    if(match_ScenarioOutlineLine(context, token)) {4141      endRule(context, 'Description');4142      endRule(context, 'Feature_Header');4143      startRule(context, 'Scenario_Definition');4144      startRule(context, 'ScenarioOutline');4145      build(context, token);4146      return 17;4147    }4148    if(match_Other(context, token)) {4149      build(context, token);4150      return 4;4151    }4152    4153    var stateComment = "State: 4 - GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:1>Description:0>#Other:0";4154    token.detach();4155    var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4156    var error = token.isEof ?4157      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4158      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4159    if (self.stopAtFirstError) throw error;4160    addError(context, error);4161    return 4;4162  }4163  // GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:2>#Comment:04164  function matchTokenAt_5(token, context) {4165    if(match_EOF(context, token)) {4166      endRule(context, 'Feature_Header');4167      endRule(context, 'Feature');4168      build(context, token);4169      return 27;4170    }4171    if(match_Comment(context, token)) {4172      build(context, token);4173      return 5;4174    }4175    if(match_BackgroundLine(context, token)) {4176      endRule(context, 'Feature_Header');4177      startRule(context, 'Background');4178      build(context, token);4179      return 6;4180    }4181    if(match_TagLine(context, token)) {4182      endRule(context, 'Feature_Header');4183      startRule(context, 'Scenario_Definition');4184      startRule(context, 'Tags');4185      build(context, token);4186      return 11;4187    }4188    if(match_ScenarioLine(context, token)) {4189      endRule(context, 'Feature_Header');4190      startRule(context, 'Scenario_Definition');4191      startRule(context, 'Scenario');4192      build(context, token);4193      return 12;4194    }4195    if(match_ScenarioOutlineLine(context, token)) {4196      endRule(context, 'Feature_Header');4197      startRule(context, 'Scenario_Definition');4198      startRule(context, 'ScenarioOutline');4199      build(context, token);4200      return 17;4201    }4202    if(match_Empty(context, token)) {4203      build(context, token);4204      return 5;4205    }4206    4207    var stateComment = "State: 5 - GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:2>#Comment:0";4208    token.detach();4209    var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];4210    var error = token.isEof ?4211      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4212      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4213    if (self.stopAtFirstError) throw error;4214    addError(context, error);4215    return 5;4216  }4217  // GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:04218  function matchTokenAt_6(token, context) {4219    if(match_EOF(context, token)) {4220      endRule(context, 'Background');4221      endRule(context, 'Feature');4222      build(context, token);4223      return 27;4224    }4225    if(match_Empty(context, token)) {4226      build(context, token);4227      return 6;4228    }4229    if(match_Comment(context, token)) {4230      build(context, token);4231      return 8;4232    }4233    if(match_StepLine(context, token)) {4234      startRule(context, 'Step');4235      build(context, token);4236      return 9;4237    }4238    if(match_TagLine(context, token)) {4239      endRule(context, 'Background');4240      startRule(context, 'Scenario_Definition');4241      startRule(context, 'Tags');4242      build(context, token);4243      return 11;4244    }4245    if(match_ScenarioLine(context, token)) {4246      endRule(context, 'Background');4247      startRule(context, 'Scenario_Definition');4248      startRule(context, 'Scenario');4249      build(context, token);4250      return 12;4251    }4252    if(match_ScenarioOutlineLine(context, token)) {4253      endRule(context, 'Background');4254      startRule(context, 'Scenario_Definition');4255      startRule(context, 'ScenarioOutline');4256      build(context, token);4257      return 17;4258    }4259    if(match_Other(context, token)) {4260      startRule(context, 'Description');4261      build(context, token);4262      return 7;4263    }4264    4265    var stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0";4266    token.detach();4267    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4268    var error = token.isEof ?4269      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4270      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4271    if (self.stopAtFirstError) throw error;4272    addError(context, error);4273    return 6;4274  }4275  // GherkinDocument:0>Feature:1>Background:1>Description_Helper:1>Description:0>#Other:04276  function matchTokenAt_7(token, context) {4277    if(match_EOF(context, token)) {4278      endRule(context, 'Description');4279      endRule(context, 'Background');4280      endRule(context, 'Feature');4281      build(context, token);4282      return 27;4283    }4284    if(match_Comment(context, token)) {4285      endRule(context, 'Description');4286      build(context, token);4287      return 8;4288    }4289    if(match_StepLine(context, token)) {4290      endRule(context, 'Description');4291      startRule(context, 'Step');4292      build(context, token);4293      return 9;4294    }4295    if(match_TagLine(context, token)) {4296      endRule(context, 'Description');4297      endRule(context, 'Background');4298      startRule(context, 'Scenario_Definition');4299      startRule(context, 'Tags');4300      build(context, token);4301      return 11;4302    }4303    if(match_ScenarioLine(context, token)) {4304      endRule(context, 'Description');4305      endRule(context, 'Background');4306      startRule(context, 'Scenario_Definition');4307      startRule(context, 'Scenario');4308      build(context, token);4309      return 12;4310    }4311    if(match_ScenarioOutlineLine(context, token)) {4312      endRule(context, 'Description');4313      endRule(context, 'Background');4314      startRule(context, 'Scenario_Definition');4315      startRule(context, 'ScenarioOutline');4316      build(context, token);4317      return 17;4318    }4319    if(match_Other(context, token)) {4320      build(context, token);4321      return 7;4322    }4323    4324    var stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>Description_Helper:1>Description:0>#Other:0";4325    token.detach();4326    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4327    var error = token.isEof ?4328      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4329      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4330    if (self.stopAtFirstError) throw error;4331    addError(context, error);4332    return 7;4333  }4334  // GherkinDocument:0>Feature:1>Background:1>Description_Helper:2>#Comment:04335  function matchTokenAt_8(token, context) {4336    if(match_EOF(context, token)) {4337      endRule(context, 'Background');4338      endRule(context, 'Feature');4339      build(context, token);4340      return 27;4341    }4342    if(match_Comment(context, token)) {4343      build(context, token);4344      return 8;4345    }4346    if(match_StepLine(context, token)) {4347      startRule(context, 'Step');4348      build(context, token);4349      return 9;4350    }4351    if(match_TagLine(context, token)) {4352      endRule(context, 'Background');4353      startRule(context, 'Scenario_Definition');4354      startRule(context, 'Tags');4355      build(context, token);4356      return 11;4357    }4358    if(match_ScenarioLine(context, token)) {4359      endRule(context, 'Background');4360      startRule(context, 'Scenario_Definition');4361      startRule(context, 'Scenario');4362      build(context, token);4363      return 12;4364    }4365    if(match_ScenarioOutlineLine(context, token)) {4366      endRule(context, 'Background');4367      startRule(context, 'Scenario_Definition');4368      startRule(context, 'ScenarioOutline');4369      build(context, token);4370      return 17;4371    }4372    if(match_Empty(context, token)) {4373      build(context, token);4374      return 8;4375    }4376    4377    var stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>Description_Helper:2>#Comment:0";4378    token.detach();4379    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];4380    var error = token.isEof ?4381      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4382      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4383    if (self.stopAtFirstError) throw error;4384    addError(context, error);4385    return 8;4386  }4387  // GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:04388  function matchTokenAt_9(token, context) {4389    if(match_EOF(context, token)) {4390      endRule(context, 'Step');4391      endRule(context, 'Background');4392      endRule(context, 'Feature');4393      build(context, token);4394      return 27;4395    }4396    if(match_TableRow(context, token)) {4397      startRule(context, 'DataTable');4398      build(context, token);4399      return 10;4400    }4401    if(match_DocStringSeparator(context, token)) {4402      startRule(context, 'DocString');4403      build(context, token);4404      return 32;4405    }4406    if(match_StepLine(context, token)) {4407      endRule(context, 'Step');4408      startRule(context, 'Step');4409      build(context, token);4410      return 9;4411    }4412    if(match_TagLine(context, token)) {4413      endRule(context, 'Step');4414      endRule(context, 'Background');4415      startRule(context, 'Scenario_Definition');4416      startRule(context, 'Tags');4417      build(context, token);4418      return 11;4419    }4420    if(match_ScenarioLine(context, token)) {4421      endRule(context, 'Step');4422      endRule(context, 'Background');4423      startRule(context, 'Scenario_Definition');4424      startRule(context, 'Scenario');4425      build(context, token);4426      return 12;4427    }4428    if(match_ScenarioOutlineLine(context, token)) {4429      endRule(context, 'Step');4430      endRule(context, 'Background');4431      startRule(context, 'Scenario_Definition');4432      startRule(context, 'ScenarioOutline');4433      build(context, token);4434      return 17;4435    }4436    if(match_Comment(context, token)) {4437      build(context, token);4438      return 9;4439    }4440    if(match_Empty(context, token)) {4441      build(context, token);4442      return 9;4443    }4444    4445    var stateComment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0";4446    token.detach();4447    var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4448    var error = token.isEof ?4449      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4450      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4451    if (self.stopAtFirstError) throw error;4452    addError(context, error);4453    return 9;4454  }4455  // GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:04456  function matchTokenAt_10(token, context) {4457    if(match_EOF(context, token)) {4458      endRule(context, 'DataTable');4459      endRule(context, 'Step');4460      endRule(context, 'Background');4461      endRule(context, 'Feature');4462      build(context, token);4463      return 27;4464    }4465    if(match_TableRow(context, token)) {4466      build(context, token);4467      return 10;4468    }4469    if(match_StepLine(context, token)) {4470      endRule(context, 'DataTable');4471      endRule(context, 'Step');4472      startRule(context, 'Step');4473      build(context, token);4474      return 9;4475    }4476    if(match_TagLine(context, token)) {4477      endRule(context, 'DataTable');4478      endRule(context, 'Step');4479      endRule(context, 'Background');4480      startRule(context, 'Scenario_Definition');4481      startRule(context, 'Tags');4482      build(context, token);4483      return 11;4484    }4485    if(match_ScenarioLine(context, token)) {4486      endRule(context, 'DataTable');4487      endRule(context, 'Step');4488      endRule(context, 'Background');4489      startRule(context, 'Scenario_Definition');4490      startRule(context, 'Scenario');4491      build(context, token);4492      return 12;4493    }4494    if(match_ScenarioOutlineLine(context, token)) {4495      endRule(context, 'DataTable');4496      endRule(context, 'Step');4497      endRule(context, 'Background');4498      startRule(context, 'Scenario_Definition');4499      startRule(context, 'ScenarioOutline');4500      build(context, token);4501      return 17;4502    }4503    if(match_Comment(context, token)) {4504      build(context, token);4505      return 10;4506    }4507    if(match_Empty(context, token)) {4508      build(context, token);4509      return 10;4510    }4511    4512    var stateComment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";4513    token.detach();4514    var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4515    var error = token.isEof ?4516      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4517      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4518    if (self.stopAtFirstError) throw error;4519    addError(context, error);4520    return 10;4521  }4522  // GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:04523  function matchTokenAt_11(token, context) {4524    if(match_TagLine(context, token)) {4525      build(context, token);4526      return 11;4527    }4528    if(match_ScenarioLine(context, token)) {4529      endRule(context, 'Tags');4530      startRule(context, 'Scenario');4531      build(context, token);4532      return 12;4533    }4534    if(match_ScenarioOutlineLine(context, token)) {4535      endRule(context, 'Tags');4536      startRule(context, 'ScenarioOutline');4537      build(context, token);4538      return 17;4539    }4540    if(match_Comment(context, token)) {4541      build(context, token);4542      return 11;4543    }4544    if(match_Empty(context, token)) {4545      build(context, token);4546      return 11;4547    }4548    4549    var stateComment = "State: 11 - GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0";4550    token.detach();4551    var expectedTokens = ["#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4552    var error = token.isEof ?4553      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4554      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4555    if (self.stopAtFirstError) throw error;4556    addError(context, error);4557    return 11;4558  }4559  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:04560  function matchTokenAt_12(token, context) {4561    if(match_EOF(context, token)) {4562      endRule(context, 'Scenario');4563      endRule(context, 'Scenario_Definition');4564      endRule(context, 'Feature');4565      build(context, token);4566      return 27;4567    }4568    if(match_Empty(context, token)) {4569      build(context, token);4570      return 12;4571    }4572    if(match_Comment(context, token)) {4573      build(context, token);4574      return 14;4575    }4576    if(match_StepLine(context, token)) {4577      startRule(context, 'Step');4578      build(context, token);4579      return 15;4580    }4581    if(match_TagLine(context, token)) {4582      endRule(context, 'Scenario');4583      endRule(context, 'Scenario_Definition');4584      startRule(context, 'Scenario_Definition');4585      startRule(context, 'Tags');4586      build(context, token);4587      return 11;4588    }4589    if(match_ScenarioLine(context, token)) {4590      endRule(context, 'Scenario');4591      endRule(context, 'Scenario_Definition');4592      startRule(context, 'Scenario_Definition');4593      startRule(context, 'Scenario');4594      build(context, token);4595      return 12;4596    }4597    if(match_ScenarioOutlineLine(context, token)) {4598      endRule(context, 'Scenario');4599      endRule(context, 'Scenario_Definition');4600      startRule(context, 'Scenario_Definition');4601      startRule(context, 'ScenarioOutline');4602      build(context, token);4603      return 17;4604    }4605    if(match_Other(context, token)) {4606      startRule(context, 'Description');4607      build(context, token);4608      return 13;4609    }4610    4611    var stateComment = "State: 12 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0";4612    token.detach();4613    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4614    var error = token.isEof ?4615      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4616      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4617    if (self.stopAtFirstError) throw error;4618    addError(context, error);4619    return 12;4620  }4621  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:1>Description:0>#Other:04622  function matchTokenAt_13(token, context) {4623    if(match_EOF(context, token)) {4624      endRule(context, 'Description');4625      endRule(context, 'Scenario');4626      endRule(context, 'Scenario_Definition');4627      endRule(context, 'Feature');4628      build(context, token);4629      return 27;4630    }4631    if(match_Comment(context, token)) {4632      endRule(context, 'Description');4633      build(context, token);4634      return 14;4635    }4636    if(match_StepLine(context, token)) {4637      endRule(context, 'Description');4638      startRule(context, 'Step');4639      build(context, token);4640      return 15;4641    }4642    if(match_TagLine(context, token)) {4643      endRule(context, 'Description');4644      endRule(context, 'Scenario');4645      endRule(context, 'Scenario_Definition');4646      startRule(context, 'Scenario_Definition');4647      startRule(context, 'Tags');4648      build(context, token);4649      return 11;4650    }4651    if(match_ScenarioLine(context, token)) {4652      endRule(context, 'Description');4653      endRule(context, 'Scenario');4654      endRule(context, 'Scenario_Definition');4655      startRule(context, 'Scenario_Definition');4656      startRule(context, 'Scenario');4657      build(context, token);4658      return 12;4659    }4660    if(match_ScenarioOutlineLine(context, token)) {4661      endRule(context, 'Description');4662      endRule(context, 'Scenario');4663      endRule(context, 'Scenario_Definition');4664      startRule(context, 'Scenario_Definition');4665      startRule(context, 'ScenarioOutline');4666      build(context, token);4667      return 17;4668    }4669    if(match_Other(context, token)) {4670      build(context, token);4671      return 13;4672    }4673    4674    var stateComment = "State: 13 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:1>Description:0>#Other:0";4675    token.detach();4676    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4677    var error = token.isEof ?4678      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4679      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4680    if (self.stopAtFirstError) throw error;4681    addError(context, error);4682    return 13;4683  }4684  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:2>#Comment:04685  function matchTokenAt_14(token, context) {4686    if(match_EOF(context, token)) {4687      endRule(context, 'Scenario');4688      endRule(context, 'Scenario_Definition');4689      endRule(context, 'Feature');4690      build(context, token);4691      return 27;4692    }4693    if(match_Comment(context, token)) {4694      build(context, token);4695      return 14;4696    }4697    if(match_StepLine(context, token)) {4698      startRule(context, 'Step');4699      build(context, token);4700      return 15;4701    }4702    if(match_TagLine(context, token)) {4703      endRule(context, 'Scenario');4704      endRule(context, 'Scenario_Definition');4705      startRule(context, 'Scenario_Definition');4706      startRule(context, 'Tags');4707      build(context, token);4708      return 11;4709    }4710    if(match_ScenarioLine(context, token)) {4711      endRule(context, 'Scenario');4712      endRule(context, 'Scenario_Definition');4713      startRule(context, 'Scenario_Definition');4714      startRule(context, 'Scenario');4715      build(context, token);4716      return 12;4717    }4718    if(match_ScenarioOutlineLine(context, token)) {4719      endRule(context, 'Scenario');4720      endRule(context, 'Scenario_Definition');4721      startRule(context, 'Scenario_Definition');4722      startRule(context, 'ScenarioOutline');4723      build(context, token);4724      return 17;4725    }4726    if(match_Empty(context, token)) {4727      build(context, token);4728      return 14;4729    }4730    4731    var stateComment = "State: 14 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:2>#Comment:0";4732    token.detach();4733    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];4734    var error = token.isEof ?4735      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4736      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4737    if (self.stopAtFirstError) throw error;4738    addError(context, error);4739    return 14;4740  }4741  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:0>#StepLine:04742  function matchTokenAt_15(token, context) {4743    if(match_EOF(context, token)) {4744      endRule(context, 'Step');4745      endRule(context, 'Scenario');4746      endRule(context, 'Scenario_Definition');4747      endRule(context, 'Feature');4748      build(context, token);4749      return 27;4750    }4751    if(match_TableRow(context, token)) {4752      startRule(context, 'DataTable');4753      build(context, token);4754      return 16;4755    }4756    if(match_DocStringSeparator(context, token)) {4757      startRule(context, 'DocString');4758      build(context, token);4759      return 30;4760    }4761    if(match_StepLine(context, token)) {4762      endRule(context, 'Step');4763      startRule(context, 'Step');4764      build(context, token);4765      return 15;4766    }4767    if(match_TagLine(context, token)) {4768      endRule(context, 'Step');4769      endRule(context, 'Scenario');4770      endRule(context, 'Scenario_Definition');4771      startRule(context, 'Scenario_Definition');4772      startRule(context, 'Tags');4773      build(context, token);4774      return 11;4775    }4776    if(match_ScenarioLine(context, token)) {4777      endRule(context, 'Step');4778      endRule(context, 'Scenario');4779      endRule(context, 'Scenario_Definition');4780      startRule(context, 'Scenario_Definition');4781      startRule(context, 'Scenario');4782      build(context, token);4783      return 12;4784    }4785    if(match_ScenarioOutlineLine(context, token)) {4786      endRule(context, 'Step');4787      endRule(context, 'Scenario');4788      endRule(context, 'Scenario_Definition');4789      startRule(context, 'Scenario_Definition');4790      startRule(context, 'ScenarioOutline');4791      build(context, token);4792      return 17;4793    }4794    if(match_Comment(context, token)) {4795      build(context, token);4796      return 15;4797    }4798    if(match_Empty(context, token)) {4799      build(context, token);4800      return 15;4801    }4802    4803    var stateComment = "State: 15 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:0>#StepLine:0";4804    token.detach();4805    var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4806    var error = token.isEof ?4807      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4808      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4809    if (self.stopAtFirstError) throw error;4810    addError(context, error);4811    return 15;4812  }4813  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:04814  function matchTokenAt_16(token, context) {4815    if(match_EOF(context, token)) {4816      endRule(context, 'DataTable');4817      endRule(context, 'Step');4818      endRule(context, 'Scenario');4819      endRule(context, 'Scenario_Definition');4820      endRule(context, 'Feature');4821      build(context, token);4822      return 27;4823    }4824    if(match_TableRow(context, token)) {4825      build(context, token);4826      return 16;4827    }4828    if(match_StepLine(context, token)) {4829      endRule(context, 'DataTable');4830      endRule(context, 'Step');4831      startRule(context, 'Step');4832      build(context, token);4833      return 15;4834    }4835    if(match_TagLine(context, token)) {4836      endRule(context, 'DataTable');4837      endRule(context, 'Step');4838      endRule(context, 'Scenario');4839      endRule(context, 'Scenario_Definition');4840      startRule(context, 'Scenario_Definition');4841      startRule(context, 'Tags');4842      build(context, token);4843      return 11;4844    }4845    if(match_ScenarioLine(context, token)) {4846      endRule(context, 'DataTable');4847      endRule(context, 'Step');4848      endRule(context, 'Scenario');4849      endRule(context, 'Scenario_Definition');4850      startRule(context, 'Scenario_Definition');4851      startRule(context, 'Scenario');4852      build(context, token);4853      return 12;4854    }4855    if(match_ScenarioOutlineLine(context, token)) {4856      endRule(context, 'DataTable');4857      endRule(context, 'Step');4858      endRule(context, 'Scenario');4859      endRule(context, 'Scenario_Definition');4860      startRule(context, 'Scenario_Definition');4861      startRule(context, 'ScenarioOutline');4862      build(context, token);4863      return 17;4864    }4865    if(match_Comment(context, token)) {4866      build(context, token);4867      return 16;4868    }4869    if(match_Empty(context, token)) {4870      build(context, token);4871      return 16;4872    }4873    4874    var stateComment = "State: 16 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";4875    token.detach();4876    var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4877    var error = token.isEof ?4878      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4879      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4880    if (self.stopAtFirstError) throw error;4881    addError(context, error);4882    return 16;4883  }4884  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:04885  function matchTokenAt_17(token, context) {4886    if(match_EOF(context, token)) {4887      endRule(context, 'ScenarioOutline');4888      endRule(context, 'Scenario_Definition');4889      endRule(context, 'Feature');4890      build(context, token);4891      return 27;4892    }4893    if(match_Empty(context, token)) {4894      build(context, token);4895      return 17;4896    }4897    if(match_Comment(context, token)) {4898      build(context, token);4899      return 19;4900    }4901    if(match_StepLine(context, token)) {4902      startRule(context, 'Step');4903      build(context, token);4904      return 20;4905    }4906    if(match_TagLine(context, token)) {4907      if(lookahead_0(context, token)) {4908      startRule(context, 'Examples_Definition');4909      startRule(context, 'Tags');4910      build(context, token);4911      return 22;4912      }4913    }4914    if(match_TagLine(context, token)) {4915      endRule(context, 'ScenarioOutline');4916      endRule(context, 'Scenario_Definition');4917      startRule(context, 'Scenario_Definition');4918      startRule(context, 'Tags');4919      build(context, token);4920      return 11;4921    }4922    if(match_ExamplesLine(context, token)) {4923      startRule(context, 'Examples_Definition');4924      startRule(context, 'Examples');4925      build(context, token);4926      return 23;4927    }4928    if(match_ScenarioLine(context, token)) {4929      endRule(context, 'ScenarioOutline');4930      endRule(context, 'Scenario_Definition');4931      startRule(context, 'Scenario_Definition');4932      startRule(context, 'Scenario');4933      build(context, token);4934      return 12;4935    }4936    if(match_ScenarioOutlineLine(context, token)) {4937      endRule(context, 'ScenarioOutline');4938      endRule(context, 'Scenario_Definition');4939      startRule(context, 'Scenario_Definition');4940      startRule(context, 'ScenarioOutline');4941      build(context, token);4942      return 17;4943    }4944    if(match_Other(context, token)) {4945      startRule(context, 'Description');4946      build(context, token);4947      return 18;4948    }4949    4950    var stateComment = "State: 17 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0";4951    token.detach();4952    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4953    var error = token.isEof ?4954      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4955      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4956    if (self.stopAtFirstError) throw error;4957    addError(context, error);4958    return 17;4959  }4960  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:1>Description:0>#Other:04961  function matchTokenAt_18(token, context) {4962    if(match_EOF(context, token)) {4963      endRule(context, 'Description');4964      endRule(context, 'ScenarioOutline');4965      endRule(context, 'Scenario_Definition');4966      endRule(context, 'Feature');4967      build(context, token);4968      return 27;4969    }4970    if(match_Comment(context, token)) {4971      endRule(context, 'Description');4972      build(context, token);4973      return 19;4974    }4975    if(match_StepLine(context, token)) {4976      endRule(context, 'Description');4977      startRule(context, 'Step');4978      build(context, token);4979      return 20;4980    }4981    if(match_TagLine(context, token)) {4982      if(lookahead_0(context, token)) {4983      endRule(context, 'Description');4984      startRule(context, 'Examples_Definition');4985      startRule(context, 'Tags');4986      build(context, token);4987      return 22;4988      }4989    }4990    if(match_TagLine(context, token)) {4991      endRule(context, 'Description');4992      endRule(context, 'ScenarioOutline');4993      endRule(context, 'Scenario_Definition');4994      startRule(context, 'Scenario_Definition');4995      startRule(context, 'Tags');4996      build(context, token);4997      return 11;4998    }4999    if(match_ExamplesLine(context, token)) {5000      endRule(context, 'Description');5001      startRule(context, 'Examples_Definition');5002      startRule(context, 'Examples');5003      build(context, token);5004      return 23;5005    }5006    if(match_ScenarioLine(context, token)) {5007      endRule(context, 'Description');5008      endRule(context, 'ScenarioOutline');5009      endRule(context, 'Scenario_Definition');5010      startRule(context, 'Scenario_Definition');5011      startRule(context, 'Scenario');5012      build(context, token);5013      return 12;5014    }5015    if(match_ScenarioOutlineLine(context, token)) {5016      endRule(context, 'Description');5017      endRule(context, 'ScenarioOutline');5018      endRule(context, 'Scenario_Definition');5019      startRule(context, 'Scenario_Definition');5020      startRule(context, 'ScenarioOutline');5021      build(context, token);5022      return 17;5023    }5024    if(match_Other(context, token)) {5025      build(context, token);5026      return 18;5027    }5028    5029    var stateComment = "State: 18 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:1>Description:0>#Other:0";5030    token.detach();5031    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];5032    var error = token.isEof ?5033      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5034      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5035    if (self.stopAtFirstError) throw error;5036    addError(context, error);5037    return 18;5038  }5039  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:2>#Comment:05040  function matchTokenAt_19(token, context) {5041    if(match_EOF(context, token)) {5042      endRule(context, 'ScenarioOutline');5043      endRule(context, 'Scenario_Definition');5044      endRule(context, 'Feature');5045      build(context, token);5046      return 27;5047    }5048    if(match_Comment(context, token)) {5049      build(context, token);5050      return 19;5051    }5052    if(match_StepLine(context, token)) {5053      startRule(context, 'Step');5054      build(context, token);5055      return 20;5056    }5057    if(match_TagLine(context, token)) {5058      if(lookahead_0(context, token)) {5059      startRule(context, 'Examples_Definition');5060      startRule(context, 'Tags');5061      build(context, token);5062      return 22;5063      }5064    }5065    if(match_TagLine(context, token)) {5066      endRule(context, 'ScenarioOutline');5067      endRule(context, 'Scenario_Definition');5068      startRule(context, 'Scenario_Definition');5069      startRule(context, 'Tags');5070      build(context, token);5071      return 11;5072    }5073    if(match_ExamplesLine(context, token)) {5074      startRule(context, 'Examples_Definition');5075      startRule(context, 'Examples');5076      build(context, token);5077      return 23;5078    }5079    if(match_ScenarioLine(context, token)) {5080      endRule(context, 'ScenarioOutline');5081      endRule(context, 'Scenario_Definition');5082      startRule(context, 'Scenario_Definition');5083      startRule(context, 'Scenario');5084      build(context, token);5085      return 12;5086    }5087    if(match_ScenarioOutlineLine(context, token)) {5088      endRule(context, 'ScenarioOutline');5089      endRule(context, 'Scenario_Definition');5090      startRule(context, 'Scenario_Definition');5091      startRule(context, 'ScenarioOutline');5092      build(context, token);5093      return 17;5094    }5095    if(match_Empty(context, token)) {5096      build(context, token);5097      return 19;5098    }5099    5100    var stateComment = "State: 19 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:2>#Comment:0";5101    token.detach();5102    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];5103    var error = token.isEof ?5104      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5105      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5106    if (self.stopAtFirstError) throw error;5107    addError(context, error);5108    return 19;5109  }5110  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:0>#StepLine:05111  function matchTokenAt_20(token, context) {5112    if(match_EOF(context, token)) {5113      endRule(context, 'Step');5114      endRule(context, 'ScenarioOutline');5115      endRule(context, 'Scenario_Definition');5116      endRule(context, 'Feature');5117      build(context, token);5118      return 27;5119    }5120    if(match_TableRow(context, token)) {5121      startRule(context, 'DataTable');5122      build(context, token);5123      return 21;5124    }5125    if(match_DocStringSeparator(context, token)) {5126      startRule(context, 'DocString');5127      build(context, token);5128      return 28;5129    }5130    if(match_StepLine(context, token)) {5131      endRule(context, 'Step');5132      startRule(context, 'Step');5133      build(context, token);5134      return 20;5135    }5136    if(match_TagLine(context, token)) {5137      if(lookahead_0(context, token)) {5138      endRule(context, 'Step');5139      startRule(context, 'Examples_Definition');5140      startRule(context, 'Tags');5141      build(context, token);5142      return 22;5143      }5144    }5145    if(match_TagLine(context, token)) {5146      endRule(context, 'Step');5147      endRule(context, 'ScenarioOutline');5148      endRule(context, 'Scenario_Definition');5149      startRule(context, 'Scenario_Definition');5150      startRule(context, 'Tags');5151      build(context, token);5152      return 11;5153    }5154    if(match_ExamplesLine(context, token)) {5155      endRule(context, 'Step');5156      startRule(context, 'Examples_Definition');5157      startRule(context, 'Examples');5158      build(context, token);5159      return 23;5160    }5161    if(match_ScenarioLine(context, token)) {5162      endRule(context, 'Step');5163      endRule(context, 'ScenarioOutline');5164      endRule(context, 'Scenario_Definition');5165      startRule(context, 'Scenario_Definition');5166      startRule(context, 'Scenario');5167      build(context, token);5168      return 12;5169    }5170    if(match_ScenarioOutlineLine(context, token)) {5171      endRule(context, 'Step');5172      endRule(context, 'ScenarioOutline');5173      endRule(context, 'Scenario_Definition');5174      startRule(context, 'Scenario_Definition');5175      startRule(context, 'ScenarioOutline');5176      build(context, token);5177      return 17;5178    }5179    if(match_Comment(context, token)) {5180      build(context, token);5181      return 20;5182    }5183    if(match_Empty(context, token)) {5184      build(context, token);5185      return 20;5186    }5187    5188    var stateComment = "State: 20 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:0>#StepLine:0";5189    token.detach();5190    var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5191    var error = token.isEof ?5192      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5193      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5194    if (self.stopAtFirstError) throw error;5195    addError(context, error);5196    return 20;5197  }5198  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:05199  function matchTokenAt_21(token, context) {5200    if(match_EOF(context, token)) {5201      endRule(context, 'DataTable');5202      endRule(context, 'Step');5203      endRule(context, 'ScenarioOutline');5204      endRule(context, 'Scenario_Definition');5205      endRule(context, 'Feature');5206      build(context, token);5207      return 27;5208    }5209    if(match_TableRow(context, token)) {5210      build(context, token);5211      return 21;5212    }5213    if(match_StepLine(context, token)) {5214      endRule(context, 'DataTable');5215      endRule(context, 'Step');5216      startRule(context, 'Step');5217      build(context, token);5218      return 20;5219    }5220    if(match_TagLine(context, token)) {5221      if(lookahead_0(context, token)) {5222      endRule(context, 'DataTable');5223      endRule(context, 'Step');5224      startRule(context, 'Examples_Definition');5225      startRule(context, 'Tags');5226      build(context, token);5227      return 22;5228      }5229    }5230    if(match_TagLine(context, token)) {5231      endRule(context, 'DataTable');5232      endRule(context, 'Step');5233      endRule(context, 'ScenarioOutline');5234      endRule(context, 'Scenario_Definition');5235      startRule(context, 'Scenario_Definition');5236      startRule(context, 'Tags');5237      build(context, token);5238      return 11;5239    }5240    if(match_ExamplesLine(context, token)) {5241      endRule(context, 'DataTable');5242      endRule(context, 'Step');5243      startRule(context, 'Examples_Definition');5244      startRule(context, 'Examples');5245      build(context, token);5246      return 23;5247    }5248    if(match_ScenarioLine(context, token)) {5249      endRule(context, 'DataTable');5250      endRule(context, 'Step');5251      endRule(context, 'ScenarioOutline');5252      endRule(context, 'Scenario_Definition');5253      startRule(context, 'Scenario_Definition');5254      startRule(context, 'Scenario');5255      build(context, token);5256      return 12;5257    }5258    if(match_ScenarioOutlineLine(context, token)) {5259      endRule(context, 'DataTable');5260      endRule(context, 'Step');5261      endRule(context, 'ScenarioOutline');5262      endRule(context, 'Scenario_Definition');5263      startRule(context, 'Scenario_Definition');5264      startRule(context, 'ScenarioOutline');5265      build(context, token);5266      return 17;5267    }5268    if(match_Comment(context, token)) {5269      build(context, token);5270      return 21;5271    }5272    if(match_Empty(context, token)) {5273      build(context, token);5274      return 21;5275    }5276    5277    var stateComment = "State: 21 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";5278    token.detach();5279    var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5280    var error = token.isEof ?5281      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5282      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5283    if (self.stopAtFirstError) throw error;5284    addError(context, error);5285    return 21;5286  }5287  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:05288  function matchTokenAt_22(token, context) {5289    if(match_TagLine(context, token)) {5290      build(context, token);5291      return 22;5292    }5293    if(match_ExamplesLine(context, token)) {5294      endRule(context, 'Tags');5295      startRule(context, 'Examples');5296      build(context, token);5297      return 23;5298    }5299    if(match_Comment(context, token)) {5300      build(context, token);5301      return 22;5302    }5303    if(match_Empty(context, token)) {5304      build(context, token);5305      return 22;5306    }5307    5308    var stateComment = "State: 22 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0";5309    token.detach();5310    var expectedTokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"];5311    var error = token.isEof ?5312      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5313      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5314    if (self.stopAtFirstError) throw error;5315    addError(context, error);5316    return 22;5317  }5318  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:05319  function matchTokenAt_23(token, context) {5320    if(match_EOF(context, token)) {5321      endRule(context, 'Examples');5322      endRule(context, 'Examples_Definition');5323      endRule(context, 'ScenarioOutline');5324      endRule(context, 'Scenario_Definition');5325      endRule(context, 'Feature');5326      build(context, token);5327      return 27;5328    }5329    if(match_Empty(context, token)) {5330      build(context, token);5331      return 23;5332    }5333    if(match_Comment(context, token)) {5334      build(context, token);5335      return 25;5336    }5337    if(match_TableRow(context, token)) {5338      startRule(context, 'Examples_Table');5339      build(context, token);5340      return 26;5341    }5342    if(match_TagLine(context, token)) {5343      if(lookahead_0(context, token)) {5344      endRule(context, 'Examples');5345      endRule(context, 'Examples_Definition');5346      startRule(context, 'Examples_Definition');5347      startRule(context, 'Tags');5348      build(context, token);5349      return 22;5350      }5351    }5352    if(match_TagLine(context, token)) {5353      endRule(context, 'Examples');5354      endRule(context, 'Examples_Definition');5355      endRule(context, 'ScenarioOutline');5356      endRule(context, 'Scenario_Definition');5357      startRule(context, 'Scenario_Definition');5358      startRule(context, 'Tags');5359      build(context, token);5360      return 11;5361    }5362    if(match_ExamplesLine(context, token)) {5363      endRule(context, 'Examples');5364      endRule(context, 'Examples_Definition');5365      startRule(context, 'Examples_Definition');5366      startRule(context, 'Examples');5367      build(context, token);5368      return 23;5369    }5370    if(match_ScenarioLine(context, token)) {5371      endRule(context, 'Examples');5372      endRule(context, 'Examples_Definition');5373      endRule(context, 'ScenarioOutline');5374      endRule(context, 'Scenario_Definition');5375      startRule(context, 'Scenario_Definition');5376      startRule(context, 'Scenario');5377      build(context, token);5378      return 12;5379    }5380    if(match_ScenarioOutlineLine(context, token)) {5381      endRule(context, 'Examples');5382      endRule(context, 'Examples_Definition');5383      endRule(context, 'ScenarioOutline');5384      endRule(context, 'Scenario_Definition');5385      startRule(context, 'Scenario_Definition');5386      startRule(context, 'ScenarioOutline');5387      build(context, token);5388      return 17;5389    }5390    if(match_Other(context, token)) {5391      startRule(context, 'Description');5392      build(context, token);5393      return 24;5394    }5395    5396    var stateComment = "State: 23 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0";5397    token.detach();5398    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];5399    var error = token.isEof ?5400      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5401      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5402    if (self.stopAtFirstError) throw error;5403    addError(context, error);5404    return 23;5405  }5406  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:1>Description:0>#Other:05407  function matchTokenAt_24(token, context) {5408    if(match_EOF(context, token)) {5409      endRule(context, 'Description');5410      endRule(context, 'Examples');5411      endRule(context, 'Examples_Definition');5412      endRule(context, 'ScenarioOutline');5413      endRule(context, 'Scenario_Definition');5414      endRule(context, 'Feature');5415      build(context, token);5416      return 27;5417    }5418    if(match_Comment(context, token)) {5419      endRule(context, 'Description');5420      build(context, token);5421      return 25;5422    }5423    if(match_TableRow(context, token)) {5424      endRule(context, 'Description');5425      startRule(context, 'Examples_Table');5426      build(context, token);5427      return 26;5428    }5429    if(match_TagLine(context, token)) {5430      if(lookahead_0(context, token)) {5431      endRule(context, 'Description');5432      endRule(context, 'Examples');5433      endRule(context, 'Examples_Definition');5434      startRule(context, 'Examples_Definition');5435      startRule(context, 'Tags');5436      build(context, token);5437      return 22;5438      }5439    }5440    if(match_TagLine(context, token)) {5441      endRule(context, 'Description');5442      endRule(context, 'Examples');5443      endRule(context, 'Examples_Definition');5444      endRule(context, 'ScenarioOutline');5445      endRule(context, 'Scenario_Definition');5446      startRule(context, 'Scenario_Definition');5447      startRule(context, 'Tags');5448      build(context, token);5449      return 11;5450    }5451    if(match_ExamplesLine(context, token)) {5452      endRule(context, 'Description');5453      endRule(context, 'Examples');5454      endRule(context, 'Examples_Definition');5455      startRule(context, 'Examples_Definition');5456      startRule(context, 'Examples');5457      build(context, token);5458      return 23;5459    }5460    if(match_ScenarioLine(context, token)) {5461      endRule(context, 'Description');5462      endRule(context, 'Examples');5463      endRule(context, 'Examples_Definition');5464      endRule(context, 'ScenarioOutline');5465      endRule(context, 'Scenario_Definition');5466      startRule(context, 'Scenario_Definition');5467      startRule(context, 'Scenario');5468      build(context, token);5469      return 12;5470    }5471    if(match_ScenarioOutlineLine(context, token)) {5472      endRule(context, 'Description');5473      endRule(context, 'Examples');5474      endRule(context, 'Examples_Definition');5475      endRule(context, 'ScenarioOutline');5476      endRule(context, 'Scenario_Definition');5477      startRule(context, 'Scenario_Definition');5478      startRule(context, 'ScenarioOutline');5479      build(context, token);5480      return 17;5481    }5482    if(match_Other(context, token)) {5483      build(context, token);5484      return 24;5485    }5486    5487    var stateComment = "State: 24 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:1>Description:0>#Other:0";5488    token.detach();5489    var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];5490    var error = token.isEof ?5491      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5492      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5493    if (self.stopAtFirstError) throw error;5494    addError(context, error);5495    return 24;5496  }5497  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:2>#Comment:05498  function matchTokenAt_25(token, context) {5499    if(match_EOF(context, token)) {5500      endRule(context, 'Examples');5501      endRule(context, 'Examples_Definition');5502      endRule(context, 'ScenarioOutline');5503      endRule(context, 'Scenario_Definition');5504      endRule(context, 'Feature');5505      build(context, token);5506      return 27;5507    }5508    if(match_Comment(context, token)) {5509      build(context, token);5510      return 25;5511    }5512    if(match_TableRow(context, token)) {5513      startRule(context, 'Examples_Table');5514      build(context, token);5515      return 26;5516    }5517    if(match_TagLine(context, token)) {5518      if(lookahead_0(context, token)) {5519      endRule(context, 'Examples');5520      endRule(context, 'Examples_Definition');5521      startRule(context, 'Examples_Definition');5522      startRule(context, 'Tags');5523      build(context, token);5524      return 22;5525      }5526    }5527    if(match_TagLine(context, token)) {5528      endRule(context, 'Examples');5529      endRule(context, 'Examples_Definition');5530      endRule(context, 'ScenarioOutline');5531      endRule(context, 'Scenario_Definition');5532      startRule(context, 'Scenario_Definition');5533      startRule(context, 'Tags');5534      build(context, token);5535      return 11;5536    }5537    if(match_ExamplesLine(context, token)) {5538      endRule(context, 'Examples');5539      endRule(context, 'Examples_Definition');5540      startRule(context, 'Examples_Definition');5541      startRule(context, 'Examples');5542      build(context, token);5543      return 23;5544    }5545    if(match_ScenarioLine(context, token)) {5546      endRule(context, 'Examples');5547      endRule(context, 'Examples_Definition');5548      endRule(context, 'ScenarioOutline');5549      endRule(context, 'Scenario_Definition');5550      startRule(context, 'Scenario_Definition');5551      startRule(context, 'Scenario');5552      build(context, token);5553      return 12;5554    }5555    if(match_ScenarioOutlineLine(context, token)) {5556      endRule(context, 'Examples');5557      endRule(context, 'Examples_Definition');5558      endRule(context, 'ScenarioOutline');5559      endRule(context, 'Scenario_Definition');5560      startRule(context, 'Scenario_Definition');5561      startRule(context, 'ScenarioOutline');5562      build(context, token);5563      return 17;5564    }5565    if(match_Empty(context, token)) {5566      build(context, token);5567      return 25;5568    }5569    5570    var stateComment = "State: 25 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:2>#Comment:0";5571    token.detach();5572    var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];5573    var error = token.isEof ?5574      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5575      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5576    if (self.stopAtFirstError) throw error;5577    addError(context, error);5578    return 25;5579  }5580  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:05581  function matchTokenAt_26(token, context) {5582    if(match_EOF(context, token)) {5583      endRule(context, 'Examples_Table');5584      endRule(context, 'Examples');5585      endRule(context, 'Examples_Definition');5586      endRule(context, 'ScenarioOutline');5587      endRule(context, 'Scenario_Definition');5588      endRule(context, 'Feature');5589      build(context, token);5590      return 27;5591    }5592    if(match_TableRow(context, token)) {5593      build(context, token);5594      return 26;5595    }5596    if(match_TagLine(context, token)) {5597      if(lookahead_0(context, token)) {5598      endRule(context, 'Examples_Table');5599      endRule(context, 'Examples');5600      endRule(context, 'Examples_Definition');5601      startRule(context, 'Examples_Definition');5602      startRule(context, 'Tags');5603      build(context, token);5604      return 22;5605      }5606    }5607    if(match_TagLine(context, token)) {5608      endRule(context, 'Examples_Table');5609      endRule(context, 'Examples');5610      endRule(context, 'Examples_Definition');5611      endRule(context, 'ScenarioOutline');5612      endRule(context, 'Scenario_Definition');5613      startRule(context, 'Scenario_Definition');5614      startRule(context, 'Tags');5615      build(context, token);5616      return 11;5617    }5618    if(match_ExamplesLine(context, token)) {5619      endRule(context, 'Examples_Table');5620      endRule(context, 'Examples');5621      endRule(context, 'Examples_Definition');5622      startRule(context, 'Examples_Definition');5623      startRule(context, 'Examples');5624      build(context, token);5625      return 23;5626    }5627    if(match_ScenarioLine(context, token)) {5628      endRule(context, 'Examples_Table');5629      endRule(context, 'Examples');5630      endRule(context, 'Examples_Definition');5631      endRule(context, 'ScenarioOutline');5632      endRule(context, 'Scenario_Definition');5633      startRule(context, 'Scenario_Definition');5634      startRule(context, 'Scenario');5635      build(context, token);5636      return 12;5637    }5638    if(match_ScenarioOutlineLine(context, token)) {5639      endRule(context, 'Examples_Table');5640      endRule(context, 'Examples');5641      endRule(context, 'Examples_Definition');5642      endRule(context, 'ScenarioOutline');5643      endRule(context, 'Scenario_Definition');5644      startRule(context, 'Scenario_Definition');5645      startRule(context, 'ScenarioOutline');5646      build(context, token);5647      return 17;5648    }5649    if(match_Comment(context, token)) {5650      build(context, token);5651      return 26;5652    }5653    if(match_Empty(context, token)) {5654      build(context, token);5655      return 26;5656    }5657    5658    var stateComment = "State: 26 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0";5659    token.detach();5660    var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5661    var error = token.isEof ?5662      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5663      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5664    if (self.stopAtFirstError) throw error;5665    addError(context, error);5666    return 26;5667  }5668  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:05669  function matchTokenAt_28(token, context) {5670    if(match_DocStringSeparator(context, token)) {5671      build(context, token);5672      return 29;5673    }5674    if(match_Other(context, token)) {5675      build(context, token);5676      return 28;5677    }5678    5679    var stateComment = "State: 28 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";5680    token.detach();5681    var expectedTokens = ["#DocStringSeparator", "#Other"];5682    var error = token.isEof ?5683      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5684      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5685    if (self.stopAtFirstError) throw error;5686    addError(context, error);5687    return 28;5688  }5689  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:05690  function matchTokenAt_29(token, context) {5691    if(match_EOF(context, token)) {5692      endRule(context, 'DocString');5693      endRule(context, 'Step');5694      endRule(context, 'ScenarioOutline');5695      endRule(context, 'Scenario_Definition');5696      endRule(context, 'Feature');5697      build(context, token);5698      return 27;5699    }5700    if(match_StepLine(context, token)) {5701      endRule(context, 'DocString');5702      endRule(context, 'Step');5703      startRule(context, 'Step');5704      build(context, token);5705      return 20;5706    }5707    if(match_TagLine(context, token)) {5708      if(lookahead_0(context, token)) {5709      endRule(context, 'DocString');5710      endRule(context, 'Step');5711      startRule(context, 'Examples_Definition');5712      startRule(context, 'Tags');5713      build(context, token);5714      return 22;5715      }5716    }5717    if(match_TagLine(context, token)) {5718      endRule(context, 'DocString');5719      endRule(context, 'Step');5720      endRule(context, 'ScenarioOutline');5721      endRule(context, 'Scenario_Definition');5722      startRule(context, 'Scenario_Definition');5723      startRule(context, 'Tags');5724      build(context, token);5725      return 11;5726    }5727    if(match_ExamplesLine(context, token)) {5728      endRule(context, 'DocString');5729      endRule(context, 'Step');5730      startRule(context, 'Examples_Definition');5731      startRule(context, 'Examples');5732      build(context, token);5733      return 23;5734    }5735    if(match_ScenarioLine(context, token)) {5736      endRule(context, 'DocString');5737      endRule(context, 'Step');5738      endRule(context, 'ScenarioOutline');5739      endRule(context, 'Scenario_Definition');5740      startRule(context, 'Scenario_Definition');5741      startRule(context, 'Scenario');5742      build(context, token);5743      return 12;5744    }5745    if(match_ScenarioOutlineLine(context, token)) {5746      endRule(context, 'DocString');5747      endRule(context, 'Step');5748      endRule(context, 'ScenarioOutline');5749      endRule(context, 'Scenario_Definition');5750      startRule(context, 'Scenario_Definition');5751      startRule(context, 'ScenarioOutline');5752      build(context, token);5753      return 17;5754    }5755    if(match_Comment(context, token)) {5756      build(context, token);5757      return 29;5758    }5759    if(match_Empty(context, token)) {5760      build(context, token);5761      return 29;5762    }5763    5764    var stateComment = "State: 29 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";5765    token.detach();5766    var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5767    var error = token.isEof ?5768      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5769      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5770    if (self.stopAtFirstError) throw error;5771    addError(context, error);5772    return 29;5773  }5774  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:05775  function matchTokenAt_30(token, context) {5776    if(match_DocStringSeparator(context, token)) {5777      build(context, token);5778      return 31;5779    }5780    if(match_Other(context, token)) {5781      build(context, token);5782      return 30;5783    }5784    5785    var stateComment = "State: 30 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";5786    token.detach();5787    var expectedTokens = ["#DocStringSeparator", "#Other"];5788    var error = token.isEof ?5789      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5790      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5791    if (self.stopAtFirstError) throw error;5792    addError(context, error);5793    return 30;5794  }5795  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:05796  function matchTokenAt_31(token, context) {5797    if(match_EOF(context, token)) {5798      endRule(context, 'DocString');5799      endRule(context, 'Step');5800      endRule(context, 'Scenario');5801      endRule(context, 'Scenario_Definition');5802      endRule(context, 'Feature');5803      build(context, token);5804      return 27;5805    }5806    if(match_StepLine(context, token)) {5807      endRule(context, 'DocString');5808      endRule(context, 'Step');5809      startRule(context, 'Step');5810      build(context, token);5811      return 15;5812    }5813    if(match_TagLine(context, token)) {5814      endRule(context, 'DocString');5815      endRule(context, 'Step');5816      endRule(context, 'Scenario');5817      endRule(context, 'Scenario_Definition');5818      startRule(context, 'Scenario_Definition');5819      startRule(context, 'Tags');5820      build(context, token);5821      return 11;5822    }5823    if(match_ScenarioLine(context, token)) {5824      endRule(context, 'DocString');5825      endRule(context, 'Step');5826      endRule(context, 'Scenario');5827      endRule(context, 'Scenario_Definition');5828      startRule(context, 'Scenario_Definition');5829      startRule(context, 'Scenario');5830      build(context, token);5831      return 12;5832    }5833    if(match_ScenarioOutlineLine(context, token)) {5834      endRule(context, 'DocString');5835      endRule(context, 'Step');5836      endRule(context, 'Scenario');5837      endRule(context, 'Scenario_Definition');5838      startRule(context, 'Scenario_Definition');5839      startRule(context, 'ScenarioOutline');5840      build(context, token);5841      return 17;5842    }5843    if(match_Comment(context, token)) {5844      build(context, token);5845      return 31;5846    }5847    if(match_Empty(context, token)) {5848      build(context, token);5849      return 31;5850    }5851    5852    var stateComment = "State: 31 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";5853    token.detach();5854    var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5855    var error = token.isEof ?5856      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5857      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5858    if (self.stopAtFirstError) throw error;5859    addError(context, error);5860    return 31;5861  }5862  // GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:05863  function matchTokenAt_32(token, context) {5864    if(match_DocStringSeparator(context, token)) {5865      build(context, token);5866      return 33;5867    }5868    if(match_Other(context, token)) {5869      build(context, token);5870      return 32;5871    }5872    5873    var stateComment = "State: 32 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";5874    token.detach();5875    var expectedTokens = ["#DocStringSeparator", "#Other"];5876    var error = token.isEof ?5877      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5878      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5879    if (self.stopAtFirstError) throw error;5880    addError(context, error);5881    return 32;5882  }5883  // GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:05884  function matchTokenAt_33(token, context) {5885    if(match_EOF(context, token)) {5886      endRule(context, 'DocString');5887      endRule(context, 'Step');5888      endRule(context, 'Background');5889      endRule(context, 'Feature');5890      build(context, token);5891      return 27;5892    }5893    if(match_StepLine(context, token)) {5894      endRule(context, 'DocString');5895      endRule(context, 'Step');5896      startRule(context, 'Step');5897      build(context, token);5898      return 9;5899    }5900    if(match_TagLine(context, token)) {5901      endRule(context, 'DocString');5902      endRule(context, 'Step');5903      endRule(context, 'Background');5904      startRule(context, 'Scenario_Definition');5905      startRule(context, 'Tags');5906      build(context, token);5907      return 11;5908    }5909    if(match_ScenarioLine(context, token)) {5910      endRule(context, 'DocString');5911      endRule(context, 'Step');5912      endRule(context, 'Background');5913      startRule(context, 'Scenario_Definition');5914      startRule(context, 'Scenario');5915      build(context, token);5916      return 12;5917    }5918    if(match_ScenarioOutlineLine(context, token)) {5919      endRule(context, 'DocString');5920      endRule(context, 'Step');5921      endRule(context, 'Background');5922      startRule(context, 'Scenario_Definition');5923      startRule(context, 'ScenarioOutline');5924      build(context, token);5925      return 17;5926    }5927    if(match_Comment(context, token)) {5928      build(context, token);5929      return 33;5930    }5931    if(match_Empty(context, token)) {5932      build(context, token);5933      return 33;5934    }5935    5936    var stateComment = "State: 33 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";5937    token.detach();5938    var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5939    var error = token.isEof ?5940      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5941      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5942    if (self.stopAtFirstError) throw error;5943    addError(context, error);5944    return 33;5945  }5946  function match_EOF(context, token) {5947    return handleExternalError(context, false, function () {5948      return context.tokenMatcher.match_EOF(token);5949    });5950  }5951  function match_Empty(context, token) {5952    if(token.isEof) return false;5953    return handleExternalError(context, false, function () {5954      return context.tokenMatcher.match_Empty(token);5955    });5956  }5957  function match_Comment(context, token) {5958    if(token.isEof) return false;5959    return handleExternalError(context, false, function () {5960      return context.tokenMatcher.match_Comment(token);5961    });5962  }5963  function match_TagLine(context, token) {5964    if(token.isEof) return false;5965    return handleExternalError(context, false, function () {5966      return context.tokenMatcher.match_TagLine(token);5967    });5968  }5969  function match_FeatureLine(context, token) {5970    if(token.isEof) return false;5971    return handleExternalError(context, false, function () {5972      return context.tokenMatcher.match_FeatureLine(token);5973    });5974  }5975  function match_BackgroundLine(context, token) {5976    if(token.isEof) return false;5977    return handleExternalError(context, false, function () {5978      return context.tokenMatcher.match_BackgroundLine(token);5979    });5980  }5981  function match_ScenarioLine(context, token) {5982    if(token.isEof) return false;5983    return handleExternalError(context, false, function () {5984      return context.tokenMatcher.match_ScenarioLine(token);5985    });5986  }5987  function match_ScenarioOutlineLine(context, token) {5988    if(token.isEof) return false;5989    return handleExternalError(context, false, function () {5990      return context.tokenMatcher.match_ScenarioOutlineLine(token);5991    });5992  }5993  function match_ExamplesLine(context, token) {5994    if(token.isEof) return false;5995    return handleExternalError(context, false, function () {5996      return context.tokenMatcher.match_ExamplesLine(token);5997    });5998  }5999  function match_StepLine(context, token) {6000    if(token.isEof) return false;6001    return handleExternalError(context, false, function () {6002      return context.tokenMatcher.match_StepLine(token);6003    });6004  }6005  function match_DocStringSeparator(context, token) {6006    if(token.isEof) return false;6007    return handleExternalError(context, false, function () {6008      return context.tokenMatcher.match_DocStringSeparator(token);6009    });6010  }6011  function match_TableRow(context, token) {6012    if(token.isEof) return false;6013    return handleExternalError(context, false, function () {6014      return context.tokenMatcher.match_TableRow(token);6015    });6016  }6017  function match_Language(context, token) {6018    if(token.isEof) return false;6019    return handleExternalError(context, false, function () {6020      return context.tokenMatcher.match_Language(token);6021    });6022  }6023  function match_Other(context, token) {6024    if(token.isEof) return false;6025    return handleExternalError(context, false, function () {6026      return context.tokenMatcher.match_Other(token);6027    });6028  }6029  function lookahead_0(context, currentToken) {6030    currentToken.detach();6031    var token;6032    var queue = [];6033    var match = false;6034    do {6035      token = readToken(context);6036      token.detach();6037      queue.push(token);6038      if (false  || match_ExamplesLine(context, token)) {6039        match = true;6040        break;6041      }6042    } while(false  || match_Empty(context, token) || match_Comment(context, token) || match_TagLine(context, token));6043    context.tokenQueue = context.tokenQueue.concat(queue);6044    return match;6045  }6046}6047},{"./ast_builder":2,"./errors":6,"./token_matcher":13,"./token_scanner":14}],11:[function(require,module,exports){6048var countSymbols = require('../count_symbols');6049function Compiler() {6050  this.compile = function (gherkin_document) {6051    var pickles = [];6052    if (gherkin_document.feature == null) return pickles;6053    var feature = gherkin_document.feature;6054    var language = feature.language;6055    var featureTags = feature.tags;6056    var backgroundSteps = [];6057    feature.children.forEach(function (scenarioDefinition) {6058      if(scenarioDefinition.type === 'Background') {6059        backgroundSteps = pickleSteps(scenarioDefinition);6060      } else if(scenarioDefinition.type === 'Scenario') {6061        compileScenario(featureTags, backgroundSteps, scenarioDefinition, language, pickles);6062      } else {6063        compileScenarioOutline(featureTags, backgroundSteps, scenarioDefinition, language, pickles);6064      }6065    });6066    return pickles;6067  };6068  function compileScenario(featureTags, backgroundSteps, scenario, language, pickles) {6069    var steps = scenario.steps.length == 0 ? [] : [].concat(backgroundSteps);6070    var tags = [].concat(featureTags).concat(scenario.tags);6071    scenario.steps.forEach(function (step) {6072      steps.push(pickleStep(step));6073    });6074    var pickle = {6075      tags: pickleTags(tags),6076      name: scenario.name,6077      language: language,6078      locations: [pickleLocation(scenario.location)],6079      steps: steps6080    };6081    pickles.push(pickle);6082  }6083  function compileScenarioOutline(featureTags, backgroundSteps, scenarioOutline, language, pickles) {6084    scenarioOutline.examples.filter(function(e) { return e.tableHeader != undefined; }).forEach(function (examples) {6085      var variableCells = examples.tableHeader.cells;6086      examples.tableBody.forEach(function (values) {6087        var valueCells = values.cells;6088        var steps = scenarioOutline.steps.length == 0 ? [] : [].concat(backgroundSteps);6089        var tags = [].concat(featureTags).concat(scenarioOutline.tags).concat(examples.tags);6090        scenarioOutline.steps.forEach(function (scenarioOutlineStep) {6091          var stepText = interpolate(scenarioOutlineStep.text, variableCells, valueCells);6092          var args = createPickleArguments(scenarioOutlineStep.argument, variableCells, valueCells);6093          var pickleStep = {6094            text: stepText,6095            arguments: args,6096            locations: [6097              pickleLocation(values.location),6098              pickleStepLocation(scenarioOutlineStep)6099            ]6100          };6101          steps.push(pickleStep);6102        });6103        var pickle = {6104          name: interpolate(scenarioOutline.name, variableCells, valueCells),6105          language: language,6106          steps: steps,6107          tags: pickleTags(tags),6108          locations: [6109            pickleLocation(values.location),6110            pickleLocation(scenarioOutline.location)6111          ]6112        };6113        pickles.push(pickle);6114      });6115    });6116  }6117  function createPickleArguments(argument, variableCells, valueCells) {6118    var result = [];6119    if (!argument) return result;6120    if (argument.type === 'DataTable') {6121      var table = {6122        rows: argument.rows.map(function (row) {6123          return {6124            cells: row.cells.map(function (cell) {6125              return {6126                location: pickleLocation(cell.location),6127                value: interpolate(cell.value, variableCells, valueCells)6128              };6129            })6130          };6131        })6132      };6133      result.push(table);6134    } else if (argument.type === 'DocString') {6135      var docString = {6136        location: pickleLocation(argument.location),6137        content: interpolate(argument.content, variableCells, valueCells),6138      };6139      if(argument.contentType) {6140        docString.contentType = interpolate(argument.contentType, variableCells, valueCells);6141      }6142      result.push(docString);6143    } else {6144      throw Error('Internal error');6145    }6146    return result;6147  }6148  function interpolate(name, variableCells, valueCells) {6149    variableCells.forEach(function (variableCell, n) {6150      var valueCell = valueCells[n];6151      var search = new RegExp('<' + variableCell.value + '>', 'g');6152      // JS Specific - dollar sign needs to be escaped with another dollar sign6153      // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter6154      var replacement = valueCell.value.replace(new RegExp('\\$', 'g'), '$$$$')6155      name = name.replace(search, replacement);6156    });6157    return name;6158  }6159  function pickleSteps(scenarioDefinition) {6160    return scenarioDefinition.steps.map(function (step) {6161      return pickleStep(step);6162    });6163  }6164  function pickleStep(step) {6165    return {6166      text: step.text,6167      arguments: createPickleArguments(step.argument, [], []),6168      locations: [pickleStepLocation(step)]6169    }6170  }6171  function pickleStepLocation(step) {6172    return {6173      line: step.location.line,6174      column: step.location.column + (step.keyword ? countSymbols(step.keyword) : 0)6175    };6176  }6177  function pickleLocation(location) {6178    return {6179      line: location.line,6180      column: location.column6181    }6182  }6183  function pickleTags(tags) {6184    return tags.map(function (tag) {6185      return pickleTag(tag);6186    });6187  }6188  function pickleTag(tag) {6189    return {6190      name: tag.name,6191      location: pickleLocation(tag.location)6192    };6193  }6194}6195module.exports = Compiler;6196},{"../count_symbols":4}],12:[function(require,module,exports){6197function Token(line, location) {6198  this.line = line;6199  this.location = location;6200  this.isEof = line == null;6201};6202Token.prototype.getTokenValue = function () {6203  return this.isEof ? "EOF" : this.line.getLineText(-1);6204};6205Token.prototype.detach = function () {6206  // TODO: Detach line, but is this really needed?6207};6208module.exports = Token;6209},{}],13:[function(require,module,exports){6210var DIALECTS = require('./dialects');6211var Errors = require('./errors');6212var LANGUAGE_PATTERN = /^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/;6213module.exports = function TokenMatcher(defaultDialectName) {6214  defaultDialectName = defaultDialectName || 'en';6215  var dialect;6216  var dialectName;6217  var activeDocStringSeparator;6218  var indentToRemove;6219  function changeDialect(newDialectName, location) {6220    var newDialect = DIALECTS[newDialectName];6221    if(!newDialect) {6222      throw Errors.NoSuchLanguageException.create(newDialectName, location);6223    }6224    dialectName = newDialectName;6225    dialect = newDialect;6226  }6227  this.reset = function () {6228    if(dialectName != defaultDialectName) changeDialect(defaultDialectName);6229    activeDocStringSeparator = null;6230    indentToRemove = 0;6231  };6232  this.reset();6233  this.match_TagLine = function match_TagLine(token) {6234    if(token.line.startsWith('@')) {6235      setTokenMatched(token, 'TagLine', null, null, null, token.line.getTags());6236      return true;6237    }6238    return false;6239  };6240  this.match_FeatureLine = function match_FeatureLine(token) {6241    return matchTitleLine(token, 'FeatureLine', dialect.feature);6242  };6243  this.match_ScenarioLine = function match_ScenarioLine(token) {6244    return matchTitleLine(token, 'ScenarioLine', dialect.scenario);6245  };6246  this.match_ScenarioOutlineLine = function match_ScenarioOutlineLine(token) {6247    return matchTitleLine(token, 'ScenarioOutlineLine', dialect.scenarioOutline);6248  };6249  this.match_BackgroundLine = function match_BackgroundLine(token) {6250    return matchTitleLine(token, 'BackgroundLine', dialect.background);6251  };6252  this.match_ExamplesLine = function match_ExamplesLine(token) {6253    return matchTitleLine(token, 'ExamplesLine', dialect.examples);6254  };6255  this.match_TableRow = function match_TableRow(token) {6256    if (token.line.startsWith('|')) {6257      // TODO: indent6258      setTokenMatched(token, 'TableRow', null, null, null, token.line.getTableCells());6259      return true;6260    }6261    return false;6262  };6263  this.match_Empty = function match_Empty(token) {6264    if (token.line.isEmpty) {6265      setTokenMatched(token, 'Empty', null, null, 0);6266      return true;6267    }6268    return false;6269  };6270  this.match_Comment = function match_Comment(token) {6271    if(token.line.startsWith('#')) {6272      var text = token.line.getLineText(0); //take the entire line, including leading space6273      setTokenMatched(token, 'Comment', text, null, 0);6274      return true;6275    }6276    return false;6277  };6278  this.match_Language = function match_Language(token) {6279    var match;6280    if(match = token.line.trimmedLineText.match(LANGUAGE_PATTERN)) {6281      var newDialectName = match[1];6282      setTokenMatched(token, 'Language', newDialectName);6283      changeDialect(newDialectName, token.location);6284      return true;6285    }6286    return false;6287  };6288  this.match_DocStringSeparator = function match_DocStringSeparator(token) {6289    return activeDocStringSeparator == null6290      ?6291      // open6292      _match_DocStringSeparator(token, '"""', true) ||6293      _match_DocStringSeparator(token, '```', true)6294      :6295      // close6296      _match_DocStringSeparator(token, activeDocStringSeparator, false);6297  };6298  function _match_DocStringSeparator(token, separator, isOpen) {6299    if (token.line.startsWith(separator)) {6300      var contentType = null;6301      if (isOpen) {6302        contentType = token.line.getRestTrimmed(separator.length);6303        activeDocStringSeparator = separator;6304        indentToRemove = token.line.indent;6305      } else {6306        activeDocStringSeparator = null;6307        indentToRemove = 0;6308      }6309      // TODO: Use the separator as keyword. That's needed for pretty printing.6310      setTokenMatched(token, 'DocStringSeparator', contentType);6311      return true;6312    }6313    return false;6314  }6315  this.match_EOF = function match_EOF(token) {6316    if(token.isEof) {6317      setTokenMatched(token, 'EOF');6318      return true;6319    }6320    return false;6321  };6322  this.match_StepLine = function match_StepLine(token) {6323    var keywords = []6324      .concat(dialect.given)6325      .concat(dialect.when)6326      .concat(dialect.then)6327      .concat(dialect.and)6328      .concat(dialect.but);6329    var length = keywords.length;6330    for(var i = 0, keyword; i < length; i++) {6331      var keyword = keywords[i];6332      if (token.line.startsWith(keyword)) {6333        var title = token.line.getRestTrimmed(keyword.length);6334        setTokenMatched(token, 'StepLine', title, keyword);6335        return true;6336      }6337    }6338    return false;6339  };6340  this.match_Other = function match_Other(token) {6341    var text = token.line.getLineText(indentToRemove); //take the entire line, except removing DocString indents6342    setTokenMatched(token, 'Other', unescapeDocString(text), null, 0);6343    return true;6344  };6345  function matchTitleLine(token, tokenType, keywords) {6346    var length = keywords.length;6347    for(var i = 0, keyword; i < length; i++) {6348      var keyword = keywords[i];6349      if (token.line.startsWithTitleKeyword(keyword)) {6350        var title = token.line.getRestTrimmed(keyword.length + ':'.length);6351        setTokenMatched(token, tokenType, title, keyword);6352        return true;6353      }6354    }6355    return false;6356  }6357  function setTokenMatched(token, matchedType, text, keyword, indent, items) {6358    token.matchedType = matchedType;6359    token.matchedText = text;6360    token.matchedKeyword = keyword;6361    token.matchedIndent = (typeof indent === 'number') ? indent : (token.line == null ? 0 : token.line.indent);6362    token.matchedItems = items || [];6363    token.location.column = token.matchedIndent + 1;...

Full Screen

Full Screen

token_matcher.js

Source:token_matcher.js Github

copy

Full Screen

...136  function matchTitleLine(token, tokenType, keywords) {137    var length = keywords.length;138    for(var i = 0, keyword; i < length; i++) {139      var keyword = keywords[i];140      if (token.line.startsWithTitleKeyword(keyword)) {141        var title = token.line.getRestTrimmed(keyword.length + ':'.length);142        setTokenMatched(token, tokenType, title, keyword);143        return true;144      }145    }146    return false;147  }148  function setTokenMatched(token, matchedType, text, keyword, indent, items) {149    token.matchedType = matchedType;150    token.matchedText = text;151    token.matchedKeyword = keyword;152    token.matchedIndent = (typeof indent === 'number') ? indent : (token.line == null ? 0 : token.line.indent);153    token.matchedItems = items || [];154    token.location.column = token.matchedIndent + 1;...

Full Screen

Full Screen

salad_line.js

Source:salad_line.js Github

copy

Full Screen

...11SaladLine.prototype.startsWith = function startsWith(prefix) {12  return this.trimmedLineText.indexOf(prefix) === 013}1415SaladLine.prototype.startsWithTitleKeyword = function startsWithTitleKeyword(16  keyword17) {18  return this.startsWith(keyword + ':') // The C# impl is more complicated. Find out why.19}2021SaladLine.prototype.getLineText = function getLineText(indentToRemove) {22  if (indentToRemove < 0 || indentToRemove > this.indent) {23    return this.trimmedLineText24  } else {25    return this.lineText.substring(indentToRemove)26  }27}2829SaladLine.prototype.getRestTrimmed = function getRestTrimmed(length) {
...

Full Screen

Full Screen

gherkin_line.js

Source:gherkin_line.js Github

copy

Full Screen

...8};9GherkinLine.prototype.startsWith = function startsWith(prefix) {10  return this.trimmedLineText.indexOf(prefix) == 0;11};12GherkinLine.prototype.startsWithTitleKeyword = function startsWithTitleKeyword(keyword) {13  return this.startsWith(keyword+':'); // The C# impl is more complicated. Find out why.14};15GherkinLine.prototype.getLineText = function getLineText(indentToRemove) {16  if (indentToRemove < 0 || indentToRemove > this.indent) {17    return this.trimmedLineText;18  } else {19    return this.lineText.substring(indentToRemove);20  }21};22GherkinLine.prototype.getRestTrimmed = function getRestTrimmed(length) {23  return this.trimmedLineText.substring(length).trim();24};25GherkinLine.prototype.getTableCells = function getTableCells() {26  var cells = [];...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var gherkin = require('cucumber-gherkin');2var fs = require('fs');3var gherkinSource = fs.readFileSync('test.feature', 'utf-8');4var feature = gherkin.parse(gherkinSource);5var scenarios = feature.scenarioDefinitions;6var scenario = scenarios[0];7var steps = scenario.steps;8var step = steps[0];9var keyword = step.keyword;10var isStartsWithKeyword = gherkin.startsWithKeyword(keyword);11var gherkin = require('cucumber-gherkin');12var fs = require('fs');13var gherkinSource = fs.readFileSync('test.feature', 'utf-8');14var feature = gherkin.parse(gherkinSource);15var scenarios = feature.scenarioDefinitions;16var scenario = scenarios[0];17var steps = scenario.steps;18var step = steps[0];19var keyword = step.keyword;20var isStartsWithKeyword = gherkin.startsWithKeyword(keyword);21var gherkin = require('cucumber-gherkin');22var fs = require('fs');23var gherkinSource = fs.readFileSync('test.feature', 'utf-8');24var feature = gherkin.parse(gherkinSource);25var scenarios = feature.scenarioDefinitions;26var scenario = scenarios[0];27var steps = scenario.steps;28var step = steps[0];29var keyword = step.keyword;30var isStartsWithKeyword = gherkin.startsWithKeyword(keyword);31var gherkin = require('cucumber-gherkin');32var fs = require('fs');33var gherkinSource = fs.readFileSync('test.feature', 'utf-8');

Full Screen

Using AI Code Generation

copy

Full Screen

1var gherkin = require('cucumber-gherkin');2var fs = require('fs');3var gherkinParser = new gherkin.Parser();4var gherkinAst = gherkinParser.parse(fs.readFileSync('test.feature').toString());5gherkinAst.feature.children[0].steps[0].text.startsWithKeyword('Given');6gherkinAst.feature.children[0].steps[0].text.startsWithKeyword('When');7gherkinAst.feature.children[0].steps[0].text.startsWithKeyword('Then');8gherkinAst.feature.children[0].steps[0].text.startsWithKeyword('And');9gherkinAst.feature.children[0].steps[0].text.startsWithKeyword('But');

Full Screen

Using AI Code Generation

copy

Full Screen

1var gherkin = require('cucumber-gherkin');2var feature = gherkin.parseFeature('Feature: test3');4var gherkin = require('cucumber-gherkin');5var feature = gherkin.parseFeature('Feature: test6');7var gherkin = require('cucumber-gherkin');8var feature = gherkin.parseFeature('Feature: test9');10var gherkin = require('cucumber-gherkin');11var feature = gherkin.parseFeature('Feature: test12');13var gherkin = require('cucumber-gherkin');14var feature = gherkin.parseFeature('Feature: test15');16var gherkin = require('cucumber-gherkin');17var feature = gherkin.parseFeature('Feature: test18');19var gherkin = require('cucumber-gherkin');20var feature = gherkin.parseFeature('Feature: test21');22var gherkin = require('

Full Screen

Using AI Code Generation

copy

Full Screen

1var gherkin = require('cucumber-gherkin');2var feature = gherkin.loadFeature("features/test.feature");3var featureKeywords = gherkin.featureKeywords;4gherkin.startsWithTitleKeyword("Given", feature, featureKeywords);5var gherkin = require('cucumber-gherkin');6var feature = gherkin.loadFeature("features/test.feature");7var featureKeywords = gherkin.featureKeywords;8gherkin.startsWithTitleKeyword("Given", feature, featureKeywords);9var gherkin = require('cucumber-gherkin');10var feature = gherkin.loadFeature("features/test.feature");11var featureKeywords = gherkin.featureKeywords;12gherkin.startsWithTitleKeyword("Given", feature, featureKeywords);

Full Screen

Using AI Code Generation

copy

Full Screen

1var gherkin = require('cucumber-gherkin');2var keyword = gherkin.startsWithKeyword('Feature: this is a feature');3console.log(keyword);4console.log('keyword is ' + keyword);5var gherkin = require('cucumber-gherkin');6var keyword = gherkin.startsWithKeyword('Feature: this is a feature');7console.log(keyword);8console.log('keyword is ' + keyword);9var gherkin = require('cucumber');10var keyword = gherkin.startsWithKeyword('Feature: this is a feature');11console.log(keyword);12console.log('keyword is ' + keyword);13var gherkin = require('cucumber-gherkin');14var keyword = gherkin.startsWithKeyword('Feature: this is a feature');15console.log(keyword);16console.log('keyword is ' + keyword);17var gherkin = require('cucumber');18var keyword = gherkin.startsWithKeyword('Feature: this is a feature');19console.log(keyword);20console.log('keyword is ' + keyword);21var gherkin = require('cucumber-gherkin');22var keyword = gherkin.startsWithKeyword('Feature: this is a feature');23console.log(keyword);24console.log('keyword is ' + keyword);25var gherkin = require('cucumber');26var keyword = gherkin.startsWithKeyword('Feature: this is a feature');27console.log(keyword);28console.log('keyword is ' + keyword);

Full Screen

Cucumber Tutorial:

LambdaTest offers a detailed Cucumber testing tutorial, explaining its features, importance, best practices, and more to help you get started with running your automation testing scripts.

Cucumber Tutorial Chapters:

Here are the detailed Cucumber testing chapters to help you get started:

  • Importance of Cucumber - Learn why Cucumber is important in Selenium automation testing during the development phase to identify bugs and errors.
  • Setting Up Cucumber in Eclipse and IntelliJ - Learn how to set up Cucumber in Eclipse and IntelliJ.
  • Running First Cucumber.js Test Script - After successfully setting up your Cucumber in Eclipse or IntelliJ, this chapter will help you get started with Selenium Cucumber testing in no time.
  • Annotations in Cucumber - To handle multiple feature files and the multiple scenarios in each file, you need to use functionality to execute these scenarios. This chapter will help you learn about a handful of Cucumber annotations ranging from tags, Cucumber hooks, and more to ease the maintenance of the framework.
  • Automation Testing With Cucumber And Nightwatch JS - Learn how to build a robust BDD framework setup for performing Selenium automation testing by integrating Cucumber into the Nightwatch.js framework.
  • Automation Testing With Selenium, Cucumber & TestNG - Learn how to perform Selenium automation testing by integrating Cucumber with the TestNG framework.
  • Integrate Cucumber With Jenkins - By using Cucumber with Jenkins integration, you can schedule test case executions remotely and take advantage of the benefits of Jenkins. Learn how to integrate Cucumber with Jenkins with this detailed chapter.
  • Cucumber Best Practices For Selenium Automation - Take a deep dive into the advanced use cases, such as creating a feature file, separating feature files, and more for Cucumber testing.

Run Cucumber-gherkin automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful