Best Gherkin-ruby code snippet using Gherkin.match_token_at_1
parser.rb
Source:parser.rb
...192 case state193 when 0194 match_token_at_0(token, context)195 when 1196 match_token_at_1(token, context)197 when 2198 match_token_at_2(token, context)199 when 3200 match_token_at_3(token, context)201 when 4202 match_token_at_4(token, context)203 when 5204 match_token_at_5(token, context)205 when 6206 match_token_at_6(token, context)207 when 7208 match_token_at_7(token, context)209 when 8210 match_token_at_8(token, context)211 when 9212 match_token_at_9(token, context)213 when 10214 match_token_at_10(token, context)215 when 11216 match_token_at_11(token, context)217 when 12218 match_token_at_12(token, context)219 when 13220 match_token_at_13(token, context)221 when 14222 match_token_at_14(token, context)223 when 15224 match_token_at_15(token, context)225 when 16226 match_token_at_16(token, context)227 when 17228 match_token_at_17(token, context)229 when 18230 match_token_at_18(token, context)231 when 19232 match_token_at_19(token, context)233 when 20234 match_token_at_20(token, context)235 when 21236 match_token_at_21(token, context)237 when 22238 match_token_at_22(token, context)239 when 23240 match_token_at_23(token, context)241 when 24242 match_token_at_24(token, context)243 when 25244 match_token_at_25(token, context)245 when 26246 match_token_at_26(token, context)247 when 28248 match_token_at_28(token, context)249 when 29250 match_token_at_29(token, context)251 when 30252 match_token_at_30(token, context)253 when 31254 match_token_at_31(token, context)255 when 32256 match_token_at_32(token, context)257 when 33258 match_token_at_33(token, context)259 else260 raise InvalidOperationException, "Unknown state: #{state}"261 end262 end263 # Start264 def match_token_at_0(token, context)265 if match_EOF(context, token)266 build(context, token);267 return 27268 end269 if match_Language(context, token)270 start_rule(context, :Feature);271 start_rule(context, :Feature_Header);272 build(context, token);273 return 1274 end275 if match_TagLine(context, token)276 start_rule(context, :Feature);277 start_rule(context, :Feature_Header);278 start_rule(context, :Tags);279 build(context, token);280 return 2281 end282 if match_FeatureLine(context, token)283 start_rule(context, :Feature);284 start_rule(context, :Feature_Header);285 build(context, token);286 return 3287 end288 if match_Comment(context, token)289 build(context, token);290 return 0291 end292 if match_Empty(context, token)293 build(context, token);294 return 0295 end296 297 state_comment = "State: 0 - Start"298 token.detach299 expected_tokens = ["#EOF", "#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"]300 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)301 raise error if (stop_at_first_error)302 add_error(context, error)303 return 0304 end305 # GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0306 def match_token_at_1(token, context)307 if match_TagLine(context, token)308 start_rule(context, :Tags);309 build(context, token);310 return 2311 end312 if match_FeatureLine(context, token)313 build(context, token);314 return 3315 end316 if match_Comment(context, token)317 build(context, token);318 return 1319 end320 if match_Empty(context, token)321 build(context, token);322 return 1323 end324 325 state_comment = "State: 1 - GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0"326 token.detach327 expected_tokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"]328 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)329 raise error if (stop_at_first_error)330 add_error(context, error)331 return 1332 end333 # GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0334 def match_token_at_2(token, context)335 if match_TagLine(context, token)336 build(context, token);337 return 2338 end339 if match_FeatureLine(context, token)340 end_rule(context, :Tags);341 build(context, token);342 return 3343 end344 if match_Comment(context, token)345 build(context, token);346 return 2347 end348 if match_Empty(context, token)349 build(context, token);350 return 2351 end352 353 state_comment = "State: 2 - GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0"354 token.detach355 expected_tokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"]356 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)357 raise error if (stop_at_first_error)358 add_error(context, error)359 return 2360 end361 # GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0362 def match_token_at_3(token, context)363 if match_EOF(context, token)364 end_rule(context, :Feature_Header);365 end_rule(context, :Feature);366 build(context, token);367 return 27368 end369 if match_Empty(context, token)370 build(context, token);371 return 3372 end373 if match_Comment(context, token)374 build(context, token);375 return 5376 end377 if match_BackgroundLine(context, token)378 end_rule(context, :Feature_Header);379 start_rule(context, :Background);380 build(context, token);381 return 6382 end383 if match_TagLine(context, token)384 end_rule(context, :Feature_Header);385 start_rule(context, :Scenario_Definition);386 start_rule(context, :Tags);387 build(context, token);388 return 11389 end390 if match_ScenarioLine(context, token)391 end_rule(context, :Feature_Header);392 start_rule(context, :Scenario_Definition);393 start_rule(context, :Scenario);394 build(context, token);395 return 12396 end397 if match_ScenarioOutlineLine(context, token)398 end_rule(context, :Feature_Header);399 start_rule(context, :Scenario_Definition);400 start_rule(context, :ScenarioOutline);401 build(context, token);402 return 17403 end404 if match_Other(context, token)405 start_rule(context, :Description);406 build(context, token);407 return 4408 end409 410 state_comment = "State: 3 - GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0"411 token.detach412 expected_tokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]413 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)414 raise error if (stop_at_first_error)415 add_error(context, error)416 return 3417 end418 # GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0419 def match_token_at_4(token, context)420 if match_EOF(context, token)421 end_rule(context, :Description);422 end_rule(context, :Feature_Header);423 end_rule(context, :Feature);424 build(context, token);425 return 27426 end427 if match_Comment(context, token)428 end_rule(context, :Description);429 build(context, token);430 return 5431 end432 if match_BackgroundLine(context, token)433 end_rule(context, :Description);434 end_rule(context, :Feature_Header);435 start_rule(context, :Background);436 build(context, token);437 return 6438 end439 if match_TagLine(context, token)440 end_rule(context, :Description);441 end_rule(context, :Feature_Header);442 start_rule(context, :Scenario_Definition);443 start_rule(context, :Tags);444 build(context, token);445 return 11446 end447 if match_ScenarioLine(context, token)448 end_rule(context, :Description);449 end_rule(context, :Feature_Header);450 start_rule(context, :Scenario_Definition);451 start_rule(context, :Scenario);452 build(context, token);453 return 12454 end455 if match_ScenarioOutlineLine(context, token)456 end_rule(context, :Description);457 end_rule(context, :Feature_Header);458 start_rule(context, :Scenario_Definition);459 start_rule(context, :ScenarioOutline);460 build(context, token);461 return 17462 end463 if match_Other(context, token)464 build(context, token);465 return 4466 end467 468 state_comment = "State: 4 - GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0"469 token.detach470 expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]471 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)472 raise error if (stop_at_first_error)473 add_error(context, error)474 return 4475 end476 # GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0477 def match_token_at_5(token, context)478 if match_EOF(context, token)479 end_rule(context, :Feature_Header);480 end_rule(context, :Feature);481 build(context, token);482 return 27483 end484 if match_Comment(context, token)485 build(context, token);486 return 5487 end488 if match_BackgroundLine(context, token)489 end_rule(context, :Feature_Header);490 start_rule(context, :Background);491 build(context, token);492 return 6493 end494 if match_TagLine(context, token)495 end_rule(context, :Feature_Header);496 start_rule(context, :Scenario_Definition);497 start_rule(context, :Tags);498 build(context, token);499 return 11500 end501 if match_ScenarioLine(context, token)502 end_rule(context, :Feature_Header);503 start_rule(context, :Scenario_Definition);504 start_rule(context, :Scenario);505 build(context, token);506 return 12507 end508 if match_ScenarioOutlineLine(context, token)509 end_rule(context, :Feature_Header);510 start_rule(context, :Scenario_Definition);511 start_rule(context, :ScenarioOutline);512 build(context, token);513 return 17514 end515 if match_Empty(context, token)516 build(context, token);517 return 5518 end519 520 state_comment = "State: 5 - GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0"521 token.detach522 expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]523 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)524 raise error if (stop_at_first_error)525 add_error(context, error)526 return 5527 end528 # GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0529 def match_token_at_6(token, context)530 if match_EOF(context, token)531 end_rule(context, :Background);532 end_rule(context, :Feature);533 build(context, token);534 return 27535 end536 if match_Empty(context, token)537 build(context, token);538 return 6539 end540 if match_Comment(context, token)541 build(context, token);542 return 8543 end544 if match_StepLine(context, token)545 start_rule(context, :Step);546 build(context, token);547 return 9548 end549 if match_TagLine(context, token)550 end_rule(context, :Background);551 start_rule(context, :Scenario_Definition);552 start_rule(context, :Tags);553 build(context, token);554 return 11555 end556 if match_ScenarioLine(context, token)557 end_rule(context, :Background);558 start_rule(context, :Scenario_Definition);559 start_rule(context, :Scenario);560 build(context, token);561 return 12562 end563 if match_ScenarioOutlineLine(context, token)564 end_rule(context, :Background);565 start_rule(context, :Scenario_Definition);566 start_rule(context, :ScenarioOutline);567 build(context, token);568 return 17569 end570 if match_Other(context, token)571 start_rule(context, :Description);572 build(context, token);573 return 7574 end575 576 state_comment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0"577 token.detach578 expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]579 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)580 raise error if (stop_at_first_error)581 add_error(context, error)582 return 6583 end584 # GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0585 def match_token_at_7(token, context)586 if match_EOF(context, token)587 end_rule(context, :Description);588 end_rule(context, :Background);589 end_rule(context, :Feature);590 build(context, token);591 return 27592 end593 if match_Comment(context, token)594 end_rule(context, :Description);595 build(context, token);596 return 8597 end598 if match_StepLine(context, token)599 end_rule(context, :Description);600 start_rule(context, :Step);601 build(context, token);602 return 9603 end604 if match_TagLine(context, token)605 end_rule(context, :Description);606 end_rule(context, :Background);607 start_rule(context, :Scenario_Definition);608 start_rule(context, :Tags);609 build(context, token);610 return 11611 end612 if match_ScenarioLine(context, token)613 end_rule(context, :Description);614 end_rule(context, :Background);615 start_rule(context, :Scenario_Definition);616 start_rule(context, :Scenario);617 build(context, token);618 return 12619 end620 if match_ScenarioOutlineLine(context, token)621 end_rule(context, :Description);622 end_rule(context, :Background);623 start_rule(context, :Scenario_Definition);624 start_rule(context, :ScenarioOutline);625 build(context, token);626 return 17627 end628 if match_Other(context, token)629 build(context, token);630 return 7631 end632 633 state_comment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0"634 token.detach635 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]636 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)637 raise error if (stop_at_first_error)638 add_error(context, error)639 return 7640 end641 # GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0642 def match_token_at_8(token, context)643 if match_EOF(context, token)644 end_rule(context, :Background);645 end_rule(context, :Feature);646 build(context, token);647 return 27648 end649 if match_Comment(context, token)650 build(context, token);651 return 8652 end653 if match_StepLine(context, token)654 start_rule(context, :Step);655 build(context, token);656 return 9657 end658 if match_TagLine(context, token)659 end_rule(context, :Background);660 start_rule(context, :Scenario_Definition);661 start_rule(context, :Tags);662 build(context, token);663 return 11664 end665 if match_ScenarioLine(context, token)666 end_rule(context, :Background);667 start_rule(context, :Scenario_Definition);668 start_rule(context, :Scenario);669 build(context, token);670 return 12671 end672 if match_ScenarioOutlineLine(context, token)673 end_rule(context, :Background);674 start_rule(context, :Scenario_Definition);675 start_rule(context, :ScenarioOutline);676 build(context, token);677 return 17678 end679 if match_Empty(context, token)680 build(context, token);681 return 8682 end683 684 state_comment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0"685 token.detach686 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]687 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)688 raise error if (stop_at_first_error)689 add_error(context, error)690 return 8691 end692 # GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0693 def match_token_at_9(token, context)694 if match_EOF(context, token)695 end_rule(context, :Step);696 end_rule(context, :Background);697 end_rule(context, :Feature);698 build(context, token);699 return 27700 end701 if match_TableRow(context, token)702 start_rule(context, :DataTable);703 build(context, token);704 return 10705 end706 if match_DocStringSeparator(context, token)707 start_rule(context, :DocString);708 build(context, token);709 return 32710 end711 if match_StepLine(context, token)712 end_rule(context, :Step);713 start_rule(context, :Step);714 build(context, token);715 return 9716 end717 if match_TagLine(context, token)718 end_rule(context, :Step);719 end_rule(context, :Background);720 start_rule(context, :Scenario_Definition);721 start_rule(context, :Tags);722 build(context, token);723 return 11724 end725 if match_ScenarioLine(context, token)726 end_rule(context, :Step);727 end_rule(context, :Background);728 start_rule(context, :Scenario_Definition);729 start_rule(context, :Scenario);730 build(context, token);731 return 12732 end733 if match_ScenarioOutlineLine(context, token)734 end_rule(context, :Step);735 end_rule(context, :Background);736 start_rule(context, :Scenario_Definition);737 start_rule(context, :ScenarioOutline);738 build(context, token);739 return 17740 end741 if match_Comment(context, token)742 build(context, token);743 return 9744 end745 if match_Empty(context, token)746 build(context, token);747 return 9748 end749 750 state_comment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0"751 token.detach752 expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]753 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)754 raise error if (stop_at_first_error)755 add_error(context, error)756 return 9757 end758 # GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0759 def match_token_at_10(token, context)760 if match_EOF(context, token)761 end_rule(context, :DataTable);762 end_rule(context, :Step);763 end_rule(context, :Background);764 end_rule(context, :Feature);765 build(context, token);766 return 27767 end768 if match_TableRow(context, token)769 build(context, token);770 return 10771 end772 if match_StepLine(context, token)773 end_rule(context, :DataTable);774 end_rule(context, :Step);775 start_rule(context, :Step);776 build(context, token);777 return 9778 end779 if match_TagLine(context, token)780 end_rule(context, :DataTable);781 end_rule(context, :Step);782 end_rule(context, :Background);783 start_rule(context, :Scenario_Definition);784 start_rule(context, :Tags);785 build(context, token);786 return 11787 end788 if match_ScenarioLine(context, token)789 end_rule(context, :DataTable);790 end_rule(context, :Step);791 end_rule(context, :Background);792 start_rule(context, :Scenario_Definition);793 start_rule(context, :Scenario);794 build(context, token);795 return 12796 end797 if match_ScenarioOutlineLine(context, token)798 end_rule(context, :DataTable);799 end_rule(context, :Step);800 end_rule(context, :Background);801 start_rule(context, :Scenario_Definition);802 start_rule(context, :ScenarioOutline);803 build(context, token);804 return 17805 end806 if match_Comment(context, token)807 build(context, token);808 return 10809 end810 if match_Empty(context, token)811 build(context, token);812 return 10813 end814 815 state_comment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0"816 token.detach817 expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]818 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)819 raise error if (stop_at_first_error)820 add_error(context, error)821 return 10822 end823 # GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0824 def match_token_at_11(token, context)825 if match_TagLine(context, token)826 build(context, token);827 return 11828 end829 if match_ScenarioLine(context, token)830 end_rule(context, :Tags);831 start_rule(context, :Scenario);832 build(context, token);833 return 12834 end835 if match_ScenarioOutlineLine(context, token)836 end_rule(context, :Tags);837 start_rule(context, :ScenarioOutline);838 build(context, token);839 return 17840 end841 if match_Comment(context, token)842 build(context, token);843 return 11844 end845 if match_Empty(context, token)846 build(context, token);847 return 11848 end849 850 state_comment = "State: 11 - GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0"851 token.detach852 expected_tokens = ["#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]853 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)854 raise error if (stop_at_first_error)855 add_error(context, error)856 return 11857 end858 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0859 def match_token_at_12(token, context)860 if match_EOF(context, token)861 end_rule(context, :Scenario);862 end_rule(context, :Scenario_Definition);863 end_rule(context, :Feature);864 build(context, token);865 return 27866 end867 if match_Empty(context, token)868 build(context, token);869 return 12870 end871 if match_Comment(context, token)872 build(context, token);873 return 14874 end875 if match_StepLine(context, token)876 start_rule(context, :Step);877 build(context, token);878 return 15879 end880 if match_TagLine(context, token)881 end_rule(context, :Scenario);882 end_rule(context, :Scenario_Definition);883 start_rule(context, :Scenario_Definition);884 start_rule(context, :Tags);885 build(context, token);886 return 11887 end888 if match_ScenarioLine(context, token)889 end_rule(context, :Scenario);890 end_rule(context, :Scenario_Definition);891 start_rule(context, :Scenario_Definition);892 start_rule(context, :Scenario);893 build(context, token);894 return 12895 end896 if match_ScenarioOutlineLine(context, token)897 end_rule(context, :Scenario);898 end_rule(context, :Scenario_Definition);899 start_rule(context, :Scenario_Definition);900 start_rule(context, :ScenarioOutline);901 build(context, token);902 return 17903 end904 if match_Other(context, token)905 start_rule(context, :Description);906 build(context, token);907 return 13908 end909 910 state_comment = "State: 12 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0"911 token.detach912 expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]913 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)914 raise error if (stop_at_first_error)915 add_error(context, error)916 return 12917 end918 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0919 def match_token_at_13(token, context)920 if match_EOF(context, token)921 end_rule(context, :Description);922 end_rule(context, :Scenario);923 end_rule(context, :Scenario_Definition);924 end_rule(context, :Feature);925 build(context, token);926 return 27927 end928 if match_Comment(context, token)929 end_rule(context, :Description);930 build(context, token);931 return 14932 end933 if match_StepLine(context, token)934 end_rule(context, :Description);935 start_rule(context, :Step);936 build(context, token);937 return 15938 end939 if match_TagLine(context, token)940 end_rule(context, :Description);941 end_rule(context, :Scenario);942 end_rule(context, :Scenario_Definition);943 start_rule(context, :Scenario_Definition);944 start_rule(context, :Tags);945 build(context, token);946 return 11947 end948 if match_ScenarioLine(context, token)949 end_rule(context, :Description);950 end_rule(context, :Scenario);951 end_rule(context, :Scenario_Definition);952 start_rule(context, :Scenario_Definition);953 start_rule(context, :Scenario);954 build(context, token);955 return 12956 end957 if match_ScenarioOutlineLine(context, token)958 end_rule(context, :Description);959 end_rule(context, :Scenario);960 end_rule(context, :Scenario_Definition);961 start_rule(context, :Scenario_Definition);962 start_rule(context, :ScenarioOutline);963 build(context, token);964 return 17965 end966 if match_Other(context, token)967 build(context, token);968 return 13969 end970 971 state_comment = "State: 13 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0"972 token.detach973 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]974 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)975 raise error if (stop_at_first_error)976 add_error(context, error)977 return 13978 end979 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0980 def match_token_at_14(token, context)981 if match_EOF(context, token)982 end_rule(context, :Scenario);983 end_rule(context, :Scenario_Definition);984 end_rule(context, :Feature);985 build(context, token);986 return 27987 end988 if match_Comment(context, token)989 build(context, token);990 return 14991 end992 if match_StepLine(context, token)993 start_rule(context, :Step);994 build(context, token);995 return 15996 end997 if match_TagLine(context, token)998 end_rule(context, :Scenario);999 end_rule(context, :Scenario_Definition);1000 start_rule(context, :Scenario_Definition);1001 start_rule(context, :Tags);1002 build(context, token);1003 return 111004 end1005 if match_ScenarioLine(context, token)1006 end_rule(context, :Scenario);1007 end_rule(context, :Scenario_Definition);1008 start_rule(context, :Scenario_Definition);1009 start_rule(context, :Scenario);1010 build(context, token);1011 return 121012 end1013 if match_ScenarioOutlineLine(context, token)1014 end_rule(context, :Scenario);1015 end_rule(context, :Scenario_Definition);1016 start_rule(context, :Scenario_Definition);1017 start_rule(context, :ScenarioOutline);1018 build(context, token);1019 return 171020 end1021 if match_Empty(context, token)1022 build(context, token);1023 return 141024 end1025 1026 state_comment = "State: 14 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0"1027 token.detach1028 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"]1029 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1030 raise error if (stop_at_first_error)1031 add_error(context, error)1032 return 141033 end1034 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:01035 def match_token_at_15(token, context)1036 if match_EOF(context, token)1037 end_rule(context, :Step);1038 end_rule(context, :Scenario);1039 end_rule(context, :Scenario_Definition);1040 end_rule(context, :Feature);1041 build(context, token);1042 return 271043 end1044 if match_TableRow(context, token)1045 start_rule(context, :DataTable);1046 build(context, token);1047 return 161048 end1049 if match_DocStringSeparator(context, token)1050 start_rule(context, :DocString);1051 build(context, token);1052 return 301053 end1054 if match_StepLine(context, token)1055 end_rule(context, :Step);1056 start_rule(context, :Step);1057 build(context, token);1058 return 151059 end1060 if match_TagLine(context, token)1061 end_rule(context, :Step);1062 end_rule(context, :Scenario);1063 end_rule(context, :Scenario_Definition);1064 start_rule(context, :Scenario_Definition);1065 start_rule(context, :Tags);1066 build(context, token);1067 return 111068 end1069 if match_ScenarioLine(context, token)1070 end_rule(context, :Step);1071 end_rule(context, :Scenario);1072 end_rule(context, :Scenario_Definition);1073 start_rule(context, :Scenario_Definition);1074 start_rule(context, :Scenario);1075 build(context, token);1076 return 121077 end1078 if match_ScenarioOutlineLine(context, token)1079 end_rule(context, :Step);1080 end_rule(context, :Scenario);1081 end_rule(context, :Scenario_Definition);1082 start_rule(context, :Scenario_Definition);1083 start_rule(context, :ScenarioOutline);1084 build(context, token);1085 return 171086 end1087 if match_Comment(context, token)1088 build(context, token);1089 return 151090 end1091 if match_Empty(context, token)1092 build(context, token);1093 return 151094 end1095 1096 state_comment = "State: 15 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0"1097 token.detach1098 expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]1099 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1100 raise error if (stop_at_first_error)1101 add_error(context, error)1102 return 151103 end1104 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:01105 def match_token_at_16(token, context)1106 if match_EOF(context, token)1107 end_rule(context, :DataTable);1108 end_rule(context, :Step);1109 end_rule(context, :Scenario);1110 end_rule(context, :Scenario_Definition);1111 end_rule(context, :Feature);1112 build(context, token);1113 return 271114 end1115 if match_TableRow(context, token)1116 build(context, token);1117 return 161118 end1119 if match_StepLine(context, token)1120 end_rule(context, :DataTable);1121 end_rule(context, :Step);1122 start_rule(context, :Step);1123 build(context, token);1124 return 151125 end1126 if match_TagLine(context, token)1127 end_rule(context, :DataTable);1128 end_rule(context, :Step);1129 end_rule(context, :Scenario);1130 end_rule(context, :Scenario_Definition);1131 start_rule(context, :Scenario_Definition);1132 start_rule(context, :Tags);1133 build(context, token);1134 return 111135 end1136 if match_ScenarioLine(context, token)1137 end_rule(context, :DataTable);1138 end_rule(context, :Step);1139 end_rule(context, :Scenario);1140 end_rule(context, :Scenario_Definition);1141 start_rule(context, :Scenario_Definition);1142 start_rule(context, :Scenario);1143 build(context, token);1144 return 121145 end1146 if match_ScenarioOutlineLine(context, token)1147 end_rule(context, :DataTable);1148 end_rule(context, :Step);1149 end_rule(context, :Scenario);1150 end_rule(context, :Scenario_Definition);1151 start_rule(context, :Scenario_Definition);1152 start_rule(context, :ScenarioOutline);1153 build(context, token);1154 return 171155 end1156 if match_Comment(context, token)1157 build(context, token);1158 return 161159 end1160 if match_Empty(context, token)1161 build(context, token);1162 return 161163 end1164 1165 state_comment = "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"1166 token.detach1167 expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"]1168 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1169 raise error if (stop_at_first_error)1170 add_error(context, error)1171 return 161172 end1173 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:01174 def match_token_at_17(token, context)1175 if match_EOF(context, token)1176 end_rule(context, :ScenarioOutline);1177 end_rule(context, :Scenario_Definition);1178 end_rule(context, :Feature);1179 build(context, token);1180 return 271181 end1182 if match_Empty(context, token)1183 build(context, token);1184 return 171185 end1186 if match_Comment(context, token)1187 build(context, token);1188 return 191189 end1190 if match_StepLine(context, token)1191 start_rule(context, :Step);1192 build(context, token);1193 return 201194 end1195 if match_TagLine(context, token)1196 if lookahead_0(context, token)1197 start_rule(context, :Examples_Definition);1198 start_rule(context, :Tags);1199 build(context, token);1200 return 221201 end1202 end1203 if match_TagLine(context, token)1204 end_rule(context, :ScenarioOutline);1205 end_rule(context, :Scenario_Definition);1206 start_rule(context, :Scenario_Definition);1207 start_rule(context, :Tags);1208 build(context, token);1209 return 111210 end1211 if match_ExamplesLine(context, token)1212 start_rule(context, :Examples_Definition);1213 start_rule(context, :Examples);1214 build(context, token);1215 return 231216 end1217 if match_ScenarioLine(context, token)1218 end_rule(context, :ScenarioOutline);1219 end_rule(context, :Scenario_Definition);1220 start_rule(context, :Scenario_Definition);1221 start_rule(context, :Scenario);1222 build(context, token);1223 return 121224 end1225 if match_ScenarioOutlineLine(context, token)1226 end_rule(context, :ScenarioOutline);1227 end_rule(context, :Scenario_Definition);1228 start_rule(context, :Scenario_Definition);1229 start_rule(context, :ScenarioOutline);1230 build(context, token);1231 return 171232 end1233 if match_Other(context, token)1234 start_rule(context, :Description);1235 build(context, token);1236 return 181237 end1238 1239 state_comment = "State: 17 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0"1240 token.detach1241 expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]1242 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1243 raise error if (stop_at_first_error)1244 add_error(context, error)1245 return 171246 end1247 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:01248 def match_token_at_18(token, context)1249 if match_EOF(context, token)1250 end_rule(context, :Description);1251 end_rule(context, :ScenarioOutline);1252 end_rule(context, :Scenario_Definition);1253 end_rule(context, :Feature);1254 build(context, token);1255 return 271256 end1257 if match_Comment(context, token)1258 end_rule(context, :Description);1259 build(context, token);1260 return 191261 end1262 if match_StepLine(context, token)1263 end_rule(context, :Description);1264 start_rule(context, :Step);1265 build(context, token);1266 return 201267 end1268 if match_TagLine(context, token)1269 if lookahead_0(context, token)1270 end_rule(context, :Description);1271 start_rule(context, :Examples_Definition);1272 start_rule(context, :Tags);1273 build(context, token);1274 return 221275 end1276 end1277 if match_TagLine(context, token)1278 end_rule(context, :Description);1279 end_rule(context, :ScenarioOutline);1280 end_rule(context, :Scenario_Definition);1281 start_rule(context, :Scenario_Definition);1282 start_rule(context, :Tags);1283 build(context, token);1284 return 111285 end1286 if match_ExamplesLine(context, token)1287 end_rule(context, :Description);1288 start_rule(context, :Examples_Definition);1289 start_rule(context, :Examples);1290 build(context, token);1291 return 231292 end1293 if match_ScenarioLine(context, token)1294 end_rule(context, :Description);1295 end_rule(context, :ScenarioOutline);1296 end_rule(context, :Scenario_Definition);1297 start_rule(context, :Scenario_Definition);1298 start_rule(context, :Scenario);1299 build(context, token);1300 return 121301 end1302 if match_ScenarioOutlineLine(context, token)1303 end_rule(context, :Description);1304 end_rule(context, :ScenarioOutline);1305 end_rule(context, :Scenario_Definition);1306 start_rule(context, :Scenario_Definition);1307 start_rule(context, :ScenarioOutline);1308 build(context, token);1309 return 171310 end1311 if match_Other(context, token)1312 build(context, token);1313 return 181314 end1315 1316 state_comment = "State: 18 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0"1317 token.detach1318 expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"]1319 error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment)1320 raise error if (stop_at_first_error)1321 add_error(context, error)1322 return 181323 end1324 # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:01325 def match_token_at_19(token, context)1326 if match_EOF(context, token)1327 end_rule(context, :ScenarioOutline);1328 end_rule(context, :Scenario_Definition);1329 end_rule(context, :Feature);1330 build(context, token);1331 return 271332 end1333 if match_Comment(context, token)1334 build(context, token);1335 return 191336 end1337 if match_StepLine(context, token)1338 start_rule(context, :Step);1339 build(context, token);...
cucumber-gherkin.rbi
Source:cucumber-gherkin.rbi
...190 def match_TableRow(context, token); end191 def match_TagLine(context, token); end192 def match_token(state, token, context); end193 def match_token_at_0(token, context); end194 def match_token_at_1(token, context); end195 def match_token_at_10(token, context); end196 def match_token_at_11(token, context); end197 def match_token_at_12(token, context); end198 def match_token_at_13(token, context); end199 def match_token_at_14(token, context); end200 def match_token_at_15(token, context); end201 def match_token_at_16(token, context); end202 def match_token_at_17(token, context); end203 def match_token_at_18(token, context); end204 def match_token_at_19(token, context); end205 def match_token_at_2(token, context); end206 def match_token_at_20(token, context); end207 def match_token_at_21(token, context); end208 def match_token_at_22(token, context); end209 def match_token_at_23(token, context); end210 def match_token_at_24(token, context); end211 def match_token_at_25(token, context); end212 def match_token_at_26(token, context); end213 def match_token_at_27(token, context); end214 def match_token_at_28(token, context); end215 def match_token_at_29(token, context); end216 def match_token_at_3(token, context); end217 def match_token_at_30(token, context); end218 def match_token_at_31(token, context); end...
match_token_at_1
Using AI Code Generation
1def match_token_at_1(text, token)2 lexer = Gherkin::Parser::Lexer.new(text)3 lexer.match_token_at(1, token)4def match_token_at_1(text, token)5 feature = parser.parse(text)
match_token_at_1
Using AI Code Generation
1gherkin = Gherkin.new(input)2 def initialize(input)3 gherkin = Gherkin.new("Background: blah")4 expect(gherkin.match_token_at_1).to eq("Background")5 def initialize(input)6 @input.match(/[a-zA-Z]+/).to_s
match_token_at_1
Using AI Code Generation
1gherkin = Gherkin::Parser::Parser.new.parse(File.read('test.feature'))2gherkin.match_token_at_1(1, 'Scenario')3gherkin = Gherkin::Parser::Parser.new.parse(File.read('test.feature'))4gherkin.match_token_at_1(1, 'Scenario:')5gherkin = Gherkin::Parser::Parser.new.parse(File.read('test.feature'))6gherkin.match_token_at_1(1, 'Scenario', 'Scenario Outline')7gherkin = Gherkin::Parser::Parser.new.parse(File.read('test.feature'))8gherkin.match_token_at_1(1, 'Scenario:', 'Scenario Outline:')9gherkin = Gherkin::Parser::Parser.new.parse(File.read('test.feature'))10gherkin.match_token_at_1(1, 'Scenario', 'Scenario Outline:')
match_token_at_1
Using AI Code Generation
1str = 'if (x == 0)'2puts Gherkin.match_token_at_1(str, 1)3str = 'if (x == 0)'4puts Gherkin.match_token_at_1(str, 1, :if)5str = 'if (x == 0)'6puts Gherkin.match_token_at_1(str, 1, :if, :else)7str = 'if (x == 0)'8puts Gherkin.match_token_at_1(str, 1, :if, :else, :elif)9str = 'if (x == 0)'10puts Gherkin.match_token_at_1(str, 1, :if, :else, :elif, :unless)11str = 'if (x == 0)'12puts Gherkin.match_token_at_1(str, 1, :if, :else, :elif, :unless, :case)
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!