How to use match_Comment method in Cucumber-gherkin

Best JavaScript code snippet using cucumber-gherkin

gherkin.js

Source:gherkin.js Github

copy

Full Screen

...3714      startRule(context, 'Feature_Header');3715      build(context, token);3716      return 3;3717    }3718    if(match_Comment(context, token)) {3719      build(context, token);3720      return 0;3721    }3722    if(match_Empty(context, token)) {3723      build(context, token);3724      return 0;3725    }3726    3727    var stateComment = "State: 0 - Start";3728    token.detach();3729    var expectedTokens = ["#EOF", "#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"];3730    var error = token.isEof ?3731      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :3732      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);3733    if (self.stopAtFirstError) throw error;3734    addError(context, error);3735    return 0;3736  }3737  // GherkinDocument:0>Feature:0>Feature_Header:0>#Language:03738  function matchTokenAt_1(token, context) {3739    if(match_TagLine(context, token)) {3740      startRule(context, 'Tags');3741      build(context, token);3742      return 2;3743    }3744    if(match_FeatureLine(context, token)) {3745      build(context, token);3746      return 3;3747    }3748    if(match_Comment(context, token)) {3749      build(context, token);3750      return 1;3751    }3752    if(match_Empty(context, token)) {3753      build(context, token);3754      return 1;3755    }3756    3757    var stateComment = "State: 1 - GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0";3758    token.detach();3759    var expectedTokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"];3760    var error = token.isEof ?3761      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :3762      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);3763    if (self.stopAtFirstError) throw error;3764    addError(context, error);3765    return 1;3766  }3767  // GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:03768  function matchTokenAt_2(token, context) {3769    if(match_TagLine(context, token)) {3770      build(context, token);3771      return 2;3772    }3773    if(match_FeatureLine(context, token)) {3774      endRule(context, 'Tags');3775      build(context, token);3776      return 3;3777    }3778    if(match_Comment(context, token)) {3779      build(context, token);3780      return 2;3781    }3782    if(match_Empty(context, token)) {3783      build(context, token);3784      return 2;3785    }3786    3787    var stateComment = "State: 2 - GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0";3788    token.detach();3789    var expectedTokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"];3790    var error = token.isEof ?3791      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :3792      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);3793    if (self.stopAtFirstError) throw error;3794    addError(context, error);3795    return 2;3796  }3797  // GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:03798  function matchTokenAt_3(token, context) {3799    if(match_EOF(context, token)) {3800      endRule(context, 'Feature_Header');3801      endRule(context, 'Feature');3802      build(context, token);3803      return 27;3804    }3805    if(match_Empty(context, token)) {3806      build(context, token);3807      return 3;3808    }3809    if(match_Comment(context, token)) {3810      build(context, token);3811      return 5;3812    }3813    if(match_BackgroundLine(context, token)) {3814      endRule(context, 'Feature_Header');3815      startRule(context, 'Background');3816      build(context, token);3817      return 6;3818    }3819    if(match_TagLine(context, token)) {3820      endRule(context, 'Feature_Header');3821      startRule(context, 'Scenario_Definition');3822      startRule(context, 'Tags');3823      build(context, token);3824      return 11;3825    }3826    if(match_ScenarioLine(context, token)) {3827      endRule(context, 'Feature_Header');3828      startRule(context, 'Scenario_Definition');3829      startRule(context, 'Scenario');3830      build(context, token);3831      return 12;3832    }3833    if(match_ScenarioOutlineLine(context, token)) {3834      endRule(context, 'Feature_Header');3835      startRule(context, 'Scenario_Definition');3836      startRule(context, 'ScenarioOutline');3837      build(context, token);3838      return 17;3839    }3840    if(match_Other(context, token)) {3841      startRule(context, 'Description');3842      build(context, token);3843      return 4;3844    }3845    3846    var stateComment = "State: 3 - GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0";3847    token.detach();3848    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];3849    var error = token.isEof ?3850      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :3851      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);3852    if (self.stopAtFirstError) throw error;3853    addError(context, error);3854    return 3;3855  }3856  // GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:03857  function matchTokenAt_4(token, context) {3858    if(match_EOF(context, token)) {3859      endRule(context, 'Description');3860      endRule(context, 'Feature_Header');3861      endRule(context, 'Feature');3862      build(context, token);3863      return 27;3864    }3865    if(match_Comment(context, token)) {3866      endRule(context, 'Description');3867      build(context, token);3868      return 5;3869    }3870    if(match_BackgroundLine(context, token)) {3871      endRule(context, 'Description');3872      endRule(context, 'Feature_Header');3873      startRule(context, 'Background');3874      build(context, token);3875      return 6;3876    }3877    if(match_TagLine(context, token)) {3878      endRule(context, 'Description');3879      endRule(context, 'Feature_Header');3880      startRule(context, 'Scenario_Definition');3881      startRule(context, 'Tags');3882      build(context, token);3883      return 11;3884    }3885    if(match_ScenarioLine(context, token)) {3886      endRule(context, 'Description');3887      endRule(context, 'Feature_Header');3888      startRule(context, 'Scenario_Definition');3889      startRule(context, 'Scenario');3890      build(context, token);3891      return 12;3892    }3893    if(match_ScenarioOutlineLine(context, token)) {3894      endRule(context, 'Description');3895      endRule(context, 'Feature_Header');3896      startRule(context, 'Scenario_Definition');3897      startRule(context, 'ScenarioOutline');3898      build(context, token);3899      return 17;3900    }3901    if(match_Other(context, token)) {3902      build(context, token);3903      return 4;3904    }3905    3906    var stateComment = "State: 4 - GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0";3907    token.detach();3908    var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];3909    var error = token.isEof ?3910      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :3911      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);3912    if (self.stopAtFirstError) throw error;3913    addError(context, error);3914    return 4;3915  }3916  // GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:03917  function matchTokenAt_5(token, context) {3918    if(match_EOF(context, token)) {3919      endRule(context, 'Feature_Header');3920      endRule(context, 'Feature');3921      build(context, token);3922      return 27;3923    }3924    if(match_Comment(context, token)) {3925      build(context, token);3926      return 5;3927    }3928    if(match_BackgroundLine(context, token)) {3929      endRule(context, 'Feature_Header');3930      startRule(context, 'Background');3931      build(context, token);3932      return 6;3933    }3934    if(match_TagLine(context, token)) {3935      endRule(context, 'Feature_Header');3936      startRule(context, 'Scenario_Definition');3937      startRule(context, 'Tags');3938      build(context, token);3939      return 11;3940    }3941    if(match_ScenarioLine(context, token)) {3942      endRule(context, 'Feature_Header');3943      startRule(context, 'Scenario_Definition');3944      startRule(context, 'Scenario');3945      build(context, token);3946      return 12;3947    }3948    if(match_ScenarioOutlineLine(context, token)) {3949      endRule(context, 'Feature_Header');3950      startRule(context, 'Scenario_Definition');3951      startRule(context, 'ScenarioOutline');3952      build(context, token);3953      return 17;3954    }3955    if(match_Empty(context, token)) {3956      build(context, token);3957      return 5;3958    }3959    3960    var stateComment = "State: 5 - GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0";3961    token.detach();3962    var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];3963    var error = token.isEof ?3964      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :3965      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);3966    if (self.stopAtFirstError) throw error;3967    addError(context, error);3968    return 5;3969  }3970  // GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:03971  function matchTokenAt_6(token, context) {3972    if(match_EOF(context, token)) {3973      endRule(context, 'Background');3974      endRule(context, 'Feature');3975      build(context, token);3976      return 27;3977    }3978    if(match_Empty(context, token)) {3979      build(context, token);3980      return 6;3981    }3982    if(match_Comment(context, token)) {3983      build(context, token);3984      return 8;3985    }3986    if(match_StepLine(context, token)) {3987      startRule(context, 'Step');3988      build(context, token);3989      return 9;3990    }3991    if(match_TagLine(context, token)) {3992      endRule(context, 'Background');3993      startRule(context, 'Scenario_Definition');3994      startRule(context, 'Tags');3995      build(context, token);3996      return 11;3997    }3998    if(match_ScenarioLine(context, token)) {3999      endRule(context, 'Background');4000      startRule(context, 'Scenario_Definition');4001      startRule(context, 'Scenario');4002      build(context, token);4003      return 12;4004    }4005    if(match_ScenarioOutlineLine(context, token)) {4006      endRule(context, 'Background');4007      startRule(context, 'Scenario_Definition');4008      startRule(context, 'ScenarioOutline');4009      build(context, token);4010      return 17;4011    }4012    if(match_Other(context, token)) {4013      startRule(context, 'Description');4014      build(context, token);4015      return 7;4016    }4017    4018    var stateComment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0";4019    token.detach();4020    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4021    var error = token.isEof ?4022      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4023      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4024    if (self.stopAtFirstError) throw error;4025    addError(context, error);4026    return 6;4027  }4028  // GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:04029  function matchTokenAt_7(token, context) {4030    if(match_EOF(context, token)) {4031      endRule(context, 'Description');4032      endRule(context, 'Background');4033      endRule(context, 'Feature');4034      build(context, token);4035      return 27;4036    }4037    if(match_Comment(context, token)) {4038      endRule(context, 'Description');4039      build(context, token);4040      return 8;4041    }4042    if(match_StepLine(context, token)) {4043      endRule(context, 'Description');4044      startRule(context, 'Step');4045      build(context, token);4046      return 9;4047    }4048    if(match_TagLine(context, token)) {4049      endRule(context, 'Description');4050      endRule(context, 'Background');4051      startRule(context, 'Scenario_Definition');4052      startRule(context, 'Tags');4053      build(context, token);4054      return 11;4055    }4056    if(match_ScenarioLine(context, token)) {4057      endRule(context, 'Description');4058      endRule(context, 'Background');4059      startRule(context, 'Scenario_Definition');4060      startRule(context, 'Scenario');4061      build(context, token);4062      return 12;4063    }4064    if(match_ScenarioOutlineLine(context, token)) {4065      endRule(context, 'Description');4066      endRule(context, 'Background');4067      startRule(context, 'Scenario_Definition');4068      startRule(context, 'ScenarioOutline');4069      build(context, token);4070      return 17;4071    }4072    if(match_Other(context, token)) {4073      build(context, token);4074      return 7;4075    }4076    4077    var stateComment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0";4078    token.detach();4079    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4080    var error = token.isEof ?4081      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4082      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4083    if (self.stopAtFirstError) throw error;4084    addError(context, error);4085    return 7;4086  }4087  // GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:04088  function matchTokenAt_8(token, context) {4089    if(match_EOF(context, token)) {4090      endRule(context, 'Background');4091      endRule(context, 'Feature');4092      build(context, token);4093      return 27;4094    }4095    if(match_Comment(context, token)) {4096      build(context, token);4097      return 8;4098    }4099    if(match_StepLine(context, token)) {4100      startRule(context, 'Step');4101      build(context, token);4102      return 9;4103    }4104    if(match_TagLine(context, token)) {4105      endRule(context, 'Background');4106      startRule(context, 'Scenario_Definition');4107      startRule(context, 'Tags');4108      build(context, token);4109      return 11;4110    }4111    if(match_ScenarioLine(context, token)) {4112      endRule(context, 'Background');4113      startRule(context, 'Scenario_Definition');4114      startRule(context, 'Scenario');4115      build(context, token);4116      return 12;4117    }4118    if(match_ScenarioOutlineLine(context, token)) {4119      endRule(context, 'Background');4120      startRule(context, 'Scenario_Definition');4121      startRule(context, 'ScenarioOutline');4122      build(context, token);4123      return 17;4124    }4125    if(match_Empty(context, token)) {4126      build(context, token);4127      return 8;4128    }4129    4130    var stateComment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0";4131    token.detach();4132    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];4133    var error = token.isEof ?4134      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4135      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4136    if (self.stopAtFirstError) throw error;4137    addError(context, error);4138    return 8;4139  }4140  // GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:04141  function matchTokenAt_9(token, context) {4142    if(match_EOF(context, token)) {4143      endRule(context, 'Step');4144      endRule(context, 'Background');4145      endRule(context, 'Feature');4146      build(context, token);4147      return 27;4148    }4149    if(match_TableRow(context, token)) {4150      startRule(context, 'DataTable');4151      build(context, token);4152      return 10;4153    }4154    if(match_DocStringSeparator(context, token)) {4155      startRule(context, 'DocString');4156      build(context, token);4157      return 32;4158    }4159    if(match_StepLine(context, token)) {4160      endRule(context, 'Step');4161      startRule(context, 'Step');4162      build(context, token);4163      return 9;4164    }4165    if(match_TagLine(context, token)) {4166      endRule(context, 'Step');4167      endRule(context, 'Background');4168      startRule(context, 'Scenario_Definition');4169      startRule(context, 'Tags');4170      build(context, token);4171      return 11;4172    }4173    if(match_ScenarioLine(context, token)) {4174      endRule(context, 'Step');4175      endRule(context, 'Background');4176      startRule(context, 'Scenario_Definition');4177      startRule(context, 'Scenario');4178      build(context, token);4179      return 12;4180    }4181    if(match_ScenarioOutlineLine(context, token)) {4182      endRule(context, 'Step');4183      endRule(context, 'Background');4184      startRule(context, 'Scenario_Definition');4185      startRule(context, 'ScenarioOutline');4186      build(context, token);4187      return 17;4188    }4189    if(match_Comment(context, token)) {4190      build(context, token);4191      return 9;4192    }4193    if(match_Empty(context, token)) {4194      build(context, token);4195      return 9;4196    }4197    4198    var stateComment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0";4199    token.detach();4200    var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4201    var error = token.isEof ?4202      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4203      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4204    if (self.stopAtFirstError) throw error;4205    addError(context, error);4206    return 9;4207  }4208  // GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:04209  function matchTokenAt_10(token, context) {4210    if(match_EOF(context, token)) {4211      endRule(context, 'DataTable');4212      endRule(context, 'Step');4213      endRule(context, 'Background');4214      endRule(context, 'Feature');4215      build(context, token);4216      return 27;4217    }4218    if(match_TableRow(context, token)) {4219      build(context, token);4220      return 10;4221    }4222    if(match_StepLine(context, token)) {4223      endRule(context, 'DataTable');4224      endRule(context, 'Step');4225      startRule(context, 'Step');4226      build(context, token);4227      return 9;4228    }4229    if(match_TagLine(context, token)) {4230      endRule(context, 'DataTable');4231      endRule(context, 'Step');4232      endRule(context, 'Background');4233      startRule(context, 'Scenario_Definition');4234      startRule(context, 'Tags');4235      build(context, token);4236      return 11;4237    }4238    if(match_ScenarioLine(context, token)) {4239      endRule(context, 'DataTable');4240      endRule(context, 'Step');4241      endRule(context, 'Background');4242      startRule(context, 'Scenario_Definition');4243      startRule(context, 'Scenario');4244      build(context, token);4245      return 12;4246    }4247    if(match_ScenarioOutlineLine(context, token)) {4248      endRule(context, 'DataTable');4249      endRule(context, 'Step');4250      endRule(context, 'Background');4251      startRule(context, 'Scenario_Definition');4252      startRule(context, 'ScenarioOutline');4253      build(context, token);4254      return 17;4255    }4256    if(match_Comment(context, token)) {4257      build(context, token);4258      return 10;4259    }4260    if(match_Empty(context, token)) {4261      build(context, token);4262      return 10;4263    }4264    4265    var stateComment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";4266    token.detach();4267    var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];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 10;4274  }4275  // GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:04276  function matchTokenAt_11(token, context) {4277    if(match_TagLine(context, token)) {4278      build(context, token);4279      return 11;4280    }4281    if(match_ScenarioLine(context, token)) {4282      endRule(context, 'Tags');4283      startRule(context, 'Scenario');4284      build(context, token);4285      return 12;4286    }4287    if(match_ScenarioOutlineLine(context, token)) {4288      endRule(context, 'Tags');4289      startRule(context, 'ScenarioOutline');4290      build(context, token);4291      return 17;4292    }4293    if(match_Comment(context, token)) {4294      build(context, token);4295      return 11;4296    }4297    if(match_Empty(context, token)) {4298      build(context, token);4299      return 11;4300    }4301    4302    var stateComment = "State: 11 - GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0";4303    token.detach();4304    var expectedTokens = ["#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4305    var error = token.isEof ?4306      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4307      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4308    if (self.stopAtFirstError) throw error;4309    addError(context, error);4310    return 11;4311  }4312  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:04313  function matchTokenAt_12(token, context) {4314    if(match_EOF(context, token)) {4315      endRule(context, 'Scenario');4316      endRule(context, 'Scenario_Definition');4317      endRule(context, 'Feature');4318      build(context, token);4319      return 27;4320    }4321    if(match_Empty(context, token)) {4322      build(context, token);4323      return 12;4324    }4325    if(match_Comment(context, token)) {4326      build(context, token);4327      return 14;4328    }4329    if(match_StepLine(context, token)) {4330      startRule(context, 'Step');4331      build(context, token);4332      return 15;4333    }4334    if(match_TagLine(context, token)) {4335      endRule(context, 'Scenario');4336      endRule(context, 'Scenario_Definition');4337      startRule(context, 'Scenario_Definition');4338      startRule(context, 'Tags');4339      build(context, token);4340      return 11;4341    }4342    if(match_ScenarioLine(context, token)) {4343      endRule(context, 'Scenario');4344      endRule(context, 'Scenario_Definition');4345      startRule(context, 'Scenario_Definition');4346      startRule(context, 'Scenario');4347      build(context, token);4348      return 12;4349    }4350    if(match_ScenarioOutlineLine(context, token)) {4351      endRule(context, 'Scenario');4352      endRule(context, 'Scenario_Definition');4353      startRule(context, 'Scenario_Definition');4354      startRule(context, 'ScenarioOutline');4355      build(context, token);4356      return 17;4357    }4358    if(match_Other(context, token)) {4359      startRule(context, 'Description');4360      build(context, token);4361      return 13;4362    }4363    4364    var stateComment = "State: 12 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0";4365    token.detach();4366    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4367    var error = token.isEof ?4368      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4369      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4370    if (self.stopAtFirstError) throw error;4371    addError(context, error);4372    return 12;4373  }4374  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:04375  function matchTokenAt_13(token, context) {4376    if(match_EOF(context, token)) {4377      endRule(context, 'Description');4378      endRule(context, 'Scenario');4379      endRule(context, 'Scenario_Definition');4380      endRule(context, 'Feature');4381      build(context, token);4382      return 27;4383    }4384    if(match_Comment(context, token)) {4385      endRule(context, 'Description');4386      build(context, token);4387      return 14;4388    }4389    if(match_StepLine(context, token)) {4390      endRule(context, 'Description');4391      startRule(context, 'Step');4392      build(context, token);4393      return 15;4394    }4395    if(match_TagLine(context, token)) {4396      endRule(context, 'Description');4397      endRule(context, 'Scenario');4398      endRule(context, 'Scenario_Definition');4399      startRule(context, 'Scenario_Definition');4400      startRule(context, 'Tags');4401      build(context, token);4402      return 11;4403    }4404    if(match_ScenarioLine(context, token)) {4405      endRule(context, 'Description');4406      endRule(context, 'Scenario');4407      endRule(context, 'Scenario_Definition');4408      startRule(context, 'Scenario_Definition');4409      startRule(context, 'Scenario');4410      build(context, token);4411      return 12;4412    }4413    if(match_ScenarioOutlineLine(context, token)) {4414      endRule(context, 'Description');4415      endRule(context, 'Scenario');4416      endRule(context, 'Scenario_Definition');4417      startRule(context, 'Scenario_Definition');4418      startRule(context, 'ScenarioOutline');4419      build(context, token);4420      return 17;4421    }4422    if(match_Other(context, token)) {4423      build(context, token);4424      return 13;4425    }4426    4427    var stateComment = "State: 13 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0";4428    token.detach();4429    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4430    var error = token.isEof ?4431      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4432      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4433    if (self.stopAtFirstError) throw error;4434    addError(context, error);4435    return 13;4436  }4437  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:04438  function matchTokenAt_14(token, context) {4439    if(match_EOF(context, token)) {4440      endRule(context, 'Scenario');4441      endRule(context, 'Scenario_Definition');4442      endRule(context, 'Feature');4443      build(context, token);4444      return 27;4445    }4446    if(match_Comment(context, token)) {4447      build(context, token);4448      return 14;4449    }4450    if(match_StepLine(context, token)) {4451      startRule(context, 'Step');4452      build(context, token);4453      return 15;4454    }4455    if(match_TagLine(context, token)) {4456      endRule(context, 'Scenario');4457      endRule(context, 'Scenario_Definition');4458      startRule(context, 'Scenario_Definition');4459      startRule(context, 'Tags');4460      build(context, token);4461      return 11;4462    }4463    if(match_ScenarioLine(context, token)) {4464      endRule(context, 'Scenario');4465      endRule(context, 'Scenario_Definition');4466      startRule(context, 'Scenario_Definition');4467      startRule(context, 'Scenario');4468      build(context, token);4469      return 12;4470    }4471    if(match_ScenarioOutlineLine(context, token)) {4472      endRule(context, 'Scenario');4473      endRule(context, 'Scenario_Definition');4474      startRule(context, 'Scenario_Definition');4475      startRule(context, 'ScenarioOutline');4476      build(context, token);4477      return 17;4478    }4479    if(match_Empty(context, token)) {4480      build(context, token);4481      return 14;4482    }4483    4484    var stateComment = "State: 14 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0";4485    token.detach();4486    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];4487    var error = token.isEof ?4488      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4489      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4490    if (self.stopAtFirstError) throw error;4491    addError(context, error);4492    return 14;4493  }4494  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:04495  function matchTokenAt_15(token, context) {4496    if(match_EOF(context, token)) {4497      endRule(context, 'Step');4498      endRule(context, 'Scenario');4499      endRule(context, 'Scenario_Definition');4500      endRule(context, 'Feature');4501      build(context, token);4502      return 27;4503    }4504    if(match_TableRow(context, token)) {4505      startRule(context, 'DataTable');4506      build(context, token);4507      return 16;4508    }4509    if(match_DocStringSeparator(context, token)) {4510      startRule(context, 'DocString');4511      build(context, token);4512      return 30;4513    }4514    if(match_StepLine(context, token)) {4515      endRule(context, 'Step');4516      startRule(context, 'Step');4517      build(context, token);4518      return 15;4519    }4520    if(match_TagLine(context, token)) {4521      endRule(context, 'Step');4522      endRule(context, 'Scenario');4523      endRule(context, 'Scenario_Definition');4524      startRule(context, 'Scenario_Definition');4525      startRule(context, 'Tags');4526      build(context, token);4527      return 11;4528    }4529    if(match_ScenarioLine(context, token)) {4530      endRule(context, 'Step');4531      endRule(context, 'Scenario');4532      endRule(context, 'Scenario_Definition');4533      startRule(context, 'Scenario_Definition');4534      startRule(context, 'Scenario');4535      build(context, token);4536      return 12;4537    }4538    if(match_ScenarioOutlineLine(context, token)) {4539      endRule(context, 'Step');4540      endRule(context, 'Scenario');4541      endRule(context, 'Scenario_Definition');4542      startRule(context, 'Scenario_Definition');4543      startRule(context, 'ScenarioOutline');4544      build(context, token);4545      return 17;4546    }4547    if(match_Comment(context, token)) {4548      build(context, token);4549      return 15;4550    }4551    if(match_Empty(context, token)) {4552      build(context, token);4553      return 15;4554    }4555    4556    var stateComment = "State: 15 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0";4557    token.detach();4558    var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4559    var error = token.isEof ?4560      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4561      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4562    if (self.stopAtFirstError) throw error;4563    addError(context, error);4564    return 15;4565  }4566  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:04567  function matchTokenAt_16(token, context) {4568    if(match_EOF(context, token)) {4569      endRule(context, 'DataTable');4570      endRule(context, 'Step');4571      endRule(context, 'Scenario');4572      endRule(context, 'Scenario_Definition');4573      endRule(context, 'Feature');4574      build(context, token);4575      return 27;4576    }4577    if(match_TableRow(context, token)) {4578      build(context, token);4579      return 16;4580    }4581    if(match_StepLine(context, token)) {4582      endRule(context, 'DataTable');4583      endRule(context, 'Step');4584      startRule(context, 'Step');4585      build(context, token);4586      return 15;4587    }4588    if(match_TagLine(context, token)) {4589      endRule(context, 'DataTable');4590      endRule(context, 'Step');4591      endRule(context, 'Scenario');4592      endRule(context, 'Scenario_Definition');4593      startRule(context, 'Scenario_Definition');4594      startRule(context, 'Tags');4595      build(context, token);4596      return 11;4597    }4598    if(match_ScenarioLine(context, token)) {4599      endRule(context, 'DataTable');4600      endRule(context, 'Step');4601      endRule(context, 'Scenario');4602      endRule(context, 'Scenario_Definition');4603      startRule(context, 'Scenario_Definition');4604      startRule(context, 'Scenario');4605      build(context, token);4606      return 12;4607    }4608    if(match_ScenarioOutlineLine(context, token)) {4609      endRule(context, 'DataTable');4610      endRule(context, 'Step');4611      endRule(context, 'Scenario');4612      endRule(context, 'Scenario_Definition');4613      startRule(context, 'Scenario_Definition');4614      startRule(context, 'ScenarioOutline');4615      build(context, token);4616      return 17;4617    }4618    if(match_Comment(context, token)) {4619      build(context, token);4620      return 16;4621    }4622    if(match_Empty(context, token)) {4623      build(context, token);4624      return 16;4625    }4626    4627    var stateComment = "State: 16 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";4628    token.detach();4629    var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4630    var error = token.isEof ?4631      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4632      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4633    if (self.stopAtFirstError) throw error;4634    addError(context, error);4635    return 16;4636  }4637  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:04638  function matchTokenAt_17(token, context) {4639    if(match_EOF(context, token)) {4640      endRule(context, 'ScenarioOutline');4641      endRule(context, 'Scenario_Definition');4642      endRule(context, 'Feature');4643      build(context, token);4644      return 27;4645    }4646    if(match_Empty(context, token)) {4647      build(context, token);4648      return 17;4649    }4650    if(match_Comment(context, token)) {4651      build(context, token);4652      return 19;4653    }4654    if(match_StepLine(context, token)) {4655      startRule(context, 'Step');4656      build(context, token);4657      return 20;4658    }4659    if(match_TagLine(context, token)) {4660      if(lookahead_0(context, token)) {4661      startRule(context, 'Examples_Definition');4662      startRule(context, 'Tags');4663      build(context, token);4664      return 22;4665      }4666    }4667    if(match_TagLine(context, token)) {4668      endRule(context, 'ScenarioOutline');4669      endRule(context, 'Scenario_Definition');4670      startRule(context, 'Scenario_Definition');4671      startRule(context, 'Tags');4672      build(context, token);4673      return 11;4674    }4675    if(match_ExamplesLine(context, token)) {4676      startRule(context, 'Examples_Definition');4677      startRule(context, 'Examples');4678      build(context, token);4679      return 23;4680    }4681    if(match_ScenarioLine(context, token)) {4682      endRule(context, 'ScenarioOutline');4683      endRule(context, 'Scenario_Definition');4684      startRule(context, 'Scenario_Definition');4685      startRule(context, 'Scenario');4686      build(context, token);4687      return 12;4688    }4689    if(match_ScenarioOutlineLine(context, token)) {4690      endRule(context, 'ScenarioOutline');4691      endRule(context, 'Scenario_Definition');4692      startRule(context, 'Scenario_Definition');4693      startRule(context, 'ScenarioOutline');4694      build(context, token);4695      return 17;4696    }4697    if(match_Other(context, token)) {4698      startRule(context, 'Description');4699      build(context, token);4700      return 18;4701    }4702    4703    var stateComment = "State: 17 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0";4704    token.detach();4705    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4706    var error = token.isEof ?4707      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4708      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4709    if (self.stopAtFirstError) throw error;4710    addError(context, error);4711    return 17;4712  }4713  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:04714  function matchTokenAt_18(token, context) {4715    if(match_EOF(context, token)) {4716      endRule(context, 'Description');4717      endRule(context, 'ScenarioOutline');4718      endRule(context, 'Scenario_Definition');4719      endRule(context, 'Feature');4720      build(context, token);4721      return 27;4722    }4723    if(match_Comment(context, token)) {4724      endRule(context, 'Description');4725      build(context, token);4726      return 19;4727    }4728    if(match_StepLine(context, token)) {4729      endRule(context, 'Description');4730      startRule(context, 'Step');4731      build(context, token);4732      return 20;4733    }4734    if(match_TagLine(context, token)) {4735      if(lookahead_0(context, token)) {4736      endRule(context, 'Description');4737      startRule(context, 'Examples_Definition');4738      startRule(context, 'Tags');4739      build(context, token);4740      return 22;4741      }4742    }4743    if(match_TagLine(context, token)) {4744      endRule(context, 'Description');4745      endRule(context, 'ScenarioOutline');4746      endRule(context, 'Scenario_Definition');4747      startRule(context, 'Scenario_Definition');4748      startRule(context, 'Tags');4749      build(context, token);4750      return 11;4751    }4752    if(match_ExamplesLine(context, token)) {4753      endRule(context, 'Description');4754      startRule(context, 'Examples_Definition');4755      startRule(context, 'Examples');4756      build(context, token);4757      return 23;4758    }4759    if(match_ScenarioLine(context, token)) {4760      endRule(context, 'Description');4761      endRule(context, 'ScenarioOutline');4762      endRule(context, 'Scenario_Definition');4763      startRule(context, 'Scenario_Definition');4764      startRule(context, 'Scenario');4765      build(context, token);4766      return 12;4767    }4768    if(match_ScenarioOutlineLine(context, token)) {4769      endRule(context, 'Description');4770      endRule(context, 'ScenarioOutline');4771      endRule(context, 'Scenario_Definition');4772      startRule(context, 'Scenario_Definition');4773      startRule(context, 'ScenarioOutline');4774      build(context, token);4775      return 17;4776    }4777    if(match_Other(context, token)) {4778      build(context, token);4779      return 18;4780    }4781    4782    var stateComment = "State: 18 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0";4783    token.detach();4784    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];4785    var error = token.isEof ?4786      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4787      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4788    if (self.stopAtFirstError) throw error;4789    addError(context, error);4790    return 18;4791  }4792  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:04793  function matchTokenAt_19(token, context) {4794    if(match_EOF(context, token)) {4795      endRule(context, 'ScenarioOutline');4796      endRule(context, 'Scenario_Definition');4797      endRule(context, 'Feature');4798      build(context, token);4799      return 27;4800    }4801    if(match_Comment(context, token)) {4802      build(context, token);4803      return 19;4804    }4805    if(match_StepLine(context, token)) {4806      startRule(context, 'Step');4807      build(context, token);4808      return 20;4809    }4810    if(match_TagLine(context, token)) {4811      if(lookahead_0(context, token)) {4812      startRule(context, 'Examples_Definition');4813      startRule(context, 'Tags');4814      build(context, token);4815      return 22;4816      }4817    }4818    if(match_TagLine(context, token)) {4819      endRule(context, 'ScenarioOutline');4820      endRule(context, 'Scenario_Definition');4821      startRule(context, 'Scenario_Definition');4822      startRule(context, 'Tags');4823      build(context, token);4824      return 11;4825    }4826    if(match_ExamplesLine(context, token)) {4827      startRule(context, 'Examples_Definition');4828      startRule(context, 'Examples');4829      build(context, token);4830      return 23;4831    }4832    if(match_ScenarioLine(context, token)) {4833      endRule(context, 'ScenarioOutline');4834      endRule(context, 'Scenario_Definition');4835      startRule(context, 'Scenario_Definition');4836      startRule(context, 'Scenario');4837      build(context, token);4838      return 12;4839    }4840    if(match_ScenarioOutlineLine(context, token)) {4841      endRule(context, 'ScenarioOutline');4842      endRule(context, 'Scenario_Definition');4843      startRule(context, 'Scenario_Definition');4844      startRule(context, 'ScenarioOutline');4845      build(context, token);4846      return 17;4847    }4848    if(match_Empty(context, token)) {4849      build(context, token);4850      return 19;4851    }4852    4853    var stateComment = "State: 19 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:0";4854    token.detach();4855    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];4856    var error = token.isEof ?4857      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4858      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4859    if (self.stopAtFirstError) throw error;4860    addError(context, error);4861    return 19;4862  }4863  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:04864  function matchTokenAt_20(token, context) {4865    if(match_EOF(context, token)) {4866      endRule(context, 'Step');4867      endRule(context, 'ScenarioOutline');4868      endRule(context, 'Scenario_Definition');4869      endRule(context, 'Feature');4870      build(context, token);4871      return 27;4872    }4873    if(match_TableRow(context, token)) {4874      startRule(context, 'DataTable');4875      build(context, token);4876      return 21;4877    }4878    if(match_DocStringSeparator(context, token)) {4879      startRule(context, 'DocString');4880      build(context, token);4881      return 28;4882    }4883    if(match_StepLine(context, token)) {4884      endRule(context, 'Step');4885      startRule(context, 'Step');4886      build(context, token);4887      return 20;4888    }4889    if(match_TagLine(context, token)) {4890      if(lookahead_0(context, token)) {4891      endRule(context, 'Step');4892      startRule(context, 'Examples_Definition');4893      startRule(context, 'Tags');4894      build(context, token);4895      return 22;4896      }4897    }4898    if(match_TagLine(context, token)) {4899      endRule(context, 'Step');4900      endRule(context, 'ScenarioOutline');4901      endRule(context, 'Scenario_Definition');4902      startRule(context, 'Scenario_Definition');4903      startRule(context, 'Tags');4904      build(context, token);4905      return 11;4906    }4907    if(match_ExamplesLine(context, token)) {4908      endRule(context, 'Step');4909      startRule(context, 'Examples_Definition');4910      startRule(context, 'Examples');4911      build(context, token);4912      return 23;4913    }4914    if(match_ScenarioLine(context, token)) {4915      endRule(context, 'Step');4916      endRule(context, 'ScenarioOutline');4917      endRule(context, 'Scenario_Definition');4918      startRule(context, 'Scenario_Definition');4919      startRule(context, 'Scenario');4920      build(context, token);4921      return 12;4922    }4923    if(match_ScenarioOutlineLine(context, token)) {4924      endRule(context, 'Step');4925      endRule(context, 'ScenarioOutline');4926      endRule(context, 'Scenario_Definition');4927      startRule(context, 'Scenario_Definition');4928      startRule(context, 'ScenarioOutline');4929      build(context, token);4930      return 17;4931    }4932    if(match_Comment(context, token)) {4933      build(context, token);4934      return 20;4935    }4936    if(match_Empty(context, token)) {4937      build(context, token);4938      return 20;4939    }4940    4941    var stateComment = "State: 20 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0";4942    token.detach();4943    var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];4944    var error = token.isEof ?4945      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :4946      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);4947    if (self.stopAtFirstError) throw error;4948    addError(context, error);4949    return 20;4950  }4951  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:04952  function matchTokenAt_21(token, context) {4953    if(match_EOF(context, token)) {4954      endRule(context, 'DataTable');4955      endRule(context, 'Step');4956      endRule(context, 'ScenarioOutline');4957      endRule(context, 'Scenario_Definition');4958      endRule(context, 'Feature');4959      build(context, token);4960      return 27;4961    }4962    if(match_TableRow(context, token)) {4963      build(context, token);4964      return 21;4965    }4966    if(match_StepLine(context, token)) {4967      endRule(context, 'DataTable');4968      endRule(context, 'Step');4969      startRule(context, 'Step');4970      build(context, token);4971      return 20;4972    }4973    if(match_TagLine(context, token)) {4974      if(lookahead_0(context, token)) {4975      endRule(context, 'DataTable');4976      endRule(context, 'Step');4977      startRule(context, 'Examples_Definition');4978      startRule(context, 'Tags');4979      build(context, token);4980      return 22;4981      }4982    }4983    if(match_TagLine(context, token)) {4984      endRule(context, 'DataTable');4985      endRule(context, 'Step');4986      endRule(context, 'ScenarioOutline');4987      endRule(context, 'Scenario_Definition');4988      startRule(context, 'Scenario_Definition');4989      startRule(context, 'Tags');4990      build(context, token);4991      return 11;4992    }4993    if(match_ExamplesLine(context, token)) {4994      endRule(context, 'DataTable');4995      endRule(context, 'Step');4996      startRule(context, 'Examples_Definition');4997      startRule(context, 'Examples');4998      build(context, token);4999      return 23;5000    }5001    if(match_ScenarioLine(context, token)) {5002      endRule(context, 'DataTable');5003      endRule(context, 'Step');5004      endRule(context, 'ScenarioOutline');5005      endRule(context, 'Scenario_Definition');5006      startRule(context, 'Scenario_Definition');5007      startRule(context, 'Scenario');5008      build(context, token);5009      return 12;5010    }5011    if(match_ScenarioOutlineLine(context, token)) {5012      endRule(context, 'DataTable');5013      endRule(context, 'Step');5014      endRule(context, 'ScenarioOutline');5015      endRule(context, 'Scenario_Definition');5016      startRule(context, 'Scenario_Definition');5017      startRule(context, 'ScenarioOutline');5018      build(context, token);5019      return 17;5020    }5021    if(match_Comment(context, token)) {5022      build(context, token);5023      return 21;5024    }5025    if(match_Empty(context, token)) {5026      build(context, token);5027      return 21;5028    }5029    5030    var stateComment = "State: 21 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";5031    token.detach();5032    var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5033    var error = token.isEof ?5034      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5035      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5036    if (self.stopAtFirstError) throw error;5037    addError(context, error);5038    return 21;5039  }5040  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:05041  function matchTokenAt_22(token, context) {5042    if(match_TagLine(context, token)) {5043      build(context, token);5044      return 22;5045    }5046    if(match_ExamplesLine(context, token)) {5047      endRule(context, 'Tags');5048      startRule(context, 'Examples');5049      build(context, token);5050      return 23;5051    }5052    if(match_Comment(context, token)) {5053      build(context, token);5054      return 22;5055    }5056    if(match_Empty(context, token)) {5057      build(context, token);5058      return 22;5059    }5060    5061    var stateComment = "State: 22 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0";5062    token.detach();5063    var expectedTokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"];5064    var error = token.isEof ?5065      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5066      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5067    if (self.stopAtFirstError) throw error;5068    addError(context, error);5069    return 22;5070  }5071  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:05072  function matchTokenAt_23(token, context) {5073    if(match_EOF(context, token)) {5074      endRule(context, 'Examples');5075      endRule(context, 'Examples_Definition');5076      endRule(context, 'ScenarioOutline');5077      endRule(context, 'Scenario_Definition');5078      endRule(context, 'Feature');5079      build(context, token);5080      return 27;5081    }5082    if(match_Empty(context, token)) {5083      build(context, token);5084      return 23;5085    }5086    if(match_Comment(context, token)) {5087      build(context, token);5088      return 25;5089    }5090    if(match_TableRow(context, token)) {5091      startRule(context, 'Examples_Table');5092      build(context, token);5093      return 26;5094    }5095    if(match_TagLine(context, token)) {5096      if(lookahead_0(context, token)) {5097      endRule(context, 'Examples');5098      endRule(context, 'Examples_Definition');5099      startRule(context, 'Examples_Definition');5100      startRule(context, 'Tags');5101      build(context, token);5102      return 22;5103      }5104    }5105    if(match_TagLine(context, token)) {5106      endRule(context, 'Examples');5107      endRule(context, 'Examples_Definition');5108      endRule(context, 'ScenarioOutline');5109      endRule(context, 'Scenario_Definition');5110      startRule(context, 'Scenario_Definition');5111      startRule(context, 'Tags');5112      build(context, token);5113      return 11;5114    }5115    if(match_ExamplesLine(context, token)) {5116      endRule(context, 'Examples');5117      endRule(context, 'Examples_Definition');5118      startRule(context, 'Examples_Definition');5119      startRule(context, 'Examples');5120      build(context, token);5121      return 23;5122    }5123    if(match_ScenarioLine(context, token)) {5124      endRule(context, 'Examples');5125      endRule(context, 'Examples_Definition');5126      endRule(context, 'ScenarioOutline');5127      endRule(context, 'Scenario_Definition');5128      startRule(context, 'Scenario_Definition');5129      startRule(context, 'Scenario');5130      build(context, token);5131      return 12;5132    }5133    if(match_ScenarioOutlineLine(context, token)) {5134      endRule(context, 'Examples');5135      endRule(context, 'Examples_Definition');5136      endRule(context, 'ScenarioOutline');5137      endRule(context, 'Scenario_Definition');5138      startRule(context, 'Scenario_Definition');5139      startRule(context, 'ScenarioOutline');5140      build(context, token);5141      return 17;5142    }5143    if(match_Other(context, token)) {5144      startRule(context, 'Description');5145      build(context, token);5146      return 24;5147    }5148    5149    var stateComment = "State: 23 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0";5150    token.detach();5151    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];5152    var error = token.isEof ?5153      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5154      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5155    if (self.stopAtFirstError) throw error;5156    addError(context, error);5157    return 23;5158  }5159  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>#Other:05160  function matchTokenAt_24(token, context) {5161    if(match_EOF(context, token)) {5162      endRule(context, 'Description');5163      endRule(context, 'Examples');5164      endRule(context, 'Examples_Definition');5165      endRule(context, 'ScenarioOutline');5166      endRule(context, 'Scenario_Definition');5167      endRule(context, 'Feature');5168      build(context, token);5169      return 27;5170    }5171    if(match_Comment(context, token)) {5172      endRule(context, 'Description');5173      build(context, token);5174      return 25;5175    }5176    if(match_TableRow(context, token)) {5177      endRule(context, 'Description');5178      startRule(context, 'Examples_Table');5179      build(context, token);5180      return 26;5181    }5182    if(match_TagLine(context, token)) {5183      if(lookahead_0(context, token)) {5184      endRule(context, 'Description');5185      endRule(context, 'Examples');5186      endRule(context, 'Examples_Definition');5187      startRule(context, 'Examples_Definition');5188      startRule(context, 'Tags');5189      build(context, token);5190      return 22;5191      }5192    }5193    if(match_TagLine(context, token)) {5194      endRule(context, 'Description');5195      endRule(context, 'Examples');5196      endRule(context, 'Examples_Definition');5197      endRule(context, 'ScenarioOutline');5198      endRule(context, 'Scenario_Definition');5199      startRule(context, 'Scenario_Definition');5200      startRule(context, 'Tags');5201      build(context, token);5202      return 11;5203    }5204    if(match_ExamplesLine(context, token)) {5205      endRule(context, 'Description');5206      endRule(context, 'Examples');5207      endRule(context, 'Examples_Definition');5208      startRule(context, 'Examples_Definition');5209      startRule(context, 'Examples');5210      build(context, token);5211      return 23;5212    }5213    if(match_ScenarioLine(context, token)) {5214      endRule(context, 'Description');5215      endRule(context, 'Examples');5216      endRule(context, 'Examples_Definition');5217      endRule(context, 'ScenarioOutline');5218      endRule(context, 'Scenario_Definition');5219      startRule(context, 'Scenario_Definition');5220      startRule(context, 'Scenario');5221      build(context, token);5222      return 12;5223    }5224    if(match_ScenarioOutlineLine(context, token)) {5225      endRule(context, 'Description');5226      endRule(context, 'Examples');5227      endRule(context, 'Examples_Definition');5228      endRule(context, 'ScenarioOutline');5229      endRule(context, 'Scenario_Definition');5230      startRule(context, 'Scenario_Definition');5231      startRule(context, 'ScenarioOutline');5232      build(context, token);5233      return 17;5234    }5235    if(match_Other(context, token)) {5236      build(context, token);5237      return 24;5238    }5239    5240    var stateComment = "State: 24 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>#Other:0";5241    token.detach();5242    var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];5243    var error = token.isEof ?5244      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5245      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5246    if (self.stopAtFirstError) throw error;5247    addError(context, error);5248    return 24;5249  }5250  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:2>#Comment:05251  function matchTokenAt_25(token, context) {5252    if(match_EOF(context, token)) {5253      endRule(context, 'Examples');5254      endRule(context, 'Examples_Definition');5255      endRule(context, 'ScenarioOutline');5256      endRule(context, 'Scenario_Definition');5257      endRule(context, 'Feature');5258      build(context, token);5259      return 27;5260    }5261    if(match_Comment(context, token)) {5262      build(context, token);5263      return 25;5264    }5265    if(match_TableRow(context, token)) {5266      startRule(context, 'Examples_Table');5267      build(context, token);5268      return 26;5269    }5270    if(match_TagLine(context, token)) {5271      if(lookahead_0(context, token)) {5272      endRule(context, 'Examples');5273      endRule(context, 'Examples_Definition');5274      startRule(context, 'Examples_Definition');5275      startRule(context, 'Tags');5276      build(context, token);5277      return 22;5278      }5279    }5280    if(match_TagLine(context, token)) {5281      endRule(context, 'Examples');5282      endRule(context, 'Examples_Definition');5283      endRule(context, 'ScenarioOutline');5284      endRule(context, 'Scenario_Definition');5285      startRule(context, 'Scenario_Definition');5286      startRule(context, 'Tags');5287      build(context, token);5288      return 11;5289    }5290    if(match_ExamplesLine(context, token)) {5291      endRule(context, 'Examples');5292      endRule(context, 'Examples_Definition');5293      startRule(context, 'Examples_Definition');5294      startRule(context, 'Examples');5295      build(context, token);5296      return 23;5297    }5298    if(match_ScenarioLine(context, token)) {5299      endRule(context, 'Examples');5300      endRule(context, 'Examples_Definition');5301      endRule(context, 'ScenarioOutline');5302      endRule(context, 'Scenario_Definition');5303      startRule(context, 'Scenario_Definition');5304      startRule(context, 'Scenario');5305      build(context, token);5306      return 12;5307    }5308    if(match_ScenarioOutlineLine(context, token)) {5309      endRule(context, 'Examples');5310      endRule(context, 'Examples_Definition');5311      endRule(context, 'ScenarioOutline');5312      endRule(context, 'Scenario_Definition');5313      startRule(context, 'Scenario_Definition');5314      startRule(context, 'ScenarioOutline');5315      build(context, token);5316      return 17;5317    }5318    if(match_Empty(context, token)) {5319      build(context, token);5320      return 25;5321    }5322    5323    var stateComment = "State: 25 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:2>#Comment:0";5324    token.detach();5325    var expectedTokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];5326    var error = token.isEof ?5327      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5328      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5329    if (self.stopAtFirstError) throw error;5330    addError(context, error);5331    return 25;5332  }5333  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:05334  function matchTokenAt_26(token, context) {5335    if(match_EOF(context, token)) {5336      endRule(context, 'Examples_Table');5337      endRule(context, 'Examples');5338      endRule(context, 'Examples_Definition');5339      endRule(context, 'ScenarioOutline');5340      endRule(context, 'Scenario_Definition');5341      endRule(context, 'Feature');5342      build(context, token);5343      return 27;5344    }5345    if(match_TableRow(context, token)) {5346      build(context, token);5347      return 26;5348    }5349    if(match_TagLine(context, token)) {5350      if(lookahead_0(context, token)) {5351      endRule(context, 'Examples_Table');5352      endRule(context, 'Examples');5353      endRule(context, 'Examples_Definition');5354      startRule(context, 'Examples_Definition');5355      startRule(context, 'Tags');5356      build(context, token);5357      return 22;5358      }5359    }5360    if(match_TagLine(context, token)) {5361      endRule(context, 'Examples_Table');5362      endRule(context, 'Examples');5363      endRule(context, 'Examples_Definition');5364      endRule(context, 'ScenarioOutline');5365      endRule(context, 'Scenario_Definition');5366      startRule(context, 'Scenario_Definition');5367      startRule(context, 'Tags');5368      build(context, token);5369      return 11;5370    }5371    if(match_ExamplesLine(context, token)) {5372      endRule(context, 'Examples_Table');5373      endRule(context, 'Examples');5374      endRule(context, 'Examples_Definition');5375      startRule(context, 'Examples_Definition');5376      startRule(context, 'Examples');5377      build(context, token);5378      return 23;5379    }5380    if(match_ScenarioLine(context, token)) {5381      endRule(context, 'Examples_Table');5382      endRule(context, 'Examples');5383      endRule(context, 'Examples_Definition');5384      endRule(context, 'ScenarioOutline');5385      endRule(context, 'Scenario_Definition');5386      startRule(context, 'Scenario_Definition');5387      startRule(context, 'Scenario');5388      build(context, token);5389      return 12;5390    }5391    if(match_ScenarioOutlineLine(context, token)) {5392      endRule(context, 'Examples_Table');5393      endRule(context, 'Examples');5394      endRule(context, 'Examples_Definition');5395      endRule(context, 'ScenarioOutline');5396      endRule(context, 'Scenario_Definition');5397      startRule(context, 'Scenario_Definition');5398      startRule(context, 'ScenarioOutline');5399      build(context, token);5400      return 17;5401    }5402    if(match_Comment(context, token)) {5403      build(context, token);5404      return 26;5405    }5406    if(match_Empty(context, token)) {5407      build(context, token);5408      return 26;5409    }5410    5411    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";5412    token.detach();5413    var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5414    var error = token.isEof ?5415      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5416      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5417    if (self.stopAtFirstError) throw error;5418    addError(context, error);5419    return 26;5420  }5421  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:05422  function matchTokenAt_28(token, context) {5423    if(match_DocStringSeparator(context, token)) {5424      build(context, token);5425      return 29;5426    }5427    if(match_Other(context, token)) {5428      build(context, token);5429      return 28;5430    }5431    5432    var stateComment = "State: 28 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";5433    token.detach();5434    var expectedTokens = ["#DocStringSeparator", "#Other"];5435    var error = token.isEof ?5436      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5437      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5438    if (self.stopAtFirstError) throw error;5439    addError(context, error);5440    return 28;5441  }5442  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:05443  function matchTokenAt_29(token, context) {5444    if(match_EOF(context, token)) {5445      endRule(context, 'DocString');5446      endRule(context, 'Step');5447      endRule(context, 'ScenarioOutline');5448      endRule(context, 'Scenario_Definition');5449      endRule(context, 'Feature');5450      build(context, token);5451      return 27;5452    }5453    if(match_StepLine(context, token)) {5454      endRule(context, 'DocString');5455      endRule(context, 'Step');5456      startRule(context, 'Step');5457      build(context, token);5458      return 20;5459    }5460    if(match_TagLine(context, token)) {5461      if(lookahead_0(context, token)) {5462      endRule(context, 'DocString');5463      endRule(context, 'Step');5464      startRule(context, 'Examples_Definition');5465      startRule(context, 'Tags');5466      build(context, token);5467      return 22;5468      }5469    }5470    if(match_TagLine(context, token)) {5471      endRule(context, 'DocString');5472      endRule(context, 'Step');5473      endRule(context, 'ScenarioOutline');5474      endRule(context, 'Scenario_Definition');5475      startRule(context, 'Scenario_Definition');5476      startRule(context, 'Tags');5477      build(context, token);5478      return 11;5479    }5480    if(match_ExamplesLine(context, token)) {5481      endRule(context, 'DocString');5482      endRule(context, 'Step');5483      startRule(context, 'Examples_Definition');5484      startRule(context, 'Examples');5485      build(context, token);5486      return 23;5487    }5488    if(match_ScenarioLine(context, token)) {5489      endRule(context, 'DocString');5490      endRule(context, 'Step');5491      endRule(context, 'ScenarioOutline');5492      endRule(context, 'Scenario_Definition');5493      startRule(context, 'Scenario_Definition');5494      startRule(context, 'Scenario');5495      build(context, token);5496      return 12;5497    }5498    if(match_ScenarioOutlineLine(context, token)) {5499      endRule(context, 'DocString');5500      endRule(context, 'Step');5501      endRule(context, 'ScenarioOutline');5502      endRule(context, 'Scenario_Definition');5503      startRule(context, 'Scenario_Definition');5504      startRule(context, 'ScenarioOutline');5505      build(context, token);5506      return 17;5507    }5508    if(match_Comment(context, token)) {5509      build(context, token);5510      return 29;5511    }5512    if(match_Empty(context, token)) {5513      build(context, token);5514      return 29;5515    }5516    5517    var stateComment = "State: 29 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";5518    token.detach();5519    var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5520    var error = token.isEof ?5521      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5522      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5523    if (self.stopAtFirstError) throw error;5524    addError(context, error);5525    return 29;5526  }5527  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:05528  function matchTokenAt_30(token, context) {5529    if(match_DocStringSeparator(context, token)) {5530      build(context, token);5531      return 31;5532    }5533    if(match_Other(context, token)) {5534      build(context, token);5535      return 30;5536    }5537    5538    var stateComment = "State: 30 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";5539    token.detach();5540    var expectedTokens = ["#DocStringSeparator", "#Other"];5541    var error = token.isEof ?5542      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5543      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5544    if (self.stopAtFirstError) throw error;5545    addError(context, error);5546    return 30;5547  }5548  // GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:05549  function matchTokenAt_31(token, context) {5550    if(match_EOF(context, token)) {5551      endRule(context, 'DocString');5552      endRule(context, 'Step');5553      endRule(context, 'Scenario');5554      endRule(context, 'Scenario_Definition');5555      endRule(context, 'Feature');5556      build(context, token);5557      return 27;5558    }5559    if(match_StepLine(context, token)) {5560      endRule(context, 'DocString');5561      endRule(context, 'Step');5562      startRule(context, 'Step');5563      build(context, token);5564      return 15;5565    }5566    if(match_TagLine(context, token)) {5567      endRule(context, 'DocString');5568      endRule(context, 'Step');5569      endRule(context, 'Scenario');5570      endRule(context, 'Scenario_Definition');5571      startRule(context, 'Scenario_Definition');5572      startRule(context, 'Tags');5573      build(context, token);5574      return 11;5575    }5576    if(match_ScenarioLine(context, token)) {5577      endRule(context, 'DocString');5578      endRule(context, 'Step');5579      endRule(context, 'Scenario');5580      endRule(context, 'Scenario_Definition');5581      startRule(context, 'Scenario_Definition');5582      startRule(context, 'Scenario');5583      build(context, token);5584      return 12;5585    }5586    if(match_ScenarioOutlineLine(context, token)) {5587      endRule(context, 'DocString');5588      endRule(context, 'Step');5589      endRule(context, 'Scenario');5590      endRule(context, 'Scenario_Definition');5591      startRule(context, 'Scenario_Definition');5592      startRule(context, 'ScenarioOutline');5593      build(context, token);5594      return 17;5595    }5596    if(match_Comment(context, token)) {5597      build(context, token);5598      return 31;5599    }5600    if(match_Empty(context, token)) {5601      build(context, token);5602      return 31;5603    }5604    5605    var stateComment = "State: 31 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";5606    token.detach();5607    var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5608    var error = token.isEof ?5609      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5610      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5611    if (self.stopAtFirstError) throw error;5612    addError(context, error);5613    return 31;5614  }5615  // GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:05616  function matchTokenAt_32(token, context) {5617    if(match_DocStringSeparator(context, token)) {5618      build(context, token);5619      return 33;5620    }5621    if(match_Other(context, token)) {5622      build(context, token);5623      return 32;5624    }5625    5626    var stateComment = "State: 32 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";5627    token.detach();5628    var expectedTokens = ["#DocStringSeparator", "#Other"];5629    var error = token.isEof ?5630      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5631      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5632    if (self.stopAtFirstError) throw error;5633    addError(context, error);5634    return 32;5635  }5636  // GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:05637  function matchTokenAt_33(token, context) {5638    if(match_EOF(context, token)) {5639      endRule(context, 'DocString');5640      endRule(context, 'Step');5641      endRule(context, 'Background');5642      endRule(context, 'Feature');5643      build(context, token);5644      return 27;5645    }5646    if(match_StepLine(context, token)) {5647      endRule(context, 'DocString');5648      endRule(context, 'Step');5649      startRule(context, 'Step');5650      build(context, token);5651      return 9;5652    }5653    if(match_TagLine(context, token)) {5654      endRule(context, 'DocString');5655      endRule(context, 'Step');5656      endRule(context, 'Background');5657      startRule(context, 'Scenario_Definition');5658      startRule(context, 'Tags');5659      build(context, token);5660      return 11;5661    }5662    if(match_ScenarioLine(context, token)) {5663      endRule(context, 'DocString');5664      endRule(context, 'Step');5665      endRule(context, 'Background');5666      startRule(context, 'Scenario_Definition');5667      startRule(context, 'Scenario');5668      build(context, token);5669      return 12;5670    }5671    if(match_ScenarioOutlineLine(context, token)) {5672      endRule(context, 'DocString');5673      endRule(context, 'Step');5674      endRule(context, 'Background');5675      startRule(context, 'Scenario_Definition');5676      startRule(context, 'ScenarioOutline');5677      build(context, token);5678      return 17;5679    }5680    if(match_Comment(context, token)) {5681      build(context, token);5682      return 33;5683    }5684    if(match_Empty(context, token)) {5685      build(context, token);5686      return 33;5687    }5688    5689    var stateComment = "State: 33 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";5690    token.detach();5691    var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];5692    var error = token.isEof ?5693      Errors.UnexpectedEOFException.create(token, expectedTokens, stateComment) :5694      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);5695    if (self.stopAtFirstError) throw error;5696    addError(context, error);5697    return 33;5698  }5699  function match_EOF(context, token) {5700    return handleExternalError(context, false, function () {5701      return context.tokenMatcher.match_EOF(token);5702    });5703  }5704  function match_Empty(context, token) {5705    if(token.isEof) return false;5706    return handleExternalError(context, false, function () {5707      return context.tokenMatcher.match_Empty(token);5708    });5709  }5710  function match_Comment(context, token) {5711    if(token.isEof) return false;5712    return handleExternalError(context, false, function () {5713      return context.tokenMatcher.match_Comment(token);5714    });5715  }5716  function match_TagLine(context, token) {5717    if(token.isEof) return false;5718    return handleExternalError(context, false, function () {5719      return context.tokenMatcher.match_TagLine(token);5720    });5721  }5722  function match_FeatureLine(context, token) {5723    if(token.isEof) return false;5724    return handleExternalError(context, false, function () {5725      return context.tokenMatcher.match_FeatureLine(token);5726    });5727  }5728  function match_BackgroundLine(context, token) {5729    if(token.isEof) return false;5730    return handleExternalError(context, false, function () {5731      return context.tokenMatcher.match_BackgroundLine(token);5732    });5733  }5734  function match_ScenarioLine(context, token) {5735    if(token.isEof) return false;5736    return handleExternalError(context, false, function () {5737      return context.tokenMatcher.match_ScenarioLine(token);5738    });5739  }5740  function match_ScenarioOutlineLine(context, token) {5741    if(token.isEof) return false;5742    return handleExternalError(context, false, function () {5743      return context.tokenMatcher.match_ScenarioOutlineLine(token);5744    });5745  }5746  function match_ExamplesLine(context, token) {5747    if(token.isEof) return false;5748    return handleExternalError(context, false, function () {5749      return context.tokenMatcher.match_ExamplesLine(token);5750    });5751  }5752  function match_StepLine(context, token) {5753    if(token.isEof) return false;5754    return handleExternalError(context, false, function () {5755      return context.tokenMatcher.match_StepLine(token);5756    });5757  }5758  function match_DocStringSeparator(context, token) {5759    if(token.isEof) return false;5760    return handleExternalError(context, false, function () {5761      return context.tokenMatcher.match_DocStringSeparator(token);5762    });5763  }5764  function match_TableRow(context, token) {5765    if(token.isEof) return false;5766    return handleExternalError(context, false, function () {5767      return context.tokenMatcher.match_TableRow(token);5768    });5769  }5770  function match_Language(context, token) {5771    if(token.isEof) return false;5772    return handleExternalError(context, false, function () {5773      return context.tokenMatcher.match_Language(token);5774    });5775  }5776  function match_Other(context, token) {5777    if(token.isEof) return false;5778    return handleExternalError(context, false, function () {5779      return context.tokenMatcher.match_Other(token);5780    });5781  }5782  function lookahead_0(context, currentToken) {5783    currentToken.detach();5784    var token;5785    var queue = [];5786    var match = false;5787    do {5788      token = readToken(context);5789      token.detach();5790      queue.push(token);5791      if (false  || match_ExamplesLine(context, token)) {5792        match = true;5793        break;5794      }5795    } while(false  || match_Empty(context, token) || match_Comment(context, token) || match_TagLine(context, token));5796    context.tokenQueue = context.tokenQueue.concat(queue);5797    return match;5798  }5799}5800},{"./ast_builder":2,"./errors":6,"./token_matcher":12,"./token_scanner":13}],10:[function(require,module,exports){5801var countSymbols = require('../count_symbols')5802function Compiler() {5803  this.compile = function (gherkin_document, path) {5804    var pickles = [];5805    if (gherkin_document.feature == null) return pickles;5806    var feature = gherkin_document.feature;5807    var featureTags = feature.tags;5808    var backgroundSteps = [];5809    feature.children.forEach(function (scenarioDefinition) {5810      if(scenarioDefinition.type === 'Background') {5811        backgroundSteps = pickleSteps(scenarioDefinition, path);5812      } else if(scenarioDefinition.type === 'Scenario') {5813        compileScenario(featureTags, backgroundSteps, scenarioDefinition, path, pickles);5814      } else {5815        compileScenarioOutline(featureTags, backgroundSteps, scenarioDefinition, path, pickles);5816      }5817    });5818    return pickles;5819  };5820  function compileScenario(featureTags, backgroundSteps, scenario, path, pickles) {5821    if (scenario.steps.length == 0) return;5822    var steps = [].concat(backgroundSteps);5823    var tags = [].concat(featureTags).concat(scenario.tags);5824    scenario.steps.forEach(function (step) {5825      steps.push(pickleStep(step, path));5826    });5827    var pickle = {5828      tags: pickleTags(tags, path),5829      name: scenario.name,5830      locations: [pickleLocation(scenario.location, path)],5831      steps: steps5832    };5833    pickles.push(pickle);5834  }5835  function compileScenarioOutline(featureTags, backgroundSteps, scenarioOutline, path, pickles) {5836    if (scenarioOutline.steps.length == 0) return;5837    scenarioOutline.examples.filter(function(e) { return e.tableHeader != undefined; }).forEach(function (examples) {5838      var variableCells = examples.tableHeader.cells;5839      examples.tableBody.forEach(function (values) {5840        var valueCells = values.cells;5841        var steps = [].concat(backgroundSteps);5842        var tags = [].concat(featureTags).concat(scenarioOutline.tags).concat(examples.tags);5843        scenarioOutline.steps.forEach(function (scenarioOutlineStep) {5844          var stepText = interpolate(scenarioOutlineStep.text, variableCells, valueCells);5845          var args = createPickleArguments(scenarioOutlineStep.argument, variableCells, valueCells, path);5846          var pickleStep = {5847            text: stepText,5848            arguments: args,5849            locations: [5850              pickleLocation(values.location, path),5851              pickleStepLocation(scenarioOutlineStep, path)5852            ]5853          };5854          steps.push(pickleStep);5855        });5856        var pickle = {5857          name: interpolate(scenarioOutline.name, variableCells, valueCells),5858          steps: steps,5859          tags: pickleTags(tags, path),5860          locations: [5861            pickleLocation(values.location, path),5862            pickleLocation(scenarioOutline.location, path)5863          ]5864        };5865        pickles.push(pickle);5866      });5867    });5868  }5869  function createPickleArguments(argument, variableCells, valueCells, path) {5870    var result = [];5871    if (!argument) return result;5872    if (argument.type === 'DataTable') {5873      var table = {5874        rows: argument.rows.map(function (row) {5875          return {5876            cells: row.cells.map(function (cell) {5877              return {5878                location: pickleLocation(cell.location, path),5879                value: interpolate(cell.value, variableCells, valueCells)5880              };5881            })5882          };5883        })5884      };5885      result.push(table);5886    } else if (argument.type === 'DocString') {5887      var docString = {5888        location: pickleLocation(argument.location, path),5889        content: interpolate(argument.content, variableCells, valueCells)5890      }5891      result.push(docString);5892    } else {5893      throw Error('Internal error');5894    }5895    return result;5896  }5897  function interpolate(name, variableCells, valueCells) {5898    variableCells.forEach(function (variableCell, n) {5899      var valueCell = valueCells[n];5900      var search = new RegExp('<' + variableCell.value + '>', 'g')5901      name = name.replace(search, valueCell.value);5902    });5903    return name;5904  }5905  function pickleSteps(scenarioDefinition, path) {5906    return scenarioDefinition.steps.map(function (step) {5907      return pickleStep(step, path);5908    });5909  }5910  function pickleStep(step, path) {5911    return {5912      text: step.text,5913      arguments: createPickleArguments(step.argument, [], [], path),5914      locations: [pickleStepLocation(step, path)]5915    }5916  }5917  function pickleStepLocation(step, path) {5918    return {5919      path: path,5920      line: step.location.line,5921      column: step.location.column + (step.keyword ? countSymbols(step.keyword) : 0)5922    };5923  }5924  function pickleLocation(location, path) {5925    return {5926      path: path,5927      line: location.line,5928      column: location.column5929    }5930  }5931  function pickleTags(tags, path) {5932    return tags.map(function (tag) {5933      return pickleTag(tag, path);5934    });5935  }5936  function pickleTag(tag, path) {5937    return {5938      name: tag.name,5939      location: pickleLocation(tag.location, path)5940    };5941  }5942}5943module.exports = Compiler;5944},{"../count_symbols":4}],11:[function(require,module,exports){5945function Token(line, location) {5946  this.line = line;5947  this.location = location;5948  this.isEof = line == null;5949};5950Token.prototype.getTokenValue = function () {5951  return this.isEof ? "EOF" : this.line.getLineText(-1);5952};5953Token.prototype.detach = function () {5954  // TODO: Detach line, but is this really needed?5955};5956module.exports = Token;5957},{}],12:[function(require,module,exports){5958var DIALECTS = require('./dialects');5959var Errors = require('./errors');5960var LANGUAGE_PATTERN = /^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/;5961module.exports = function TokenMatcher(defaultDialectName) {5962  defaultDialectName = defaultDialectName || 'en';5963  var dialect;5964  var dialectName;5965  var activeDocStringSeparator;5966  var indentToRemove;5967  function changeDialect(newDialectName, location) {5968    var newDialect = DIALECTS[newDialectName];5969    if(!newDialect) {5970      throw Errors.NoSuchLanguageException.create(newDialectName, location);5971    }5972    dialectName = newDialectName;5973    dialect = newDialect;5974  }5975  this.reset = function () {5976    if(dialectName != defaultDialectName) changeDialect(defaultDialectName);5977    activeDocStringSeparator = null;5978    indentToRemove = 0;5979  };5980  this.reset();5981  this.match_TagLine = function match_TagLine(token) {5982    if(token.line.startsWith('@')) {5983      setTokenMatched(token, 'TagLine', null, null, null, token.line.getTags());5984      return true;5985    }5986    return false;5987  };5988  this.match_FeatureLine = function match_FeatureLine(token) {5989    return matchTitleLine(token, 'FeatureLine', dialect.feature);5990  };5991  this.match_ScenarioLine = function match_ScenarioLine(token) {5992    return matchTitleLine(token, 'ScenarioLine', dialect.scenario);5993  };5994  this.match_ScenarioOutlineLine = function match_ScenarioOutlineLine(token) {5995    return matchTitleLine(token, 'ScenarioOutlineLine', dialect.scenarioOutline);5996  };5997  this.match_BackgroundLine = function match_BackgroundLine(token) {5998    return matchTitleLine(token, 'BackgroundLine', dialect.background);5999  };6000  this.match_ExamplesLine = function match_ExamplesLine(token) {6001    return matchTitleLine(token, 'ExamplesLine', dialect.examples);6002  };6003  this.match_TableRow = function match_TableRow(token) {6004    if (token.line.startsWith('|')) {6005      // TODO: indent6006      setTokenMatched(token, 'TableRow', null, null, null, token.line.getTableCells());6007      return true;6008    }6009    return false;6010  };6011  this.match_Empty = function match_Empty(token) {6012    if (token.line.isEmpty) {6013      setTokenMatched(token, 'Empty', null, null, 0);6014      return true;6015    }6016    return false;6017  };6018  this.match_Comment = function match_Comment(token) {6019    if(token.line.startsWith('#')) {6020      var text = token.line.getLineText(0); //take the entire line, including leading space6021      setTokenMatched(token, 'Comment', text, null, 0);6022      return true;6023    }6024    return false;6025  };6026  this.match_Language = function match_Language(token) {6027    var match;6028    if(match = token.line.trimmedLineText.match(LANGUAGE_PATTERN)) {6029      var newDialectName = match[1];6030      setTokenMatched(token, 'Language', newDialectName);6031      changeDialect(newDialectName, token.location);6032      return true;...

Full Screen

Full Screen

parser.js

Source:parser.js Github

copy

Full Screen

...201      startRule(context, 'Feature_Header');202      build(context, token);203      return 3;204    }205    if(match_Comment(context, token)) {206      build(context, token);207      return 0;208    }209    if(match_Empty(context, token)) {210      build(context, token);211      return 0;212    }213    214    var stateComment = "State: 0 - Start";215    token.detach();216    var expectedTokens = ["#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"];217    var error = token.isEof ?218      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :219      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);220    if (this.stopAtFirstError) throw error;221    addError(context, error);222    return 0;223  }224  // Feature:0>Feature_Header:0>#Language:0225  function matchTokenAt_1(token, context) {226    if(match_TagLine(context, token)) {227      startRule(context, 'Tags');228      build(context, token);229      return 2;230    }231    if(match_FeatureLine(context, token)) {232      build(context, token);233      return 3;234    }235    if(match_Comment(context, token)) {236      build(context, token);237      return 1;238    }239    if(match_Empty(context, token)) {240      build(context, token);241      return 1;242    }243    244    var stateComment = "State: 1 - Feature:0>Feature_Header:0>#Language:0";245    token.detach();246    var expectedTokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"];247    var error = token.isEof ?248      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :249      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);250    if (this.stopAtFirstError) throw error;251    addError(context, error);252    return 1;253  }254  // Feature:0>Feature_Header:1>Tags:0>#TagLine:0255  function matchTokenAt_2(token, context) {256    if(match_TagLine(context, token)) {257      build(context, token);258      return 2;259    }260    if(match_FeatureLine(context, token)) {261      endRule(context, 'Tags');262      build(context, token);263      return 3;264    }265    if(match_Comment(context, token)) {266      build(context, token);267      return 2;268    }269    if(match_Empty(context, token)) {270      build(context, token);271      return 2;272    }273    274    var stateComment = "State: 2 - Feature:0>Feature_Header:1>Tags:0>#TagLine:0";275    token.detach();276    var expectedTokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"];277    var error = token.isEof ?278      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :279      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);280    if (this.stopAtFirstError) throw error;281    addError(context, error);282    return 2;283  }284  // Feature:0>Feature_Header:2>#FeatureLine:0285  function matchTokenAt_3(token, context) {286    if(match_EOF(context, token)) {287      endRule(context, 'Feature_Header');288      build(context, token);289      return 27;290    }291    if(match_Empty(context, token)) {292      build(context, token);293      return 3;294    }295    if(match_Comment(context, token)) {296      build(context, token);297      return 5;298    }299    if(match_BackgroundLine(context, token)) {300      endRule(context, 'Feature_Header');301      startRule(context, 'Background');302      build(context, token);303      return 6;304    }305    if(match_TagLine(context, token)) {306      endRule(context, 'Feature_Header');307      startRule(context, 'Scenario_Definition');308      startRule(context, 'Tags');309      build(context, token);310      return 11;311    }312    if(match_ScenarioLine(context, token)) {313      endRule(context, 'Feature_Header');314      startRule(context, 'Scenario_Definition');315      startRule(context, 'Scenario');316      build(context, token);317      return 12;318    }319    if(match_ScenarioOutlineLine(context, token)) {320      endRule(context, 'Feature_Header');321      startRule(context, 'Scenario_Definition');322      startRule(context, 'ScenarioOutline');323      build(context, token);324      return 17;325    }326    if(match_Other(context, token)) {327      startRule(context, 'Description');328      build(context, token);329      return 4;330    }331    332    var stateComment = "State: 3 - Feature:0>Feature_Header:2>#FeatureLine:0";333    token.detach();334    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];335    var error = token.isEof ?336      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :337      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);338    if (this.stopAtFirstError) throw error;339    addError(context, error);340    return 3;341  }342  // Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0343  function matchTokenAt_4(token, context) {344    if(match_EOF(context, token)) {345      endRule(context, 'Description');346      endRule(context, 'Feature_Header');347      build(context, token);348      return 27;349    }350    if(match_Comment(context, token)) {351      endRule(context, 'Description');352      build(context, token);353      return 5;354    }355    if(match_BackgroundLine(context, token)) {356      endRule(context, 'Description');357      endRule(context, 'Feature_Header');358      startRule(context, 'Background');359      build(context, token);360      return 6;361    }362    if(match_TagLine(context, token)) {363      endRule(context, 'Description');364      endRule(context, 'Feature_Header');365      startRule(context, 'Scenario_Definition');366      startRule(context, 'Tags');367      build(context, token);368      return 11;369    }370    if(match_ScenarioLine(context, token)) {371      endRule(context, 'Description');372      endRule(context, 'Feature_Header');373      startRule(context, 'Scenario_Definition');374      startRule(context, 'Scenario');375      build(context, token);376      return 12;377    }378    if(match_ScenarioOutlineLine(context, token)) {379      endRule(context, 'Description');380      endRule(context, 'Feature_Header');381      startRule(context, 'Scenario_Definition');382      startRule(context, 'ScenarioOutline');383      build(context, token);384      return 17;385    }386    if(match_Other(context, token)) {387      build(context, token);388      return 4;389    }390    391    var stateComment = "State: 4 - Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0";392    token.detach();393    var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];394    var error = token.isEof ?395      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :396      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);397    if (this.stopAtFirstError) throw error;398    addError(context, error);399    return 4;400  }401  // Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0402  function matchTokenAt_5(token, context) {403    if(match_EOF(context, token)) {404      endRule(context, 'Feature_Header');405      build(context, token);406      return 27;407    }408    if(match_Comment(context, token)) {409      build(context, token);410      return 5;411    }412    if(match_BackgroundLine(context, token)) {413      endRule(context, 'Feature_Header');414      startRule(context, 'Background');415      build(context, token);416      return 6;417    }418    if(match_TagLine(context, token)) {419      endRule(context, 'Feature_Header');420      startRule(context, 'Scenario_Definition');421      startRule(context, 'Tags');422      build(context, token);423      return 11;424    }425    if(match_ScenarioLine(context, token)) {426      endRule(context, 'Feature_Header');427      startRule(context, 'Scenario_Definition');428      startRule(context, 'Scenario');429      build(context, token);430      return 12;431    }432    if(match_ScenarioOutlineLine(context, token)) {433      endRule(context, 'Feature_Header');434      startRule(context, 'Scenario_Definition');435      startRule(context, 'ScenarioOutline');436      build(context, token);437      return 17;438    }439    if(match_Empty(context, token)) {440      build(context, token);441      return 5;442    }443    444    var stateComment = "State: 5 - Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0";445    token.detach();446    var expectedTokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];447    var error = token.isEof ?448      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :449      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);450    if (this.stopAtFirstError) throw error;451    addError(context, error);452    return 5;453  }454  // Feature:1>Background:0>#BackgroundLine:0455  function matchTokenAt_6(token, context) {456    if(match_EOF(context, token)) {457      endRule(context, 'Background');458      build(context, token);459      return 27;460    }461    if(match_Empty(context, token)) {462      build(context, token);463      return 6;464    }465    if(match_Comment(context, token)) {466      build(context, token);467      return 8;468    }469    if(match_StepLine(context, token)) {470      startRule(context, 'Step');471      build(context, token);472      return 9;473    }474    if(match_TagLine(context, token)) {475      endRule(context, 'Background');476      startRule(context, 'Scenario_Definition');477      startRule(context, 'Tags');478      build(context, token);479      return 11;480    }481    if(match_ScenarioLine(context, token)) {482      endRule(context, 'Background');483      startRule(context, 'Scenario_Definition');484      startRule(context, 'Scenario');485      build(context, token);486      return 12;487    }488    if(match_ScenarioOutlineLine(context, token)) {489      endRule(context, 'Background');490      startRule(context, 'Scenario_Definition');491      startRule(context, 'ScenarioOutline');492      build(context, token);493      return 17;494    }495    if(match_Other(context, token)) {496      startRule(context, 'Description');497      build(context, token);498      return 7;499    }500    501    var stateComment = "State: 6 - Feature:1>Background:0>#BackgroundLine:0";502    token.detach();503    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];504    var error = token.isEof ?505      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :506      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);507    if (this.stopAtFirstError) throw error;508    addError(context, error);509    return 6;510  }511  // Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0512  function matchTokenAt_7(token, context) {513    if(match_EOF(context, token)) {514      endRule(context, 'Description');515      endRule(context, 'Background');516      build(context, token);517      return 27;518    }519    if(match_Comment(context, token)) {520      endRule(context, 'Description');521      build(context, token);522      return 8;523    }524    if(match_StepLine(context, token)) {525      endRule(context, 'Description');526      startRule(context, 'Step');527      build(context, token);528      return 9;529    }530    if(match_TagLine(context, token)) {531      endRule(context, 'Description');532      endRule(context, 'Background');533      startRule(context, 'Scenario_Definition');534      startRule(context, 'Tags');535      build(context, token);536      return 11;537    }538    if(match_ScenarioLine(context, token)) {539      endRule(context, 'Description');540      endRule(context, 'Background');541      startRule(context, 'Scenario_Definition');542      startRule(context, 'Scenario');543      build(context, token);544      return 12;545    }546    if(match_ScenarioOutlineLine(context, token)) {547      endRule(context, 'Description');548      endRule(context, 'Background');549      startRule(context, 'Scenario_Definition');550      startRule(context, 'ScenarioOutline');551      build(context, token);552      return 17;553    }554    if(match_Other(context, token)) {555      build(context, token);556      return 7;557    }558    559    var stateComment = "State: 7 - Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0";560    token.detach();561    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];562    var error = token.isEof ?563      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :564      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);565    if (this.stopAtFirstError) throw error;566    addError(context, error);567    return 7;568  }569  // Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0570  function matchTokenAt_8(token, context) {571    if(match_EOF(context, token)) {572      endRule(context, 'Background');573      build(context, token);574      return 27;575    }576    if(match_Comment(context, token)) {577      build(context, token);578      return 8;579    }580    if(match_StepLine(context, token)) {581      startRule(context, 'Step');582      build(context, token);583      return 9;584    }585    if(match_TagLine(context, token)) {586      endRule(context, 'Background');587      startRule(context, 'Scenario_Definition');588      startRule(context, 'Tags');589      build(context, token);590      return 11;591    }592    if(match_ScenarioLine(context, token)) {593      endRule(context, 'Background');594      startRule(context, 'Scenario_Definition');595      startRule(context, 'Scenario');596      build(context, token);597      return 12;598    }599    if(match_ScenarioOutlineLine(context, token)) {600      endRule(context, 'Background');601      startRule(context, 'Scenario_Definition');602      startRule(context, 'ScenarioOutline');603      build(context, token);604      return 17;605    }606    if(match_Empty(context, token)) {607      build(context, token);608      return 8;609    }610    611    var stateComment = "State: 8 - Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0";612    token.detach();613    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];614    var error = token.isEof ?615      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :616      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);617    if (this.stopAtFirstError) throw error;618    addError(context, error);619    return 8;620  }621  // Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0622  function matchTokenAt_9(token, context) {623    if(match_EOF(context, token)) {624      endRule(context, 'Step');625      endRule(context, 'Background');626      build(context, token);627      return 27;628    }629    if(match_TableRow(context, token)) {630      startRule(context, 'DataTable');631      build(context, token);632      return 10;633    }634    if(match_DocStringSeparator(context, token)) {635      startRule(context, 'DocString');636      build(context, token);637      return 32;638    }639    if(match_StepLine(context, token)) {640      endRule(context, 'Step');641      startRule(context, 'Step');642      build(context, token);643      return 9;644    }645    if(match_TagLine(context, token)) {646      endRule(context, 'Step');647      endRule(context, 'Background');648      startRule(context, 'Scenario_Definition');649      startRule(context, 'Tags');650      build(context, token);651      return 11;652    }653    if(match_ScenarioLine(context, token)) {654      endRule(context, 'Step');655      endRule(context, 'Background');656      startRule(context, 'Scenario_Definition');657      startRule(context, 'Scenario');658      build(context, token);659      return 12;660    }661    if(match_ScenarioOutlineLine(context, token)) {662      endRule(context, 'Step');663      endRule(context, 'Background');664      startRule(context, 'Scenario_Definition');665      startRule(context, 'ScenarioOutline');666      build(context, token);667      return 17;668    }669    if(match_Comment(context, token)) {670      build(context, token);671      return 9;672    }673    if(match_Empty(context, token)) {674      build(context, token);675      return 9;676    }677    678    var stateComment = "State: 9 - Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0";679    token.detach();680    var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];681    var error = token.isEof ?682      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :683      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);684    if (this.stopAtFirstError) throw error;685    addError(context, error);686    return 9;687  }688  // Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0689  function matchTokenAt_10(token, context) {690    if(match_EOF(context, token)) {691      endRule(context, 'DataTable');692      endRule(context, 'Step');693      endRule(context, 'Background');694      build(context, token);695      return 27;696    }697    if(match_TableRow(context, token)) {698      build(context, token);699      return 10;700    }701    if(match_StepLine(context, token)) {702      endRule(context, 'DataTable');703      endRule(context, 'Step');704      startRule(context, 'Step');705      build(context, token);706      return 9;707    }708    if(match_TagLine(context, token)) {709      endRule(context, 'DataTable');710      endRule(context, 'Step');711      endRule(context, 'Background');712      startRule(context, 'Scenario_Definition');713      startRule(context, 'Tags');714      build(context, token);715      return 11;716    }717    if(match_ScenarioLine(context, token)) {718      endRule(context, 'DataTable');719      endRule(context, 'Step');720      endRule(context, 'Background');721      startRule(context, 'Scenario_Definition');722      startRule(context, 'Scenario');723      build(context, token);724      return 12;725    }726    if(match_ScenarioOutlineLine(context, token)) {727      endRule(context, 'DataTable');728      endRule(context, 'Step');729      endRule(context, 'Background');730      startRule(context, 'Scenario_Definition');731      startRule(context, 'ScenarioOutline');732      build(context, token);733      return 17;734    }735    if(match_Comment(context, token)) {736      build(context, token);737      return 10;738    }739    if(match_Empty(context, token)) {740      build(context, token);741      return 10;742    }743    744    var stateComment = "State: 10 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";745    token.detach();746    var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];747    var error = token.isEof ?748      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :749      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);750    if (this.stopAtFirstError) throw error;751    addError(context, error);752    return 10;753  }754  // Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0755  function matchTokenAt_11(token, context) {756    if(match_TagLine(context, token)) {757      build(context, token);758      return 11;759    }760    if(match_ScenarioLine(context, token)) {761      endRule(context, 'Tags');762      startRule(context, 'Scenario');763      build(context, token);764      return 12;765    }766    if(match_ScenarioOutlineLine(context, token)) {767      endRule(context, 'Tags');768      startRule(context, 'ScenarioOutline');769      build(context, token);770      return 17;771    }772    if(match_Comment(context, token)) {773      build(context, token);774      return 11;775    }776    if(match_Empty(context, token)) {777      build(context, token);778      return 11;779    }780    781    var stateComment = "State: 11 - Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0";782    token.detach();783    var expectedTokens = ["#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];784    var error = token.isEof ?785      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :786      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);787    if (this.stopAtFirstError) throw error;788    addError(context, error);789    return 11;790  }791  // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0792  function matchTokenAt_12(token, context) {793    if(match_EOF(context, token)) {794      endRule(context, 'Scenario');795      endRule(context, 'Scenario_Definition');796      build(context, token);797      return 27;798    }799    if(match_Empty(context, token)) {800      build(context, token);801      return 12;802    }803    if(match_Comment(context, token)) {804      build(context, token);805      return 14;806    }807    if(match_StepLine(context, token)) {808      startRule(context, 'Step');809      build(context, token);810      return 15;811    }812    if(match_TagLine(context, token)) {813      endRule(context, 'Scenario');814      endRule(context, 'Scenario_Definition');815      startRule(context, 'Scenario_Definition');816      startRule(context, 'Tags');817      build(context, token);818      return 11;819    }820    if(match_ScenarioLine(context, token)) {821      endRule(context, 'Scenario');822      endRule(context, 'Scenario_Definition');823      startRule(context, 'Scenario_Definition');824      startRule(context, 'Scenario');825      build(context, token);826      return 12;827    }828    if(match_ScenarioOutlineLine(context, token)) {829      endRule(context, 'Scenario');830      endRule(context, 'Scenario_Definition');831      startRule(context, 'Scenario_Definition');832      startRule(context, 'ScenarioOutline');833      build(context, token);834      return 17;835    }836    if(match_Other(context, token)) {837      startRule(context, 'Description');838      build(context, token);839      return 13;840    }841    842    var stateComment = "State: 12 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0";843    token.detach();844    var expectedTokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];845    var error = token.isEof ?846      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :847      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);848    if (this.stopAtFirstError) throw error;849    addError(context, error);850    return 12;851  }852  // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0853  function matchTokenAt_13(token, context) {854    if(match_EOF(context, token)) {855      endRule(context, 'Description');856      endRule(context, 'Scenario');857      endRule(context, 'Scenario_Definition');858      build(context, token);859      return 27;860    }861    if(match_Comment(context, token)) {862      endRule(context, 'Description');863      build(context, token);864      return 14;865    }866    if(match_StepLine(context, token)) {867      endRule(context, 'Description');868      startRule(context, 'Step');869      build(context, token);870      return 15;871    }872    if(match_TagLine(context, token)) {873      endRule(context, 'Description');874      endRule(context, 'Scenario');875      endRule(context, 'Scenario_Definition');876      startRule(context, 'Scenario_Definition');877      startRule(context, 'Tags');878      build(context, token);879      return 11;880    }881    if(match_ScenarioLine(context, token)) {882      endRule(context, 'Description');883      endRule(context, 'Scenario');884      endRule(context, 'Scenario_Definition');885      startRule(context, 'Scenario_Definition');886      startRule(context, 'Scenario');887      build(context, token);888      return 12;889    }890    if(match_ScenarioOutlineLine(context, token)) {891      endRule(context, 'Description');892      endRule(context, 'Scenario');893      endRule(context, 'Scenario_Definition');894      startRule(context, 'Scenario_Definition');895      startRule(context, 'ScenarioOutline');896      build(context, token);897      return 17;898    }899    if(match_Other(context, token)) {900      build(context, token);901      return 13;902    }903    904    var stateComment = "State: 13 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0";905    token.detach();906    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"];907    var error = token.isEof ?908      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :909      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);910    if (this.stopAtFirstError) throw error;911    addError(context, error);912    return 13;913  }914  // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0915  function matchTokenAt_14(token, context) {916    if(match_EOF(context, token)) {917      endRule(context, 'Scenario');918      endRule(context, 'Scenario_Definition');919      build(context, token);920      return 27;921    }922    if(match_Comment(context, token)) {923      build(context, token);924      return 14;925    }926    if(match_StepLine(context, token)) {927      startRule(context, 'Step');928      build(context, token);929      return 15;930    }931    if(match_TagLine(context, token)) {932      endRule(context, 'Scenario');933      endRule(context, 'Scenario_Definition');934      startRule(context, 'Scenario_Definition');935      startRule(context, 'Tags');936      build(context, token);937      return 11;938    }939    if(match_ScenarioLine(context, token)) {940      endRule(context, 'Scenario');941      endRule(context, 'Scenario_Definition');942      startRule(context, 'Scenario_Definition');943      startRule(context, 'Scenario');944      build(context, token);945      return 12;946    }947    if(match_ScenarioOutlineLine(context, token)) {948      endRule(context, 'Scenario');949      endRule(context, 'Scenario_Definition');950      startRule(context, 'Scenario_Definition');951      startRule(context, 'ScenarioOutline');952      build(context, token);953      return 17;954    }955    if(match_Empty(context, token)) {956      build(context, token);957      return 14;958    }959    960    var stateComment = "State: 14 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0";961    token.detach();962    var expectedTokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"];963    var error = token.isEof ?964      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :965      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);966    if (this.stopAtFirstError) throw error;967    addError(context, error);968    return 14;969  }970  // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0971  function matchTokenAt_15(token, context) {972    if(match_EOF(context, token)) {973      endRule(context, 'Step');974      endRule(context, 'Scenario');975      endRule(context, 'Scenario_Definition');976      build(context, token);977      return 27;978    }979    if(match_TableRow(context, token)) {980      startRule(context, 'DataTable');981      build(context, token);982      return 16;983    }984    if(match_DocStringSeparator(context, token)) {985      startRule(context, 'DocString');986      build(context, token);987      return 30;988    }989    if(match_StepLine(context, token)) {990      endRule(context, 'Step');991      startRule(context, 'Step');992      build(context, token);993      return 15;994    }995    if(match_TagLine(context, token)) {996      endRule(context, 'Step');997      endRule(context, 'Scenario');998      endRule(context, 'Scenario_Definition');999      startRule(context, 'Scenario_Definition');1000      startRule(context, 'Tags');1001      build(context, token);1002      return 11;1003    }1004    if(match_ScenarioLine(context, token)) {1005      endRule(context, 'Step');1006      endRule(context, 'Scenario');1007      endRule(context, 'Scenario_Definition');1008      startRule(context, 'Scenario_Definition');1009      startRule(context, 'Scenario');1010      build(context, token);1011      return 12;1012    }1013    if(match_ScenarioOutlineLine(context, token)) {1014      endRule(context, 'Step');1015      endRule(context, 'Scenario');1016      endRule(context, 'Scenario_Definition');1017      startRule(context, 'Scenario_Definition');1018      startRule(context, 'ScenarioOutline');1019      build(context, token);1020      return 17;1021    }1022    if(match_Comment(context, token)) {1023      build(context, token);1024      return 15;1025    }1026    if(match_Empty(context, token)) {1027      build(context, token);1028      return 15;1029    }1030    1031    var stateComment = "State: 15 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0";1032    token.detach();1033    var expectedTokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];1034    var error = token.isEof ?1035      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1036      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1037    if (this.stopAtFirstError) throw error;1038    addError(context, error);1039    return 15;1040  }1041  // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:01042  function matchTokenAt_16(token, context) {1043    if(match_EOF(context, token)) {1044      endRule(context, 'DataTable');1045      endRule(context, 'Step');1046      endRule(context, 'Scenario');1047      endRule(context, 'Scenario_Definition');1048      build(context, token);1049      return 27;1050    }1051    if(match_TableRow(context, token)) {1052      build(context, token);1053      return 16;1054    }1055    if(match_StepLine(context, token)) {1056      endRule(context, 'DataTable');1057      endRule(context, 'Step');1058      startRule(context, 'Step');1059      build(context, token);1060      return 15;1061    }1062    if(match_TagLine(context, token)) {1063      endRule(context, 'DataTable');1064      endRule(context, 'Step');1065      endRule(context, 'Scenario');1066      endRule(context, 'Scenario_Definition');1067      startRule(context, 'Scenario_Definition');1068      startRule(context, 'Tags');1069      build(context, token);1070      return 11;1071    }1072    if(match_ScenarioLine(context, token)) {1073      endRule(context, 'DataTable');1074      endRule(context, 'Step');1075      endRule(context, 'Scenario');1076      endRule(context, 'Scenario_Definition');1077      startRule(context, 'Scenario_Definition');1078      startRule(context, 'Scenario');1079      build(context, token);1080      return 12;1081    }1082    if(match_ScenarioOutlineLine(context, token)) {1083      endRule(context, 'DataTable');1084      endRule(context, 'Step');1085      endRule(context, 'Scenario');1086      endRule(context, 'Scenario_Definition');1087      startRule(context, 'Scenario_Definition');1088      startRule(context, 'ScenarioOutline');1089      build(context, token);1090      return 17;1091    }1092    if(match_Comment(context, token)) {1093      build(context, token);1094      return 16;1095    }1096    if(match_Empty(context, token)) {1097      build(context, token);1098      return 16;1099    }1100    1101    var stateComment = "State: 16 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";1102    token.detach();1103    var expectedTokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];1104    var error = token.isEof ?1105      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1106      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1107    if (this.stopAtFirstError) throw error;1108    addError(context, error);1109    return 16;1110  }1111  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:01112  function matchTokenAt_17(token, context) {1113    if(match_Empty(context, token)) {1114      build(context, token);1115      return 17;1116    }1117    if(match_Comment(context, token)) {1118      build(context, token);1119      return 19;1120    }1121    if(match_StepLine(context, token)) {1122      startRule(context, 'Step');1123      build(context, token);1124      return 20;1125    }1126    if(match_TagLine(context, token)) {1127      startRule(context, 'Examples');1128      startRule(context, 'Tags');1129      build(context, token);1130      return 22;1131    }1132    if(match_ExamplesLine(context, token)) {1133      startRule(context, 'Examples');1134      build(context, token);1135      return 23;1136    }1137    if(match_Other(context, token)) {1138      startRule(context, 'Description');1139      build(context, token);1140      return 18;1141    }1142    1143    var stateComment = "State: 17 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0";1144    token.detach();1145    var expectedTokens = ["#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#Other"];1146    var error = token.isEof ?1147      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1148      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1149    if (this.stopAtFirstError) throw error;1150    addError(context, error);1151    return 17;1152  }1153  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:01154  function matchTokenAt_18(token, context) {1155    if(match_Comment(context, token)) {1156      endRule(context, 'Description');1157      build(context, token);1158      return 19;1159    }1160    if(match_StepLine(context, token)) {1161      endRule(context, 'Description');1162      startRule(context, 'Step');1163      build(context, token);1164      return 20;1165    }1166    if(match_TagLine(context, token)) {1167      endRule(context, 'Description');1168      startRule(context, 'Examples');1169      startRule(context, 'Tags');1170      build(context, token);1171      return 22;1172    }1173    if(match_ExamplesLine(context, token)) {1174      endRule(context, 'Description');1175      startRule(context, 'Examples');1176      build(context, token);1177      return 23;1178    }1179    if(match_Other(context, token)) {1180      build(context, token);1181      return 18;1182    }1183    1184    var stateComment = "State: 18 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0";1185    token.detach();1186    var expectedTokens = ["#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#Other"];1187    var error = token.isEof ?1188      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1189      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1190    if (this.stopAtFirstError) throw error;1191    addError(context, error);1192    return 18;1193  }1194  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:01195  function matchTokenAt_19(token, context) {1196    if(match_Comment(context, token)) {1197      build(context, token);1198      return 19;1199    }1200    if(match_StepLine(context, token)) {1201      startRule(context, 'Step');1202      build(context, token);1203      return 20;1204    }1205    if(match_TagLine(context, token)) {1206      startRule(context, 'Examples');1207      startRule(context, 'Tags');1208      build(context, token);1209      return 22;1210    }1211    if(match_ExamplesLine(context, token)) {1212      startRule(context, 'Examples');1213      build(context, token);1214      return 23;1215    }1216    if(match_Empty(context, token)) {1217      build(context, token);1218      return 19;1219    }1220    1221    var stateComment = "State: 19 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:0";1222    token.detach();1223    var expectedTokens = ["#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#Empty"];1224    var error = token.isEof ?1225      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1226      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1227    if (this.stopAtFirstError) throw error;1228    addError(context, error);1229    return 19;1230  }1231  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:01232  function matchTokenAt_20(token, context) {1233    if(match_TableRow(context, token)) {1234      startRule(context, 'DataTable');1235      build(context, token);1236      return 21;1237    }1238    if(match_DocStringSeparator(context, token)) {1239      startRule(context, 'DocString');1240      build(context, token);1241      return 28;1242    }1243    if(match_StepLine(context, token)) {1244      endRule(context, 'Step');1245      startRule(context, 'Step');1246      build(context, token);1247      return 20;1248    }1249    if(match_TagLine(context, token)) {1250      endRule(context, 'Step');1251      startRule(context, 'Examples');1252      startRule(context, 'Tags');1253      build(context, token);1254      return 22;1255    }1256    if(match_ExamplesLine(context, token)) {1257      endRule(context, 'Step');1258      startRule(context, 'Examples');1259      build(context, token);1260      return 23;1261    }1262    if(match_Comment(context, token)) {1263      build(context, token);1264      return 20;1265    }1266    if(match_Empty(context, token)) {1267      build(context, token);1268      return 20;1269    }1270    1271    var stateComment = "State: 20 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0";1272    token.detach();1273    var expectedTokens = ["#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#Comment", "#Empty"];1274    var error = token.isEof ?1275      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1276      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1277    if (this.stopAtFirstError) throw error;1278    addError(context, error);1279    return 20;1280  }1281  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:01282  function matchTokenAt_21(token, context) {1283    if(match_TableRow(context, token)) {1284      build(context, token);1285      return 21;1286    }1287    if(match_StepLine(context, token)) {1288      endRule(context, 'DataTable');1289      endRule(context, 'Step');1290      startRule(context, 'Step');1291      build(context, token);1292      return 20;1293    }1294    if(match_TagLine(context, token)) {1295      endRule(context, 'DataTable');1296      endRule(context, 'Step');1297      startRule(context, 'Examples');1298      startRule(context, 'Tags');1299      build(context, token);1300      return 22;1301    }1302    if(match_ExamplesLine(context, token)) {1303      endRule(context, 'DataTable');1304      endRule(context, 'Step');1305      startRule(context, 'Examples');1306      build(context, token);1307      return 23;1308    }1309    if(match_Comment(context, token)) {1310      build(context, token);1311      return 21;1312    }1313    if(match_Empty(context, token)) {1314      build(context, token);1315      return 21;1316    }1317    1318    var stateComment = "State: 21 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";1319    token.detach();1320    var expectedTokens = ["#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#Comment", "#Empty"];1321    var error = token.isEof ?1322      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1323      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1324    if (this.stopAtFirstError) throw error;1325    addError(context, error);1326    return 21;1327  }1328  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:0>Tags:0>#TagLine:01329  function matchTokenAt_22(token, context) {1330    if(match_TagLine(context, token)) {1331      build(context, token);1332      return 22;1333    }1334    if(match_ExamplesLine(context, token)) {1335      endRule(context, 'Tags');1336      build(context, token);1337      return 23;1338    }1339    if(match_Comment(context, token)) {1340      build(context, token);1341      return 22;1342    }1343    if(match_Empty(context, token)) {1344      build(context, token);1345      return 22;1346    }1347    1348    var stateComment = "State: 22 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:0>Tags:0>#TagLine:0";1349    token.detach();1350    var expectedTokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"];1351    var error = token.isEof ?1352      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1353      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1354    if (this.stopAtFirstError) throw error;1355    addError(context, error);1356    return 22;1357  }1358  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:1>#ExamplesLine:01359  function matchTokenAt_23(token, context) {1360    if(match_Empty(context, token)) {1361      build(context, token);1362      return 23;1363    }1364    if(match_Comment(context, token)) {1365      build(context, token);1366      return 25;1367    }1368    if(match_TableRow(context, token)) {1369      build(context, token);1370      return 26;1371    }1372    if(match_Other(context, token)) {1373      startRule(context, 'Description');1374      build(context, token);1375      return 24;1376    }1377    1378    var stateComment = "State: 23 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:1>#ExamplesLine:0";1379    token.detach();1380    var expectedTokens = ["#Empty", "#Comment", "#TableRow", "#Other"];1381    var error = token.isEof ?1382      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1383      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1384    if (this.stopAtFirstError) throw error;1385    addError(context, error);1386    return 23;1387  }1388  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:2>Examples_Description:0>Description_Helper:1>Description:0>#Other:01389  function matchTokenAt_24(token, context) {1390    if(match_Comment(context, token)) {1391      endRule(context, 'Description');1392      build(context, token);1393      return 25;1394    }1395    if(match_TableRow(context, token)) {1396      endRule(context, 'Description');1397      build(context, token);1398      return 26;1399    }1400    if(match_Other(context, token)) {1401      build(context, token);1402      return 24;1403    }1404    1405    var stateComment = "State: 24 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:2>Examples_Description:0>Description_Helper:1>Description:0>#Other:0";1406    token.detach();1407    var expectedTokens = ["#Comment", "#TableRow", "#Other"];1408    var error = token.isEof ?1409      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1410      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1411    if (this.stopAtFirstError) throw error;1412    addError(context, error);1413    return 24;1414  }1415  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:2>Examples_Description:0>Description_Helper:2>#Comment:01416  function matchTokenAt_25(token, context) {1417    if(match_Comment(context, token)) {1418      build(context, token);1419      return 25;1420    }1421    if(match_TableRow(context, token)) {1422      build(context, token);1423      return 26;1424    }1425    if(match_Empty(context, token)) {1426      build(context, token);1427      return 25;1428    }1429    1430    var stateComment = "State: 25 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:2>Examples_Description:0>Description_Helper:2>#Comment:0";1431    token.detach();1432    var expectedTokens = ["#Comment", "#TableRow", "#Empty"];1433    var error = token.isEof ?1434      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1435      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1436    if (this.stopAtFirstError) throw error;1437    addError(context, error);1438    return 25;1439  }1440  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:3>Examples_Table:0>#TableRow:01441  function matchTokenAt_26(token, context) {1442    if(match_EOF(context, token)) {1443      endRule(context, 'Examples');1444      endRule(context, 'ScenarioOutline');1445      endRule(context, 'Scenario_Definition');1446      build(context, token);1447      return 27;1448    }1449    if(match_TableRow(context, token)) {1450      build(context, token);1451      return 26;1452    }1453    if(match_TagLine(context, token)) {1454      if(lookahead_0(context, token)) {1455      endRule(context, 'Examples');1456      startRule(context, 'Examples');1457      startRule(context, 'Tags');1458      build(context, token);1459      return 22;1460      }1461    }1462    if(match_TagLine(context, token)) {1463      endRule(context, 'Examples');1464      endRule(context, 'ScenarioOutline');1465      endRule(context, 'Scenario_Definition');1466      startRule(context, 'Scenario_Definition');1467      startRule(context, 'Tags');1468      build(context, token);1469      return 11;1470    }1471    if(match_ExamplesLine(context, token)) {1472      endRule(context, 'Examples');1473      startRule(context, 'Examples');1474      build(context, token);1475      return 23;1476    }1477    if(match_ScenarioLine(context, token)) {1478      endRule(context, 'Examples');1479      endRule(context, 'ScenarioOutline');1480      endRule(context, 'Scenario_Definition');1481      startRule(context, 'Scenario_Definition');1482      startRule(context, 'Scenario');1483      build(context, token);1484      return 12;1485    }1486    if(match_ScenarioOutlineLine(context, token)) {1487      endRule(context, 'Examples');1488      endRule(context, 'ScenarioOutline');1489      endRule(context, 'Scenario_Definition');1490      startRule(context, 'Scenario_Definition');1491      startRule(context, 'ScenarioOutline');1492      build(context, token);1493      return 17;1494    }1495    if(match_Comment(context, token)) {1496      build(context, token);1497      return 26;1498    }1499    if(match_Empty(context, token)) {1500      build(context, token);1501      return 26;1502    }1503    1504    var stateComment = "State: 26 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples:3>Examples_Table:0>#TableRow:0";1505    token.detach();1506    var expectedTokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];1507    var error = token.isEof ?1508      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1509      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1510    if (this.stopAtFirstError) throw error;1511    addError(context, error);1512    return 26;1513  }1514  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:01515  function matchTokenAt_28(token, context) {1516    if(match_DocStringSeparator(context, token)) {1517      build(context, token);1518      return 29;1519    }1520    if(match_Other(context, token)) {1521      build(context, token);1522      return 28;1523    }1524    1525    var stateComment = "State: 28 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";1526    token.detach();1527    var expectedTokens = ["#DocStringSeparator", "#Other"];1528    var error = token.isEof ?1529      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1530      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1531    if (this.stopAtFirstError) throw error;1532    addError(context, error);1533    return 28;1534  }1535  // Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:01536  function matchTokenAt_29(token, context) {1537    if(match_StepLine(context, token)) {1538      endRule(context, 'DocString');1539      endRule(context, 'Step');1540      startRule(context, 'Step');1541      build(context, token);1542      return 20;1543    }1544    if(match_TagLine(context, token)) {1545      endRule(context, 'DocString');1546      endRule(context, 'Step');1547      startRule(context, 'Examples');1548      startRule(context, 'Tags');1549      build(context, token);1550      return 22;1551    }1552    if(match_ExamplesLine(context, token)) {1553      endRule(context, 'DocString');1554      endRule(context, 'Step');1555      startRule(context, 'Examples');1556      build(context, token);1557      return 23;1558    }1559    if(match_Comment(context, token)) {1560      build(context, token);1561      return 29;1562    }1563    if(match_Empty(context, token)) {1564      build(context, token);1565      return 29;1566    }1567    1568    var stateComment = "State: 29 - Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";1569    token.detach();1570    var expectedTokens = ["#StepLine", "#TagLine", "#ExamplesLine", "#Comment", "#Empty"];1571    var error = token.isEof ?1572      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1573      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1574    if (this.stopAtFirstError) throw error;1575    addError(context, error);1576    return 29;1577  }1578  // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:01579  function matchTokenAt_30(token, context) {1580    if(match_DocStringSeparator(context, token)) {1581      build(context, token);1582      return 31;1583    }1584    if(match_Other(context, token)) {1585      build(context, token);1586      return 30;1587    }1588    1589    var stateComment = "State: 30 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";1590    token.detach();1591    var expectedTokens = ["#DocStringSeparator", "#Other"];1592    var error = token.isEof ?1593      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1594      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1595    if (this.stopAtFirstError) throw error;1596    addError(context, error);1597    return 30;1598  }1599  // Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:01600  function matchTokenAt_31(token, context) {1601    if(match_EOF(context, token)) {1602      endRule(context, 'DocString');1603      endRule(context, 'Step');1604      endRule(context, 'Scenario');1605      endRule(context, 'Scenario_Definition');1606      build(context, token);1607      return 27;1608    }1609    if(match_StepLine(context, token)) {1610      endRule(context, 'DocString');1611      endRule(context, 'Step');1612      startRule(context, 'Step');1613      build(context, token);1614      return 15;1615    }1616    if(match_TagLine(context, token)) {1617      endRule(context, 'DocString');1618      endRule(context, 'Step');1619      endRule(context, 'Scenario');1620      endRule(context, 'Scenario_Definition');1621      startRule(context, 'Scenario_Definition');1622      startRule(context, 'Tags');1623      build(context, token);1624      return 11;1625    }1626    if(match_ScenarioLine(context, token)) {1627      endRule(context, 'DocString');1628      endRule(context, 'Step');1629      endRule(context, 'Scenario');1630      endRule(context, 'Scenario_Definition');1631      startRule(context, 'Scenario_Definition');1632      startRule(context, 'Scenario');1633      build(context, token);1634      return 12;1635    }1636    if(match_ScenarioOutlineLine(context, token)) {1637      endRule(context, 'DocString');1638      endRule(context, 'Step');1639      endRule(context, 'Scenario');1640      endRule(context, 'Scenario_Definition');1641      startRule(context, 'Scenario_Definition');1642      startRule(context, 'ScenarioOutline');1643      build(context, token);1644      return 17;1645    }1646    if(match_Comment(context, token)) {1647      build(context, token);1648      return 31;1649    }1650    if(match_Empty(context, token)) {1651      build(context, token);1652      return 31;1653    }1654    1655    var stateComment = "State: 31 - Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";1656    token.detach();1657    var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];1658    var error = token.isEof ?1659      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1660      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1661    if (this.stopAtFirstError) throw error;1662    addError(context, error);1663    return 31;1664  }1665  // Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:01666  function matchTokenAt_32(token, context) {1667    if(match_DocStringSeparator(context, token)) {1668      build(context, token);1669      return 33;1670    }1671    if(match_Other(context, token)) {1672      build(context, token);1673      return 32;1674    }1675    1676    var stateComment = "State: 32 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";1677    token.detach();1678    var expectedTokens = ["#DocStringSeparator", "#Other"];1679    var error = token.isEof ?1680      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1681      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1682    if (this.stopAtFirstError) throw error;1683    addError(context, error);1684    return 32;1685  }1686  // Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:01687  function matchTokenAt_33(token, context) {1688    if(match_EOF(context, token)) {1689      endRule(context, 'DocString');1690      endRule(context, 'Step');1691      endRule(context, 'Background');1692      build(context, token);1693      return 27;1694    }1695    if(match_StepLine(context, token)) {1696      endRule(context, 'DocString');1697      endRule(context, 'Step');1698      startRule(context, 'Step');1699      build(context, token);1700      return 9;1701    }1702    if(match_TagLine(context, token)) {1703      endRule(context, 'DocString');1704      endRule(context, 'Step');1705      endRule(context, 'Background');1706      startRule(context, 'Scenario_Definition');1707      startRule(context, 'Tags');1708      build(context, token);1709      return 11;1710    }1711    if(match_ScenarioLine(context, token)) {1712      endRule(context, 'DocString');1713      endRule(context, 'Step');1714      endRule(context, 'Background');1715      startRule(context, 'Scenario_Definition');1716      startRule(context, 'Scenario');1717      build(context, token);1718      return 12;1719    }1720    if(match_ScenarioOutlineLine(context, token)) {1721      endRule(context, 'DocString');1722      endRule(context, 'Step');1723      endRule(context, 'Background');1724      startRule(context, 'Scenario_Definition');1725      startRule(context, 'ScenarioOutline');1726      build(context, token);1727      return 17;1728    }1729    if(match_Comment(context, token)) {1730      build(context, token);1731      return 33;1732    }1733    if(match_Empty(context, token)) {1734      build(context, token);1735      return 33;1736    }1737    1738    var stateComment = "State: 33 - Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";1739    token.detach();1740    var expectedTokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"];1741    var error = token.isEof ?1742      new Errors.UnexpectedEOFException(token, expectedTokens, stateComment) :1743      Errors.UnexpectedTokenException.create(token, expectedTokens, stateComment);1744    if (this.stopAtFirstError) throw error;1745    addError(context, error);1746    return 33;1747  }1748  function match_EOF(context, token) {1749    return handleExternalError(context, false, function () {1750      return context.tokenMatcher.match_EOF(token);1751    });1752  }1753  function match_Empty(context, token) {1754    if(token.isEof) return false;1755    return handleExternalError(context, false, function () {1756      return context.tokenMatcher.match_Empty(token);1757    });1758  }1759  function match_Comment(context, token) {1760    if(token.isEof) return false;1761    return handleExternalError(context, false, function () {1762      return context.tokenMatcher.match_Comment(token);1763    });1764  }1765  function match_TagLine(context, token) {1766    if(token.isEof) return false;1767    return handleExternalError(context, false, function () {1768      return context.tokenMatcher.match_TagLine(token);1769    });1770  }1771  function match_FeatureLine(context, token) {1772    if(token.isEof) return false;1773    return handleExternalError(context, false, function () {1774      return context.tokenMatcher.match_FeatureLine(token);1775    });1776  }1777  function match_BackgroundLine(context, token) {1778    if(token.isEof) return false;1779    return handleExternalError(context, false, function () {1780      return context.tokenMatcher.match_BackgroundLine(token);1781    });1782  }1783  function match_ScenarioLine(context, token) {1784    if(token.isEof) return false;1785    return handleExternalError(context, false, function () {1786      return context.tokenMatcher.match_ScenarioLine(token);1787    });1788  }1789  function match_ScenarioOutlineLine(context, token) {1790    if(token.isEof) return false;1791    return handleExternalError(context, false, function () {1792      return context.tokenMatcher.match_ScenarioOutlineLine(token);1793    });1794  }1795  function match_ExamplesLine(context, token) {1796    if(token.isEof) return false;1797    return handleExternalError(context, false, function () {1798      return context.tokenMatcher.match_ExamplesLine(token);1799    });1800  }1801  function match_StepLine(context, token) {1802    if(token.isEof) return false;1803    return handleExternalError(context, false, function () {1804      return context.tokenMatcher.match_StepLine(token);1805    });1806  }1807  function match_DocStringSeparator(context, token) {1808    if(token.isEof) return false;1809    return handleExternalError(context, false, function () {1810      return context.tokenMatcher.match_DocStringSeparator(token);1811    });1812  }1813  function match_TableRow(context, token) {1814    if(token.isEof) return false;1815    return handleExternalError(context, false, function () {1816      return context.tokenMatcher.match_TableRow(token);1817    });1818  }1819  function match_Language(context, token) {1820    if(token.isEof) return false;1821    return handleExternalError(context, false, function () {1822      return context.tokenMatcher.match_Language(token);1823    });1824  }1825  function match_Other(context, token) {1826    if(token.isEof) return false;1827    return handleExternalError(context, false, function () {1828      return context.tokenMatcher.match_Other(token);1829    });1830  }1831  function lookahead_0(context, currentToken) {1832    currentToken.detach();1833    var token;1834    var queue = [];1835    var match = false;1836    do {1837      token = readToken(context);1838      token.detach();1839      queue.push(token);1840      if (false  || match_ExamplesLine(context, token)) {1841        match = true;1842        break;1843      }1844    } while(false  || match_Empty(context, token) || match_Comment(context, token) || match_TagLine(context, token));1845    context.tokenQueue = context.tokenQueue.concat(queue);1846    return match;1847  }...

Full Screen

Full Screen

process_21_07.js

Source:process_21_07.js Github

copy

Full Screen

1exports.getMatch = function (req, params, fn) {2    req.getConnection(function (err, connection) {3        var if_search = '';4//        if (params.qsearch != '' && params.filter_by != '')5//            if_search += " AND " + params.filter_by + " LIKE '%" + params.qsearch + "%' ";6//        if (params.qsearch != '' && params.filter_by == '')7//            if_search += " AND username LIKE '%" + params.qsearch + "%' ";8        var query = connection.query('SELECT * FROM `match` WHERE 1=1 ' + if_search + ' ORDER By match_id DESC LIMIT ?,?', [params.offset, params.limit], function (err, rows)9        {10            if (err)11                return fn(false, err);12            countAllMatch(req, params, function (total) {13                //console.log("Total data : %d",total);14                return fn(true, rows, total);15            });16        });17        console.log(query.sql);18    });19};20function countAllMatch(req, params, fn) {21    req.getConnection(function (err, connection) {22        var if_search = '';23//        if(params.qsearch !='' && params.filter_by !='')24//            if_search +=" AND "+params.filter_by+" LIKE '%"+params.qsearch+"%' ";25//        if(params.qsearch !='' && params.filter_by=='')26//            if_search +=" AND username LIKE '%"+params.qsearch+"%' ";27        var query = connection.query('SELECT COUNT(match_id) as all_match FROM `match` WHERE 1=1 ' + if_search + ' ', function (err, rows)28        {29            if (err)30                return fn(err);31            return fn(rows[0].all_match);32        });33    });34}35/*------------------------------------------36 Adding Match37 -------------------------------------------*/38exports.save = function (req, res, fn) {39    var temp = JSON.parse(JSON.stringify(req.body));40    //set password = temp.username41    //hash(temp.password, function(err, salt_it, hash_it){42//    //if (err) throw err;43//    console.log("save start");44//    if (!req.files) {45//        console.log('No files were uploaded.');46//        temp.image_name = '';47//    } else {48//        //console.log(req.files);49//        // The name of the input field (i.e. "sampleFile") is used to retrieve the uploaded file 50//        var sampleFile = req.files.image;51//        // Use the mv() method to place the file somewhere on your server 52//        var image_name = 'team_' + Date.now() + '.jpg';53//        sampleFile.mv('./public/uploads/' + image_name, function (err) {54//            if (err) {55//                console.log(err);56//                temp.image_name = '';57//            } else {58//                temp.image_name = image_name;59//            }60//        });61//    }62    req.getConnection(function (err, connection) {63  //var datetime = dateFormat(temp.datetime, 'yyyy-mm-dd HH:MM:ss');64        if (temp.match_id == '') {65       66            var insert = {67                match_name: temp.match_name,68                match_type: temp.match_type,69                venue: temp.venue,70                match_result: temp.match_result,71                team_1: temp.team_1,72                team_2: temp.team_2,73                team_1_text: temp.team_1_text,74                team_2_text: temp.team_2_text,75                max_ball: temp.max_ball,76                match_comment: temp.match_comment,77                status: temp.status,78                datetime: temp.datetime79            };80            connection.query("INSERT INTO `match` set ? ", insert, function (err, rows)81            {82                if (err)83                    return fn(false, err);84                return fn(true, " New match created");85            });86        } else {87            var update;88//            if (temp.image_name != '') {89//                update = {90//                    team_name: temp.team_name,91//                    team_shortname: temp.team_shortname,92//                    image: temp.image_name,93//                    status: (temp.status == 1) ? 'Active' : 'Inactive'94//                };95//96//            } else {97            update = {98                match_name: temp.match_name,99                match_type: temp.match_type,100                venue: temp.venue,101                match_result: temp.match_result,102                team_1: temp.team_1,103                team_2: temp.team_2,104                team_1_text: temp.team_1_text,105                team_2_text: temp.team_2_text,106                max_ball: temp.max_ball,107                match_comment: temp.match_comment,108                status: temp.status,109                datetime: temp.datetime110            };111            //   }112            connection.query("UPDATE `match` set ? WHERE match_id = ? ", [update, temp.match_id], function (err, rows)113            {114                if (err)115                    return fn(false, err);116                return  fn(true, "Match Updated");117            });118        }119    });120    // }); //end of hash121};122exports.delete_match = function (req, fn) {123    var temp = JSON.parse(JSON.stringify(req.body));124    req.getConnection(function (err, connection) {125        connection.query("DELETE FROM `match`  WHERE id = ? ", [temp.match_id], function (err, rows)126        {127            if (err)128                return fn(false, err);129            return fn(true, " Match deleted");130        });131    });132};133exports.getMessages = function () {134    var array = {135        'ball': "Ball",136        "0_run": "No Run",137        "1_run": "1 Run",138        "2_run": "2 Runs",139        "3_run": "3 Runs",140        "4_run": "4-Four-4",141        "5_run": "5 Runs",142        "6_run": "6-Six-6",143        "1_wicket": "it's Wicket",144        "inair": "Ball in the Air",145        "timeout": "Time Out!",146        "thirdumpire": "Third Umpire",147        // "bowlerhold" => "Bowler Ruka",148        "freehit": "Free Hit!",149        //  "catchout" => "Catch Out!",150        "catchdrop": "Catch Droped!",151        "notout": "Not Out",152//            "decisionpending"=>'Decision Pending',153        'over': 'Over',154        //  "ruko" => "Ruko Ruko Ruko",155    };156    return array;157}158exports.saveUpdateStates = function (connection, data, match_id) {159    console.log("inside update states");160    console.log(connection);161    console.log(data);162    console.log(match_id);163    var query = connection.query('SELECT COUNT(match_id) as matches FROM `states` WHERE `match_id` = ' + match_id + ' ', function (err, rows)164    {165        console.log(rows);166        console.log(rows[0].matches);167        console.log(rows["matches"]);168        if (rows[0].matches > 0) {169            //update170//            update = {171//                run: data["run"],172//                over: data["over"],173//                batsman_2_run: data["batsman_2_run"],174//                batsman_2_ball: data["batsman_2_ball"],175//                message: data["message"],176//            };177//            var nData = {};178//            for (key in data) {179//                console.log(data[key]);180//                nData[key] = data[key];181//            }182            //console.log(nData);183            // Object.assign({}, data);184            // console.log(data);185            var query2 = connection.query("UPDATE `states` set ? WHERE match_id = ? ", [data, match_id], function (err, rows) {186                // console.log(rows);187                console.log("data updated");188                //setUpData(connection, match_id);189            });190            return true;191            //console.log(query2.sql);192        } else {193            //insert194//            insert = {195//                run: data["run"],196//                over: data["over"],197//                batsman_2_run: data["batsman_2_run"],198//                batsman_2_ball: data["batsman_2_ball"],199//                message: data["message"],200//                match_id: match_id201//            };202//            var nData = {};203//            for (key in data) {204//                console.log(data[key]);205//                //nData[key] = data[key];206//            }207            var query2 = connection.query("INSERT INTO `states` set ? ", [data], function (err, rows) {208                // console.log(rows);209                console.log("data inserted");210                //setUpData(connection, match_id);211                212            });213            //console.log(query2.sql);214            return true;215        }216    });217}218function toObject(arr) {219    var rv = {};220    for (var i = 0; i < arr.length; ++i)221        rv[i] = arr[i];222    return rv;223}224function setUpData(connection, match_id){225    226      connection.query('SELECT * FROM `states` WHERE match_id = ?', [match_id], function (err, rows)227                    {228                        console.log("start------");229                        console.log(rows);230                        console.log("------end");231                        //Message setup232            //$("#message_text").val(rows[0]["message"]);233//            document.getElementById("message_text").value = rows[0]["message"];234//            document.getElementById("run_text").value = rows[0]["run"];235//            $("#run_text").val(rows[0]["run"]);236//            $("#wicket_text").val(data.wicket);237//            $("#over_text").val(data.over);238//            $("#batsman_1_run_text").val(data.batsman_1_run);239//            $("#batsman_2_run_text").val(data.batsman_2_run);240//            $("#batsman_1_ball_text").val(data.batsman_1_ball);241//            $("#batsman_2_ball_text").val(data.batsman_2_ball);242//243//            var batsman_1_text = $("#batsman_1_text").val();244//            // alert(batsman_1_text);245//            if (batsman_1_text != "") {246//247//                $("#batsman_name_1").html(batsman_1_text);248//            }249//            var batsman_2_text = $("#batsman_2_text").val();250//            if (batsman_2_text != "") {251//                $("#batsman_name_2").html(batsman_2_text);252//            }253//254//            $('#ball_checkbox').attr('checked', false);255//            $('#message_select').prop('selectedIndex', 0);256//            $('#message_select2').prop('selectedIndex', 0);257//            $('#message_select3').prop('selectedIndex', 0);258                        //Message setup ends259                    });260    261}262exports.getMatchListAPI = function (req, fn) {263    req.getConnection(function (err, connection) {264//        var if_search = '';265//        if (params.qsearch != '' && params.filter_by != '')266//            if_search += " AND " + params.filter_by + " LIKE '%" + params.qsearch + "%' ";267//        if (params.qsearch != '' && params.filter_by == '')268//            if_search += " AND username LIKE '%" + params.qsearch + "%' ";269        var query = connection.query('SELECT `m`.*,`t`.`team_name` as team_1_team_name, `t`.`team_shortname` as team_1_team_shortname, `t`.`image` as team_1_image, `t1`.`team_name` as team_2_team_name, `t1`.`team_shortname` as team_2_team_shortname, `t1`.`image` as team_2_image  FROM `match` as m left join `team` as t on `t`.`team_id` = `m`.`team_1` left join `team` as t1 on `t1`.`team_id` = `m`.`team_2` WHERE 1=1 AND `m`.`status` = ? ORDER By match_id DESC', [req.body.status], function (err, rows)270        {271            console.log("---match api--");272            console.log(rows);273            if (err)274                return fn(false, err);275            else276                return fn(true, rows);277          278        });279        console.log(query.sql);280    });...

Full Screen

Full Screen

LyricParserV2.js

Source:LyricParserV2.js Github

copy

Full Screen

1/**2 * 获取歌词说明项3 * @param {*} lyric 4 * @param {*} regex 5 * @param {*} group 6 * @param {*} defaultValue 7 */8function getDescriptionItem(lyric, regex, group, defaultValue) {9    let retVal = defaultValue10    try {11        const result = lyric.match(regex)12        if (result != null) {13            retVal = result[group]14        }15    } catch (e) {}16    return retVal17}18/**19 * 生成歌词tag节点20 * @param {*} line 21 */22function genLyricTag(line) {23    let nodes = []24    let newarray = line.split("}");25    newarray.forEach(element => {26        let newarray = element.replace("{", ",{").split(",");27        newarray.forEach(e => {28            if(e) {29                let a = {}30                if(e.startsWith("{")) {31                    a = {32                        node: 'c',33                        content: e.substring(1),34                    }35                }36                else {37                    a = {38                        node: 't',39                        content: e40                    }41                }42                nodes.push(a)43            }44        })45    });46    return nodes;47}48/**49 * Parse lyric and chord data and generate HTML50 *51 * @class LyricParser52 */53class LyricParserV2 {54    /**55     * Parse lrc, suppose multiple time tag56     * 每一行只能有一个时间57     * @param {any} lrcString  - Format:58     * [mm:ss.xx]lyric59     * [mm:ss.xxx]lyric60     * [mm:ss.xx]lyric61     *62     * @return {list}63     * [{time: xxx, lrcHtml: xxx, focus:false} ...]64     * @memberof LyricParser65     */66    parse(lrcString) {67        try {68            var retObj = {}69            var lyricData = []70            const lyric = lrcString.split('\n')71            retObj.title = getDescriptionItem(lrcString, /\[ti:(.*?)\]/, 1, '');72            retObj.artist = getDescriptionItem(lrcString, /\[ar:(.*?)\]/, 1, '');73            retObj.album = getDescriptionItem(lrcString, /\[al:(.*?)\]/, 1, '');74            retObj.lyricBy = getDescriptionItem(lrcString, /\[ly:(.*?)\]/, 1, '');75            retObj.composerBy = getDescriptionItem(lrcString, /\[mu:(.*?)\]/, 1, '');76            retObj.OriginalKey = getDescriptionItem(lrcString, /\[原调:(.*?)\]/, 1, '');77            retObj.SelectKey = getDescriptionItem(lrcString, /\[选调:(.*?)\]/, 1, '');78            retObj.capo = getDescriptionItem(lrcString, /\[变调夹:(.*?)\]/, 1, '');79            retObj.creator = getDescriptionItem(lrcString, /\[歌词制作:(.*?)\]/, 1, '');80            let preLyricIdx = null81            // let preTime = null82            // let preTag = null83            for (let i = 0; i < lyric.length; i++) {84                let line = lyric[i]85                // match lrc time86                const oneTime = line.match(/\[(\d{2}):(\d{2})\.(\d{2,3})]/)87                if (oneTime != null) {88                    // 处理歌词89                    // 删除所有时间标记90                    let lrcText = line.replace(/\[(\d{2}):(\d{2})\.(\d{2,3})]|\s+|\s+$|<\d+>/, '')91                    let lrcTag = genLyricTag(lrcText)92                    const time = (oneTime[1]) * 60 + parseInt(oneTime[2]) + parseInt(oneTime[3]) / ((oneTime[3] + '').length === 2 ? 100 : 1000)93                    if(preLyricIdx !== null) {94                        lyricData[preLyricIdx].data.endTime = time95                    }96                    preLyricIdx = lyricData.push({97                        type: 'lyric',98                        data: {99                            time: time,100                            nodes: lrcTag,101                            focus: false,102                            endTime: Number.MAX_SAFE_INTEGER103                        }104                    }) - 1105                } else {106                    const match_comment = line.match(/^\s*\[#\](.*)/)107                    if(match_comment !== null) {108                        lyricData.push({109                            type: 'comment',110                            data: match_comment[1],111                        })112                    }113                    const match_img = line.match(/^\s*\[img\](.*)/)114                    if(match_img !== null) {115                        lyricData.push({116                            type: 'img',117                            data: match_img[1],118                        })119                    }120                    const match_trans = line.match(/^\s*\[x-trans\](.*)/)121                    if(match_trans !== null) {122                        lyricData.push({123                            type: 'x-trans',124                            data: match_trans[1],125                        })126                    }127                }128            }129            retObj.lyricData = lyricData130            return retObj131        } catch (error) {132            console.log(error)133            return retObj134        }135    }136    /**137     * According to the capo position, calculate the corresponding chord138     * @param {string} key key = C    D     Fm139     * @param {number} capo 1140     * @returns B    C#    Em141     * @memberof LyricParser142     */143    getCapoKey(key, capo) {144        var ChordKey = ['C', 'C#/Bb', 'D', 'D#/Eb', 'E', 'F', 'F#/Gb', 'G', 'G#/Ab', 'A', 'A#/Bb', 'B']145        var lens = ChordKey.length146        for (var i = 0; i < lens; i++) {147            if (key === ChordKey[i]) {148                break149            } else if (key.length === 2 && ChordKey[i].search(key) !== -1) {150                break151            }152        }153        i = i - capo154        if (i < 0) {155            i = lens + i156        }157        var retKey = ChordKey[i]158        return retKey.length === 1 ? retKey : retKey.substr(0, 2)159    }160    /**161     * Get short name of chord.162     * @param {any} chord C:maj A:min C:7 D#:min7 N163     * @param {number} [capo=0] 0164     * @returns C     Am    C7  D#m7    Intro165     * @memberof LyricParser166     */167    getShortNameOfChord(chord, capo = 0) {168        if (chord === 'N') {169            return 'Intro'170        }171        var chordArray = chord.split(':')172        var chordKey = this.getCapoKey(chordArray[0], capo)173        var chordShap = chordArray[1]174        chordShap = chordShap.replace('maj', '').replace('min', 'm')175        return chordKey + chordShap176    }177    /**178     * Parse chord data.179     * @param {any} content180     * @returns181     * @memberof LyricParser182     */183    parseChordData(content, capo = 0) {184        var jsonObj = null185        try {186            if (typeof content === 'string') {187                jsonObj = JSON.parse(content)188            } else {189                jsonObj = content190            }191            this.duration = 0192            for (var key in jsonObj) {193                var item = jsonObj[key]194                if (item.chord === 'N') {195                    item.name = 'Intro'196                } else {197                    var chordArray = item.chord.split(':')198                    var chordKey = this.getCapoKey(chordArray[0], capo)199                    var chordShap = chordArray[1]200                    item.chord = `${chordKey}:${chordShap}`201                    var shortChordShap = chordShap.replace('maj', '').replace('min', 'm')202                    item.name = chordKey + shortChordShap203                }204                // item.width = item.end - item.start205                // this.duration += item.width206            }207            return jsonObj208        } catch (err) {209            console.log(err)210            return null211        }212    }213}214export {215    LyricParserV2...

Full Screen

Full Screen

mnhCompetion.js

Source:mnhCompetion.js Github

copy

Full Screen

1//跳转发表竞赛讨论页2mui('footer').on('tap','.comp-taolun',function(){3	jump('compsubTaolun.html');4});5Vue.filter('tiemFormate',function(time){6	var day=new Date(time*1000);7	return day.getFullYear()+'.'+parseInt(day.getMonth()+1)+'.'+day.getDate();  8});9Vue.http.options.emulateJSON = true;10var compVm=new Vue({11	el:'#compBody',12	computed:{13		14	},15	data:{16		compid:'',17		compData:'',18		pageNumber:1,19		totalPage:'',20		isFocus:'',            //关注21		isJoin:'',             //参与22		compComList:''23	},24	methods:{25		//竞赛讨论加载更多26		comploadMore:function(){27			this.pageNumber++;28			if(this.pageNumber>this.totalPage){29				return;30			}else{31				this.$http({method:'POST',url:URL+'/party/Match/match_comment',data:{match_id:this.compid,page:this.pageNumber}}).then(32					function(response){						33						if(response.data.success==true){34							for(var i=0;i<response.data.data.length;i++){35								this.compComList.push(response.data.data[i]);36							}37						}38					}39				)40			}			41		},42		//竞赛关注43		compFocus:function(){44			if(this.compData.status_info=='活动已结束'){mui.toast('该活动已经结束!'); return;}45			if(localStorage.uid=='' || localStorage.uid==undefined || localStorage.uid==null){  //未登录(肯定没关注)46		       var btnArray = ['取消', '确认'];47		        mui.confirm('登陆后才能关注哦!', '确认框', btnArray, function(e) {48		            if (e.index == 1){49						jump('land/login.html');		50		            } else {} 51		        });				52			}else if(this.isFocus=='已关注'){                         //已经登陆已关注(这时可以取消关注)53				this.$http({method:'POST',url:URL+'/party/Match/match_focus',data:{uid:localStorage.uid,match_id:this.compid,is_focus:0}}).then(54					function(response){if(response.data.success==true){mui.toast('您已经取消关注该报道!');this.isFocus='未关注'};this.compData.focus--;}55				)56			}else{                                                   //已登陆未关注57				this.$http({method:'POST',url:URL+'/party/Match/match_focus',data:{uid:localStorage.uid,match_id:this.compid,is_focus:1}}).then(58					function(response){if(response.data.success==true){mui.toast('您已经关注该报道!');this.isFocus='已关注'};this.compData.focus++;}59				)				60			} 			61		},62		//立即参与63		compJoin:function(){64			if(this.compData.status_info=='活动已结束'){mui.toast('该活动已经结束!'); return;}65			if(localStorage.uid=='' || localStorage.uid==undefined || localStorage.uid==null){  //未登录(肯定没参与)66		       var btnArray = ['取消', '确认'];67		        mui.confirm('登陆后才能关注哦!', '确认框', btnArray, function(e) {68		            if (e.index == 1){69						jump('land/login.html');		70		            } else {} 71		        });				72			}else if(this.isJoin=='已经参与'){                                                   //已登录(已参与)                                                    73				mui.toast('你已经参与过该项目!');74				return;75			}else{76				animateWindow('slide-in-bottom','mnhmeitit.html');                             //已登录(未参与),参与成功后刷新参与状态77			}78		},79		80		81	},82	ready:function(){83		this.compid=store.get('mnhCompe');    //alert(this.compid);84		loads();85//		竞赛详情86		this.$http({method:'POST',url:URL+'/party/match/match_detail',data:{match_id:this.compid,uid:localStorage.uid}}).then(87			function(response){88				if(response.data.success==true){89					this.compData=response.data.data;90					this.isFocus=response.data.data.is_focus.msg;        //关注(已关注/未关注)91					this.isJoin=response.data.data.is_join.msg;         //参与(立即参与/已经参与)					92					setTimeout(function(){loadh()},1000);93				}94			}95		);96//		竞赛全部讨论列表97		this.$http({method:'POST',url:URL+'/party/Match/match_comment',data:{match_id:this.compid}}).then(98			function(response){99//				console.log(response.data);100				if(response.data.success==true){101					this.compComList=response.data.data;102					this.totalPage=response.data.page.totalPage;103				}104			}105		);106		var _this=this;107//		登录后刷新竞赛详情108		window.addEventListener('status',function(){109			_this.$http({method:'POST',url:URL+'/party/match/match_detail',data:{match_id:_this.compid,uid:localStorage.uid}}).then(110				function(response){111					if(response.data.success==true){112						_this.compData=response.data.data;113						_this.isFocus=response.data.data.is_focus.msg;        114						_this.isJoin=response.data.data.is_join.msg;   				115					}116				}117			);			118		});119		//参与完成后,禁止再次参与120		window.addEventListener('canyu',function(){121			this.$http({method:'POST',url:URL+'/party/match/match_detail',data:{match_id:this.compid,uid:localStorage.uid}}).then(122				function(response){123//					console.log(response.data);124					if(response.data.success==true){125						this.compData=response.data.data;126						this.isFocus=response.data.data.is_focus.msg;     127						this.isJoin=response.data.data.is_join.msg;      				128					}129				}130			);			131		}.bind(this));132		//讨论完成后,刷新竞赛讨论列表  133		window.addEventListener('getTaolunList',function(){134			this.$http({method:'POST',url:URL+'/party/Match/match_comment',data:{match_id:this.compid}}).then(135				function(response){136					if(response.data.success==true){137						this.compComList=response.data.data;138						this.totalPage=response.data.page.totalPage;139						this.pageNumber=1;140					}141				}142			);			143		}.bind(this));144	}...

Full Screen

Full Screen

lexpy.js

Source:lexpy.js Github

copy

Full Screen

1var lexpy = (function () {2	"use strict";3	// Basic environment derection; can be hardcoded if the environment is known4	var module = (function (module) {5		try {6			if (window) return {};7		}8		catch (e) {}9		return module;10	})(this);11	// Generator function12	module.gen = function (lex) {13		// Language descriptor14		var descriptor = new lex.Descriptor([ //{15			"IGNORE",16			"MEMBER",17			"NEXT_IS_MEMBER",18			"NEXT_NO_OP_PREFIX",19			"START_STRING",20			"STRING_TRIPLE",21			"START_COMMENT",22			"BRACKET",23			"BRACKET_CLOSE",24		], "IGNORE"); //}25		var flags = descriptor.flags;26		descriptor.define_types({27			"INVALID": 0,28			"KEYWORD": 0,29			"IDENTIFIER": flags.NEXT_NO_OP_PREFIX,30			"NUMBER": flags.NEXT_NO_OP_PREFIX,31			"STRING": flags.NEXT_NO_OP_PREFIX,32			"OPERATOR": 0,33			"DECORATOR": 0,34			"WHITESPACE": flags.IGNORE,35			"COMMENT": flags.IGNORE,36		});37		var keywords = {38			"and": 0,39			"as": 0,40			"assert": 0,41			"break": 0,42			"class": 0,43			"continue": 0,44			"def": 0,45			"del": 0,46			"elif": 0,47			"else": 0,48			"except": 0,49			"finally": 0,50			"for": 0,51			"from": 0,52			"global": 0,53			"if": 0,54			"import": 0,55			"in": 0,56			"is": 0,57			"lambda": 0,58			"nonlocal": 0,59			"not": 0,60			"or": 0,61			"pass": 0,62			"raise": 0,63			"return": 0,64			"try": 0,65			"while": 0,66			"with": 0,67			"yield": 0,68		};69		var operators = lex.tree({70			">>=": 0,71			">>": 0,72			">=": 0,73			">": 0,74			"<<=": 0,75			"<<": 0,76			"<=": 0,77			"<": 0,78			"<>": 0,79			"==": 0,80			"=": 0,81			"!=": 0,82			"&=": 0,83			"&": 0,84			"|=": 0,85			"|": 0,86			"+=": 0,87			"+": 0,88			"-=": 0,89			"-": 0,90			"**=": 0,91			"**": 0,92			"*=": 0,93			"*": 0,94			"//=": 0,95			"//": 0,96			"/=": 0,97			"/": 0,98			"%=": 0,99			"%": 0,100			"^=": 0,101			"^": 0,102			"~": 0,103			":": 0,104			";": 0,105			",": 0,106			".": flags.NEXT_IS_MEMBER | flags.NEXT_NO_OP_PREFIX,107			"...": 0,108			"\\": 0,109			"(": flags.BRACKET,110			"[": flags.BRACKET,111			"{": flags.BRACKET,112			")": flags.BRACKET | flags.BRACKET_CLOSE | flags.NEXT_NO_OP_PREFIX,113			"]": flags.BRACKET | flags.BRACKET_CLOSE | flags.NEXT_NO_OP_PREFIX,114			"}": flags.BRACKET | flags.BRACKET_CLOSE,115			"#": flags.START_COMMENT,116			"\"": flags.START_STRING,117			"\"\"\"": flags.START_STRING | flags.STRING_TRIPLE,118			"\'": flags.START_STRING,119			"\'\'\'": flags.START_STRING | flags.STRING_TRIPLE,120		});121		// Matching logic122		var re_comment = /[^\r\n\u2028\u2029]*/g,123			re_newlines_search = /[\r\n\u2028\u2029]/,124			re_newlines_split = /[\n\u2028\u2029]|\r\n?/g;125		var match_string = function (t_info) {126			// Match to end of string127			var escaped = false,128				p = t_info[2],129				p_max = this.text.length,130				quote = this.text[this.pos],131				quote_count = 0,132				quote_length = ((t_info[1] & this.descriptor.flags.STRING_TRIPLE) !== 0) ? 3 : 1,133				c;134			for (; p < p_max; ++p) {135				c = this.text[p];136				if (escaped) {137					escaped = false;138					if (c === "\r" && p + 1 < p_max && this.text[p + 1] === "\n") {139						++p;140					}141				}142				else {143					if (c === quote) {144						if (++quote_count >= quote_length) {145							++p;146							break;147						}148					}149					else {150						quote_count = 0;151						if (c === "\\") {152							escaped = true;153						}154						else if (this.descriptor.string_contains_newline(c) && quote_length === 1) {155							break;156						}157					}158				}159			}160			t_info[0] = this.descriptor.STRING;161			t_info[2] = p;162		};163		var match_comment = function (t_info) {164			// Check which type165			var p = t_info[2],166				re = re_comment,167				m;168			// Match the comment169			re.lastIndex = p;170			m = re.exec(this.text);171			// Create the token172			t_info[0] = this.descriptor.COMMENT;173			t_info[2] = m.index + m[0].length;174		};175		// Checks/states176		descriptor.define_state_names([ "DEFAULT" ]);177		descriptor.define_state([ //{ state 0178			[179				lex.check_regex("\\s+"), // whitespace180				lex.create_token(descriptor.WHITESPACE),181			],182			[183				lex.check_regex("[+-]?(?:0[xX](?:[0-9a-fA-F]+)|[0-9]+(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?|\\.[0-9]+(?:[eE][+-]?[0-9]+)?)"), // number184				function (flags, p) {185					if ((this.previous.flags & this.descriptor.flags.NEXT_NO_OP_PREFIX) === 0 || this.match_tree(operators, this.pos, this.pos + 1) === null) {186						return this.create_token(descriptor.NUMBER, flags, p);187					}188					return null;189				},190			],191			[192				lex.check_regex("[\\w]+"), // word193				function (flags, p) {194					var token_type = this.descriptor.IDENTIFIER,195						word = this.text.substr(this.pos, p - this.pos);196					if ((this.previous.flags & this.descriptor.flags.NEXT_IS_MEMBER) !== 0) {197						// Member198						flags |= this.descriptor.flags.MEMBER;199					}200					// Check if keyword201					if (Object.prototype.hasOwnProperty.call(keywords, word)) {202						token_type = this.descriptor.KEYWORD;203						flags |= keywords[word];204					}205					return this.create_token(token_type, flags, p);206				},207			],208			[209				lex.check_regex("@[\\w]+"), // decorator210				lex.create_token(descriptor.DECORATOR),211			],212			[213				lex.check_tree(operators), // operator214				function (flags, p) {215					var t_info = [ this.descriptor.OPERATOR , flags , p ];216					if ((flags & this.descriptor.flags.START_STRING) !== 0) {217						// String218						match_string.call(this, t_info);219					}220					else if ((flags & this.descriptor.flags.START_COMMENT) !== 0) {221						// Comment222						match_comment.call(this, t_info);223					}224					else if ((flags & this.descriptor.flags.START_REGEX) !== 0) {225						// Regex226						match_regex.call(this, t_info);227					}228					return this.create_token(t_info[0], t_info[1], t_info[2]);229				},230			],231			[232				lex.check_regex("[^\\s\\w@" + lex.regex_escape(lex.to_regex_class(operators)) + "]+"), // invalid233				lex.create_token(descriptor.INVALID),234			],235		], 0); //}236		// Additional functions237		descriptor.string_contains_newline = function (text) {238			return re_newlines_search.test(text);239		};240		descriptor.string_splitlines = function (text) {241			var parts = [],242				start = 0,243				m;244			re_newlines_split.lastIndex = 0;245			while ((m = re_newlines_split.exec(text)) !== null) {246				parts.push(text.substr(start, m.index - start));247				start = m.index + m[0].length;248			}249			parts.push(text.substr(start));250			return parts;251		};252		// Complete253		return descriptor;254	};255	// Complete256	return module;...

Full Screen

Full Screen

stock.js

Source:stock.js Github

copy

Full Screen

1const Stock = require('../models/stock');2const errors = require('../helpers/errors');3const StockComment = require('../models/stockComment');4const mongoose = require('mongoose');5const Alert = require('../models/alert');6const alertHelper = require('../helpers/alert');7const STAGES = {8    GET_COMMENTS: {9        $lookup: {10            from: 'stockcomments',11            let: {12                stockId: '$_id'13            },14            pipeline: [15                {16                    $match: {17                        $expr: {18                            $eq: ['$$stockId', '$stockId']19                        }20                    }21                },22                {23                    $lookup: {24                        from: 'users',25                        let: {26                            authorId: '$authorId'27                        },28                        pipeline: [29                            {30                                $match: {31                                    $expr: {32                                        $eq: ['$$authorId', '$_id']33                                    }34                                }35                            },36                            {37                                $project: {38                                    name: 1,39                                    surname: 1,40                                    _id: 0,41                                }42                            }43                        ],44                        as: 'author'45                    }46                },47                {48                    $project: {49                        stockId: 050                    }51                }52            ],53            as: 'comments'54        }55    },56    MATCH_ID: (id) => {57        return {58            $match: {59                $expr: {60                    $eq: ['$_id', {61                        $toObjectId: id,62                    }]63                }64            }65        }66    },67    MATCH_COMMENT: (id) => {68        return {69            $match: {70                $expr: {71                    $eq: ['$_id', {72                        $toObjectId: id,73                    }]74                }75            }76        }77    },78};79module.exports.getAll = async () => {80    return await Stock81        .find()82        .select("-monthlyPrice -dailyPrice")83        .exec();84};85module.exports.getById = async (_id) => {86    if (!mongoose.Types.ObjectId.isValid(_id)) {87        throw errors.STOCK_NOT_FOUND();88    }89    const stock = await Stock.aggregate([90        STAGES.MATCH_ID(_id), STAGES.GET_COMMENTS91    ]);92    return stock[0];93};94module.exports.postComment = async (stockId, authorId, body) => {95    if (!(mongoose.Types.ObjectId.isValid(stockId))) {96        throw errors.STOCK_NOT_FOUND();97    }98    if (!(mongoose.Types.ObjectId.isValid(authorId))) {99        throw errors.USER_NOT_FOUND();100    }101    await StockComment.create({102        stockId,103        authorId,104        body,105    });106};107module.exports.getComment = async (stockId, commentId) => {108    if (!(mongoose.Types.ObjectId.isValid(stockId))) {109        throw errors.STOCK_NOT_FOUND();110    }111    if (!(mongoose.Types.ObjectId.isValid(commentId))) {112        throw errors.COMMENT_NOT_FOUND();113    }114    const comment = await StockComment.aggregate([115        STAGES.MATCH_COMMENT(commentId)116    ]).then();117    if (!comment) {118        throw errors.COMMENT_NOT_FOUND();119    }120    return comment[0];121};122module.exports.editComment = async (stockId, authorId, commentId, newBody) => {123    if (!(mongoose.Types.ObjectId.isValid(stockId))) {124        throw errors.STOCK_NOT_FOUND();125    }126    if (!(mongoose.Types.ObjectId.isValid(commentId))) {127        throw errors.COMMENT_NOT_FOUND();128    }129    if (!(mongoose.Types.ObjectId.isValid(authorId))) {130        throw errors.USER_NOT_FOUND();131    }132    const oldComment = await StockComment.findOneAndUpdate({_id: commentId, stockId: stockId, authorId},133        {body: newBody, edited: true, lastEditDate: Date.now()});134    if (!oldComment) {135        throw errors.COMMENT_NOT_FOUND();136    }137};138module.exports.deleteComment = async (stockId, commentId, authorId) => {139    if (!(mongoose.Types.ObjectId.isValid(stockId))) {140        throw errors.STOCK_NOT_FOUND();141    }142    if (!(mongoose.Types.ObjectId.isValid(commentId))) {143        throw errors.COMMENT_NOT_FOUND();144    }145    if (!(mongoose.Types.ObjectId.isValid(authorId))) {146        throw errors.USER_NOT_FOUND();147    }148    const comment = await StockComment.findOneAndDelete({_id: commentId, stockId, authorId});149    if (!comment) {150        throw errors.COMMENT_NOT_FOUND();151    }152};153module.exports.saveAlert = async (id, userId, direction, rate) => {154    if (!(mongoose.Types.ObjectId.isValid(id))) {155        throw errors.STOCK_NOT_FOUND();156    }157    if (!(mongoose.Types.ObjectId.isValid(userId))) {158        throw errors.USER_NOT_FOUND();159    }160    const stockSymbol = await Stock161        .findOne({_id: id})162        .select({stockSymbol: 1})163        .exec();164    await Alert.create({165        type: alertHelper.TYPE.STOCK,166        userId,167        direction,168        rate,169        stockId: id,170        stockSymbol: stockSymbol.stockSymbol,171    });172};173module.exports.deleteAlert = async (stockId, userId, alertId) => {174    if (!(mongoose.Types.ObjectId.isValid(stockId))) {175        throw errors.INVALID_CURRENCY_CODE();176    }177    if (!(mongoose.Types.ObjectId.isValid(userId))) {178        throw errors.USER_NOT_FOUND();179    }180    if (!(mongoose.Types.ObjectId.isValid(alertId))) {181        throw errors.ALERT_NOT_FOUND();182    }183    const alert = await Alert.findOneAndDelete({_id: alertId, type: alertHelper.TYPE.STOCK, stockId, userId});184    if (!alert) {185        throw errors.ALERT_NOT_FOUND();186    }...

Full Screen

Full Screen

token_matcher.js

Source:token_matcher.js Github

copy

Full Screen

...40      return true;41    }42    return false;43  };44  this.match_Comment = function match_Comment(token) {45    if(token.line.startsWith('#')) {46      var text = token.line.getLineText(0); //take the entire line, including leading space47      setTokenMatched(token, 'Comment', text, null, 0);48      return true;49    }50    return false;51  };52  this.match_Language = function match_Language(token) {53    var match;54    if(match = token.line.trimmedLineText.match(LANGUAGE_PATTERN)) {55      dialectName = match[1];56      dialect = dialects[dialectName];57      if(!dialect) {58        throw new Error("Unknown dialect: " + dialectName);...

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').toString();4var gherkinDocument = gherkin.parse(gherkinSource);5var comments = gherkinDocument.comments;6comments.forEach(function(comment){7  console.log(comment);8});9{ location: { line: 1, column: 1 }, text: '#comment 1' }10{ location: { line: 2, column: 1 }, text: '#comment 2' }

Full Screen

Using AI Code Generation

copy

Full Screen

1var Gherkin = require('gherkin');2var parser = new Gherkin.Parser();3var lexer = new Gherkin.Lexer('en');4var feature = parser.parse(lexer.lex("Feature: test5"));6console.log(feature);7console.log(feature.featureComments);8console.log(feature.featureComments[0].value);9console.log(feature.featureComments[0].match_Comment());10Comment.prototype.match_Comment = function() {11    return this.value.match(/#(.*)/);12};

Full Screen

Using AI Code Generation

copy

Full Screen

1var gherkin = require('gherkin');2var parser = new gherkin.Parser();3var match_Comment = parser.match_Comment;4var text = "#comment";5console.log(match_Comment(text, 0));6var gherkin = require('gherkin');7var parser = new gherkin.Parser();8var match_Comment = parser.match_Comment;9var fs = require('fs');10var text = fs.readFileSync('test.feature', 'utf8');11var comments = [];12var match;13while (match = match_Comment(text, 0)) {14    comments.push(match.matched);15    text = text.substr(match.location.column);16}17console.log(comments);

Full Screen

Using AI Code Generation

copy

Full Screen

1var cucumber = require('cucumber-gherkin');2var fs = require('fs');3var feature = fs.readFileSync('test.feature', 'utf8');4var comments = cucumber.match_Comment(feature);5console.log(comments);6[ { line: 1, match: '#language: en' },7  { line: 2, match: '#author: John Doe' },8  { line: 5, match: '#this is a comment' },9  { line: 6, match: '#this is another comment' },10  { line: 7, match: '#this is yet another comment' } ]11var comments = cucumber.match_Comment(feature);12var comment = comments.filter(function (comment) {13  return comment.line === 5;14})[0];15console.log(comment.match);16var comments = cucumber.match_Comment(feature);17var comment = comments.filter(function (comment) {18  return comment.line === 5;19})[0];20console.log(comment.match);21var comments = cucumber.match_Comment(feature);22var comment = comments.filter(function (comment) {23  return comment.line === 5;24})[0];25console.log(comment.match);26var comments = cucumber.match_Comment(feature);27var comment = comments.filter(function (comment) {28  return comment.line === 5;29})[0];30console.log(comment.match);

Full Screen

Using AI Code Generation

copy

Full Screen

1var gherkin = require('gherkin');2var fs = require('fs');3var parser = new gherkin.Parser();4var feature = fs.readFileSync('test.feature', 'utf8');5var match_Comment = function (comment) {6    console.log("Comment: " + comment);7    return comment;8};9var match_Tag = function (tag) {10    console.log("Tag: " + tag);11    return tag;12};13var match_FeatureLine = function (keyword, name, description, line) {14    console.log("Feature: " + keyword + " " + name + " " + description + " " + line);15    return {16    };17};18var match_BackgroundLine = function (keyword, name, description, line) {19    console.log("Background: " + keyword + " " + name + " " + description + " " + line);20    return {21    };22};23var match_ScenarioLine = function (keyword, name, description, line) {24    console.log("Scenario: " + keyword + " " + name + " " + description + " " + line);25    return {26    };27};28var match_ExamplesLine = function (keyword, name, description, line) {29    console.log("Examples: " + keyword + " " + name + " " + description + " " + line);30    return {31    };32};33var match_StepLine = function (keyword, name, line) {34    console.log("Step: " + keyword + " " + name + " " + line);35    return {36    };37};38var match_DocStringSeparator = function (separator, content_type) {39    console.log("DocStringSeparator: " + separator + " " + content_type);40    return {41    };42};43var match_TableRow = function (cells) {44    console.log("TableRow: "

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