From 83d7a602c7c075a74a04b93153e0520965aa47c0 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Sun, 27 Dec 2020 22:35:44 +0100 Subject: [PATCH 1/5] Support Rule and Scenario Outline changes in Perl --- gherkin/perl/lib/Gherkin/Dialect.pm | 1 + .../perl/lib/Gherkin/Generated/Languages.pm | 1 + gherkin/perl/lib/Gherkin/Generated/Parser.pm | 2465 +++++++++++++---- gherkin/perl/lib/Gherkin/TokenMatcher.pm | 14 +- 4 files changed, 1891 insertions(+), 590 deletions(-) diff --git a/gherkin/perl/lib/Gherkin/Dialect.pm b/gherkin/perl/lib/Gherkin/Dialect.pm index b1eabcba82..7ae75d35e8 100644 --- a/gherkin/perl/lib/Gherkin/Dialect.pm +++ b/gherkin/perl/lib/Gherkin/Dialect.pm @@ -38,6 +38,7 @@ sub change_dialect { } sub Feature { $_[0]->dictionary->{ $_[0]->dialect }->{'feature'}; } +sub Rule { $_[0]->dictionary->{ $_[0]->dialect }->{'rule'}; } sub Scenario { $_[0]->dictionary->{ $_[0]->dialect }->{'scenario'}; } sub Background { $_[0]->dictionary->{ $_[0]->dialect }->{'background'}; } sub Examples { $_[0]->dictionary->{ $_[0]->dialect }->{'examples'}; } diff --git a/gherkin/perl/lib/Gherkin/Generated/Languages.pm b/gherkin/perl/lib/Gherkin/Generated/Languages.pm index d4ac1bc44e..cb3d580e2f 100644 --- a/gherkin/perl/lib/Gherkin/Generated/Languages.pm +++ b/gherkin/perl/lib/Gherkin/Generated/Languages.pm @@ -2,4 +2,5 @@ package Gherkin::Generated::Languages; use utf8; our $data = {'af' => {'and' => ['* ','En '],'background' => ['Agtergrond'],'but' => ['* ','Maar '],'examples' => ['Voorbeelde'],'feature' => ['Funksie','Besigheid Behoefte',"Vermo\x{eb}"],'given' => ['* ','Gegewe '],'name' => 'Afrikaans','native' => 'Afrikaans','rule' => ['Rule'],'scenario' => ['Voorbeeld','Situasie'],'scenarioOutline' => ['Situasie Uiteensetting'],'then' => ['* ','Dan '],'when' => ['* ','Wanneer ']},'am' => {'and' => ['* ',"\x{535}\x{57e} "],'background' => ["\x{53f}\x{578}\x{576}\x{57f}\x{565}\x{584}\x{57d}\x{57f}"],'but' => ['* ',"\x{532}\x{561}\x{575}\x{581} "],'examples' => ["\x{555}\x{580}\x{56b}\x{576}\x{561}\x{56f}\x{576}\x{565}\x{580}"],'feature' => ["\x{556}\x{578}\x{582}\x{576}\x{56f}\x{581}\x{56b}\x{578}\x{576}\x{561}\x{56c}\x{578}\x{582}\x{569}\x{575}\x{578}\x{582}\x{576}","\x{540}\x{561}\x{57f}\x{56f}\x{578}\x{582}\x{569}\x{575}\x{578}\x{582}\x{576}"],'given' => ['* ',"\x{534}\x{56b}\x{581}\x{578}\x{582}\x{584} "],'name' => 'Armenian','native' => "\x{570}\x{561}\x{575}\x{565}\x{580}\x{565}\x{576}",'rule' => ['Rule'],'scenario' => ["\x{555}\x{580}\x{56b}\x{576}\x{561}\x{56f}","\x{54d}\x{581}\x{565}\x{576}\x{561}\x{580}"],'scenarioOutline' => ["\x{54d}\x{581}\x{565}\x{576}\x{561}\x{580}\x{56b} \x{56f}\x{561}\x{57c}\x{578}\x{582}\x{581}\x{57e}\x{561}\x{581}\x{584}\x{568}"],'then' => ['* ',"\x{531}\x{57a}\x{561} "],'when' => ['* ',"\x{535}\x{569}\x{565} ","\x{535}\x{580}\x{562} "]},'an' => {'and' => ['* ','Y ','E '],'background' => ['Antecedents'],'but' => ['* ','Pero '],'examples' => ['Eixemplos'],'feature' => ['Caracteristica'],'given' => ['* ','Dau ','Dada ','Daus ','Dadas '],'name' => 'Aragonese','native' => "Aragon\x{e9}s",'rule' => ['Rule'],'scenario' => ['Eixemplo','Caso'],'scenarioOutline' => ['Esquema del caso'],'then' => ['* ','Alavez ','Allora ','Antonces '],'when' => ['* ','Cuan ']},'ar' => {'and' => ['* ',"\x{648} "],'background' => ["\x{627}\x{644}\x{62e}\x{644}\x{641}\x{64a}\x{629}"],'but' => ['* ',"\x{644}\x{643}\x{646} "],'examples' => ["\x{627}\x{645}\x{62b}\x{644}\x{629}"],'feature' => ["\x{62e}\x{627}\x{635}\x{64a}\x{629}"],'given' => ['* ',"\x{628}\x{641}\x{631}\x{636} "],'name' => 'Arabic','native' => "\x{627}\x{644}\x{639}\x{631}\x{628}\x{64a}\x{629}",'rule' => ['Rule'],'scenario' => ["\x{645}\x{62b}\x{627}\x{644}","\x{633}\x{64a}\x{646}\x{627}\x{631}\x{64a}\x{648}"],'scenarioOutline' => ["\x{633}\x{64a}\x{646}\x{627}\x{631}\x{64a}\x{648} \x{645}\x{62e}\x{637}\x{637}"],'then' => ['* ',"\x{627}\x{630}\x{627}\x{64b} ","\x{62b}\x{645} "],'when' => ['* ',"\x{645}\x{62a}\x{649} ","\x{639}\x{646}\x{62f}\x{645}\x{627} "]},'ast' => {'and' => ['* ','Y ','Ya '],'background' => ['Antecedentes'],'but' => ['* ','Peru '],'examples' => ['Exemplos'],'feature' => ["Carauter\x{ed}stica"],'given' => ['* ',"D\x{e1}u ",'Dada ','Daos ','Daes '],'name' => 'Asturian','native' => 'asturianu','rule' => ['Rule'],'scenario' => ['Exemplo','Casu'],'scenarioOutline' => ['Esbozu del casu'],'then' => ['* ',"Ent\x{f3}s "],'when' => ['* ','Cuando ']},'az' => {'and' => ['* ',"V\x{259} ","H\x{259}m "],'background' => ["Ke\x{e7}mi\x{15f}",'Kontekst'],'but' => ['* ','Amma ','Ancaq '],'examples' => ["N\x{fc}mun\x{259}l\x{259}r"],'feature' => ["\x{d6}z\x{259}llik"],'given' => ['* ','Tutaq ki ','Verilir '],'name' => 'Azerbaijani','native' => "Az\x{259}rbaycanca",'rule' => ['Rule'],'scenario' => ["N\x{fc}mun\x{259}",'Ssenari'],'scenarioOutline' => ['Ssenarinin strukturu'],'then' => ['* ','O halda '],'when' => ['* ',"\x{18f}g\x{259}r ","N\x{259} vaxt ki "]},'bg' => {'and' => ['* ',"\x{418} "],'background' => ["\x{41f}\x{440}\x{435}\x{434}\x{438}\x{441}\x{442}\x{43e}\x{440}\x{438}\x{44f}"],'but' => ['* ',"\x{41d}\x{43e} "],'examples' => ["\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}\x{438}"],'feature' => ["\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{438}\x{43e}\x{43d}\x{430}\x{43b}\x{43d}\x{43e}\x{441}\x{442}"],'given' => ['* ',"\x{414}\x{430}\x{434}\x{435}\x{43d}\x{43e} "],'name' => 'Bulgarian','native' => "\x{431}\x{44a}\x{43b}\x{433}\x{430}\x{440}\x{441}\x{43a}\x{438}",'rule' => ['Rule'],'scenario' => ["\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}","\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{439}"],'scenarioOutline' => ["\x{420}\x{430}\x{43c}\x{43a}\x{430} \x{43d}\x{430} \x{441}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{439}"],'then' => ['* ',"\x{422}\x{43e} "],'when' => ['* ',"\x{41a}\x{43e}\x{433}\x{430}\x{442}\x{43e} "]},'bm' => {'and' => ['* ','Dan '],'background' => ['Latar Belakang'],'but' => ['* ','Tetapi ','Tapi '],'examples' => ['Contoh'],'feature' => ['Fungsi'],'given' => ['* ','Diberi ','Bagi '],'name' => 'Malay','native' => 'Bahasa Melayu','rule' => ['Rule'],'scenario' => ['Senario','Situasi','Keadaan'],'scenarioOutline' => ['Kerangka Senario','Kerangka Situasi','Kerangka Keadaan','Garis Panduan Senario'],'then' => ['* ','Maka ','Kemudian '],'when' => ['* ','Apabila ']},'bs' => {'and' => ['* ','I ','A '],'background' => ['Pozadina'],'but' => ['* ','Ali '],'examples' => ['Primjeri'],'feature' => ['Karakteristika'],'given' => ['* ','Dato '],'name' => 'Bosnian','native' => 'Bosanski','rule' => ['Rule'],'scenario' => ['Primjer','Scenariju','Scenario'],'scenarioOutline' => ['Scenariju-obris','Scenario-outline'],'then' => ['* ','Zatim '],'when' => ['* ','Kada ']},'ca' => {'and' => ['* ','I '],'background' => ['Rerefons','Antecedents'],'but' => ['* ',"Per\x{f2} "],'examples' => ['Exemples'],'feature' => ["Caracter\x{ed}stica",'Funcionalitat'],'given' => ['* ','Donat ','Donada ',"At\x{e8}s ",'Atesa '],'name' => 'Catalan','native' => "catal\x{e0}",'rule' => ['Rule'],'scenario' => ['Exemple','Escenari'],'scenarioOutline' => ['Esquema de l\'escenari'],'then' => ['* ','Aleshores ','Cal '],'when' => ['* ','Quan ']},'cs' => {'and' => ['* ',"A tak\x{e9} ",'A '],'background' => ["Pozad\x{ed}",'Kontext'],'but' => ['* ','Ale '],'examples' => ["P\x{159}\x{ed}klady"],'feature' => ["Po\x{17e}adavek"],'given' => ['* ','Pokud ',"Za p\x{159}edpokladu "],'name' => 'Czech','native' => "\x{10c}esky",'rule' => ['Rule'],'scenario' => ["P\x{159}\x{ed}klad","Sc\x{e9}n\x{e1}\x{159}"],'scenarioOutline' => ["N\x{e1}\x{10d}rt Sc\x{e9}n\x{e1}\x{159}e","Osnova sc\x{e9}n\x{e1}\x{159}e"],'then' => ['* ','Pak '],'when' => ['* ',"Kdy\x{17e} "]},'cy-GB' => {'and' => ['* ','A '],'background' => ['Cefndir'],'but' => ['* ','Ond '],'examples' => ['Enghreifftiau'],'feature' => ['Arwedd'],'given' => ['* ','Anrhegedig a '],'name' => 'Welsh','native' => 'Cymraeg','rule' => ['Rule'],'scenario' => ['Enghraifft','Scenario'],'scenarioOutline' => ['Scenario Amlinellol'],'then' => ['* ','Yna '],'when' => ['* ','Pryd ']},'da' => {'and' => ['* ','Og '],'background' => ['Baggrund'],'but' => ['* ','Men '],'examples' => ['Eksempler'],'feature' => ['Egenskab'],'given' => ['* ','Givet '],'name' => 'Danish','native' => 'dansk','rule' => ['Rule'],'scenario' => ['Eksempel','Scenarie'],'scenarioOutline' => ['Abstrakt Scenario'],'then' => ['* ',"S\x{e5} "],'when' => ['* ',"N\x{e5}r "]},'de' => {'and' => ['* ','Und '],'background' => ['Grundlage','Hintergrund','Voraussetzungen','Vorbedingungen'],'but' => ['* ','Aber '],'examples' => ['Beispiele'],'feature' => ["Funktionalit\x{e4}t",'Funktion'],'given' => ['* ','Angenommen ','Gegeben sei ','Gegeben seien '],'name' => 'German','native' => 'Deutsch','rule' => ['Rule','Regel'],'scenario' => ['Beispiel','Szenario'],'scenarioOutline' => ['Szenariogrundriss','Szenarien'],'then' => ['* ','Dann '],'when' => ['* ','Wenn ']},'el' => {'and' => ['* ',"\x{39a}\x{3b1}\x{3b9} "],'background' => ["\x{3a5}\x{3c0}\x{3cc}\x{3b2}\x{3b1}\x{3b8}\x{3c1}\x{3bf}"],'but' => ['* ',"\x{391}\x{3bb}\x{3bb}\x{3ac} "],'examples' => ["\x{3a0}\x{3b1}\x{3c1}\x{3b1}\x{3b4}\x{3b5}\x{3af}\x{3b3}\x{3bc}\x{3b1}\x{3c4}\x{3b1}","\x{3a3}\x{3b5}\x{3bd}\x{3ac}\x{3c1}\x{3b9}\x{3b1}"],'feature' => ["\x{394}\x{3c5}\x{3bd}\x{3b1}\x{3c4}\x{3cc}\x{3c4}\x{3b7}\x{3c4}\x{3b1}","\x{39b}\x{3b5}\x{3b9}\x{3c4}\x{3bf}\x{3c5}\x{3c1}\x{3b3}\x{3af}\x{3b1}"],'given' => ['* ',"\x{394}\x{3b5}\x{3b4}\x{3bf}\x{3bc}\x{3ad}\x{3bd}\x{3bf}\x{3c5} "],'name' => 'Greek','native' => "\x{395}\x{3bb}\x{3bb}\x{3b7}\x{3bd}\x{3b9}\x{3ba}\x{3ac}",'rule' => ['Rule'],'scenario' => ["\x{3a0}\x{3b1}\x{3c1}\x{3ac}\x{3b4}\x{3b5}\x{3b9}\x{3b3}\x{3bc}\x{3b1}","\x{3a3}\x{3b5}\x{3bd}\x{3ac}\x{3c1}\x{3b9}\x{3bf}"],'scenarioOutline' => ["\x{3a0}\x{3b5}\x{3c1}\x{3b9}\x{3b3}\x{3c1}\x{3b1}\x{3c6}\x{3ae} \x{3a3}\x{3b5}\x{3bd}\x{3b1}\x{3c1}\x{3af}\x{3bf}\x{3c5}","\x{3a0}\x{3b5}\x{3c1}\x{3af}\x{3b3}\x{3c1}\x{3b1}\x{3bc}\x{3bc}\x{3b1} \x{3a3}\x{3b5}\x{3bd}\x{3b1}\x{3c1}\x{3af}\x{3bf}\x{3c5}"],'then' => ['* ',"\x{3a4}\x{3cc}\x{3c4}\x{3b5} "],'when' => ['* ',"\x{38c}\x{3c4}\x{3b1}\x{3bd} "]},'em' => {'and' => ['* ',"\x{1f602}"],'background' => ["\x{1f4a4}"],'but' => ['* ',"\x{1f614}"],'examples' => ["\x{1f4d3}"],'feature' => ["\x{1f4da}"],'given' => ['* ',"\x{1f610}"],'name' => 'Emoji','native' => "\x{1f600}",'rule' => ['Rule'],'scenario' => ["\x{1f952}","\x{1f4d5}"],'scenarioOutline' => ["\x{1f4d6}"],'then' => ['* ',"\x{1f64f}"],'when' => ['* ',"\x{1f3ac}"]},'en' => {'and' => ['* ','And '],'background' => ['Background'],'but' => ['* ','But '],'examples' => ['Examples','Scenarios'],'feature' => ['Feature','Business Need','Ability'],'given' => ['* ','Given '],'name' => 'English','native' => 'English','rule' => ['Rule'],'scenario' => ['Example','Scenario'],'scenarioOutline' => ['Scenario Outline','Scenario Template'],'then' => ['* ','Then '],'when' => ['* ','When ']},'en-Scouse' => {'and' => ['* ','An '],'background' => ['Dis is what went down'],'but' => ['* ','Buh '],'examples' => ['Examples'],'feature' => ['Feature'],'given' => ['* ','Givun ','Youse know when youse got '],'name' => 'Scouse','native' => 'Scouse','rule' => ['Rule'],'scenario' => ['The thing of it is'],'scenarioOutline' => ['Wharrimean is'],'then' => ['* ','Dun ','Den youse gotta '],'when' => ['* ','Wun ','Youse know like when ']},'en-au' => {'and' => ['* ','Too right '],'background' => ['First off'],'but' => ['* ','Yeah nah '],'examples' => ['You\'ll wanna'],'feature' => ['Pretty much'],'given' => ['* ','Y\'know '],'name' => 'Australian','native' => 'Australian','rule' => ['Rule'],'scenario' => ['Awww, look mate'],'scenarioOutline' => ['Reckon it\'s like'],'then' => ['* ','But at the end of the day I reckon '],'when' => ['* ','It\'s just unbelievable ']},'en-lol' => {'and' => ['* ','AN '],'background' => ['B4'],'but' => ['* ','BUT '],'examples' => ['EXAMPLZ'],'feature' => ['OH HAI'],'given' => ['* ','I CAN HAZ '],'name' => 'LOLCAT','native' => 'LOLCAT','rule' => ['Rule'],'scenario' => ['MISHUN'],'scenarioOutline' => ['MISHUN SRSLY'],'then' => ['* ','DEN '],'when' => ['* ','WEN ']},'en-old' => {'and' => ['* ','Ond ','7 '],'background' => ['Aer',"\x{c6}r"],'but' => ['* ','Ac '],'examples' => ['Se the',"Se \x{fe}e","Se \x{f0}e"],'feature' => ['Hwaet',"Hw\x{e6}t"],'given' => ['* ','Thurh ',"\x{de}urh ","\x{d0}urh "],'name' => 'Old English','native' => 'Englisc','rule' => ['Rule'],'scenario' => ['Swa'],'scenarioOutline' => ['Swa hwaer swa',"Swa hw\x{e6}r swa"],'then' => ['* ','Tha ',"\x{de}a ","\x{d0}a ",'Tha the ',"\x{de}a \x{fe}e ","\x{d0}a \x{f0}e "],'when' => ['* ','Tha ',"\x{de}a ","\x{d0}a "]},'en-pirate' => {'and' => ['* ','Aye '],'background' => ['Yo-ho-ho'],'but' => ['* ','Avast! '],'examples' => ['Dead men tell no tales'],'feature' => ['Ahoy matey!'],'given' => ['* ','Gangway! '],'name' => 'Pirate','native' => 'Pirate','rule' => ['Rule'],'scenario' => ['Heave to'],'scenarioOutline' => ['Shiver me timbers'],'then' => ['* ','Let go and haul '],'when' => ['* ','Blimey! ']},'eo' => {'and' => ['* ','Kaj '],'background' => ['Fono'],'but' => ['* ','Sed '],'examples' => ['Ekzemploj'],'feature' => ['Trajto'],'given' => ['* ',"Donita\x{135}o ",'Komence '],'name' => 'Esperanto','native' => 'Esperanto','rule' => ['Rule'],'scenario' => ['Ekzemplo','Scenaro','Kazo'],'scenarioOutline' => ['Konturo de la scenaro','Skizo','Kazo-skizo'],'then' => ['* ','Do '],'when' => ['* ','Se ']},'es' => {'and' => ['* ','Y ','E '],'background' => ['Antecedentes'],'but' => ['* ','Pero '],'examples' => ['Ejemplos'],'feature' => ["Caracter\x{ed}stica"],'given' => ['* ','Dado ','Dada ','Dados ','Dadas '],'name' => 'Spanish','native' => "espa\x{f1}ol",'rule' => ['Regla'],'scenario' => ['Ejemplo','Escenario'],'scenarioOutline' => ['Esquema del escenario'],'then' => ['* ','Entonces '],'when' => ['* ','Cuando ']},'et' => {'and' => ['* ','Ja '],'background' => ['Taust'],'but' => ['* ','Kuid '],'examples' => ['Juhtumid'],'feature' => ['Omadus'],'given' => ['* ','Eeldades '],'name' => 'Estonian','native' => 'eesti keel','rule' => ['Reegel'],'scenario' => ['Juhtum','Stsenaarium'],'scenarioOutline' => ['Raamjuhtum','Raamstsenaarium'],'then' => ['* ','Siis '],'when' => ['* ','Kui ']},'fa' => {'and' => ['* ',"\x{648} "],'background' => ["\x{632}\x{645}\x{6cc}\x{646}\x{647}"],'but' => ['* ',"\x{627}\x{645}\x{627} "],'examples' => ["\x{646}\x{645}\x{648}\x{646}\x{647} \x{647}\x{627}"],'feature' => ["\x{648}\x{650}\x{6cc}\x{698}\x{6af}\x{6cc}"],'given' => ['* ',"\x{628}\x{627} \x{641}\x{631}\x{636} "],'name' => 'Persian','native' => "\x{641}\x{627}\x{631}\x{633}\x{6cc}",'rule' => ['Rule'],'scenario' => ["\x{645}\x{62b}\x{627}\x{644}","\x{633}\x{646}\x{627}\x{631}\x{6cc}\x{648}"],'scenarioOutline' => ["\x{627}\x{644}\x{6af}\x{648}\x{6cc} \x{633}\x{646}\x{627}\x{631}\x{6cc}\x{648}"],'then' => ['* ',"\x{622}\x{646}\x{6af}\x{627}\x{647} "],'when' => ['* ',"\x{647}\x{646}\x{6af}\x{627}\x{645}\x{6cc} "]},'fi' => {'and' => ['* ','Ja '],'background' => ['Tausta'],'but' => ['* ','Mutta '],'examples' => ['Tapaukset'],'feature' => ['Ominaisuus'],'given' => ['* ','Oletetaan '],'name' => 'Finnish','native' => 'suomi','rule' => ['Rule'],'scenario' => ['Tapaus'],'scenarioOutline' => ['Tapausaihio'],'then' => ['* ','Niin '],'when' => ['* ','Kun ']},'fr' => {'and' => ['* ','Et que ','Et qu\'','Et '],'background' => ['Contexte'],'but' => ['* ','Mais que ','Mais qu\'','Mais '],'examples' => ['Exemples'],'feature' => ["Fonctionnalit\x{e9}"],'given' => ['* ','Soit ','Sachant que ','Sachant qu\'','Sachant ',"Etant donn\x{e9} que ","Etant donn\x{e9} qu'","Etant donn\x{e9} ","Etant donn\x{e9}e ","Etant donn\x{e9}s ","Etant donn\x{e9}es ","\x{c9}tant donn\x{e9} que ","\x{c9}tant donn\x{e9} qu'","\x{c9}tant donn\x{e9} ","\x{c9}tant donn\x{e9}e ","\x{c9}tant donn\x{e9}s ","\x{c9}tant donn\x{e9}es "],'name' => 'French','native' => "fran\x{e7}ais",'rule' => ["R\x{e8}gle"],'scenario' => ['Exemple',"Sc\x{e9}nario"],'scenarioOutline' => ["Plan du sc\x{e9}nario","Plan du Sc\x{e9}nario"],'then' => ['* ','Alors ','Donc '],'when' => ['* ','Quand ','Lorsque ','Lorsqu\'']},'ga' => {'and' => ['* ','Agus'],'background' => ["C\x{fa}lra"],'but' => ['* ','Ach'],'examples' => ["Sampla\x{ed}"],'feature' => ["Gn\x{e9}"],'given' => ['* ',"Cuir i gc\x{e1}s go","Cuir i gc\x{e1}s nach","Cuir i gc\x{e1}s gur","Cuir i gc\x{e1}s n\x{e1}r"],'name' => 'Irish','native' => 'Gaeilge','rule' => ['Rule'],'scenario' => ['Sampla',"C\x{e1}s"],'scenarioOutline' => ["C\x{e1}s Achomair"],'then' => ['* ','Ansin'],'when' => ['* ','Nuair a','Nuair nach','Nuair ba',"Nuair n\x{e1}r"]},'gj' => {'and' => ['* ',"\x{a85}\x{aa8}\x{ac7} "],'background' => ["\x{aac}\x{ac7}\x{a95}\x{a97}\x{acd}\x{ab0}\x{abe}\x{a89}\x{aa8}\x{acd}\x{aa1}"],'but' => ['* ',"\x{aaa}\x{aa3} "],'examples' => ["\x{a89}\x{aa6}\x{abe}\x{ab9}\x{ab0}\x{aa3}\x{acb}"],'feature' => ["\x{ab2}\x{a95}\x{acd}\x{ab7}\x{aa3}","\x{ab5}\x{acd}\x{aaf}\x{abe}\x{aaa}\x{abe}\x{ab0} \x{a9c}\x{ab0}\x{ac2}\x{ab0}","\x{a95}\x{acd}\x{ab7}\x{aae}\x{aa4}\x{abe}"],'given' => ['* ',"\x{a86}\x{aaa}\x{ac7}\x{ab2} \x{a9b}\x{ac7} "],'name' => 'Gujarati','native' => "\x{a97}\x{ac1}\x{a9c}\x{ab0}\x{abe}\x{aa4}\x{ac0}",'rule' => ['Rule'],'scenario' => ["\x{a89}\x{aa6}\x{abe}\x{ab9}\x{ab0}\x{aa3}","\x{ab8}\x{acd}\x{aa5}\x{abf}\x{aa4}\x{abf}"],'scenarioOutline' => ["\x{aaa}\x{ab0}\x{abf}\x{aa6}\x{acd}\x{aa6}\x{ab6}\x{acd}\x{aaf} \x{ab0}\x{ac2}\x{aaa}\x{ab0}\x{ac7}\x{a96}\x{abe}","\x{aaa}\x{ab0}\x{abf}\x{aa6}\x{acd}\x{aa6}\x{ab6}\x{acd}\x{aaf} \x{aa2}\x{abe}\x{a82}\x{a9a}\x{acb}"],'then' => ['* ',"\x{aaa}\x{a9b}\x{ac0} "],'when' => ['* ',"\x{a95}\x{acd}\x{aaf}\x{abe}\x{ab0}\x{ac7} "]},'gl' => {'and' => ['* ','E '],'background' => ['Contexto'],'but' => ['* ','Mais ','Pero '],'examples' => ['Exemplos'],'feature' => ["Caracter\x{ed}stica"],'given' => ['* ','Dado ','Dada ','Dados ','Dadas '],'name' => 'Galician','native' => 'galego','rule' => ['Rule'],'scenario' => ['Exemplo','Escenario'],'scenarioOutline' => ['Esbozo do escenario'],'then' => ['* ',"Ent\x{f3}n ",'Logo '],'when' => ['* ','Cando ']},'he' => {'and' => ['* ',"\x{5d5}\x{5d2}\x{5dd} "],'background' => ["\x{5e8}\x{5e7}\x{5e2}"],'but' => ['* ',"\x{5d0}\x{5d1}\x{5dc} "],'examples' => ["\x{5d3}\x{5d5}\x{5d2}\x{5de}\x{5d0}\x{5d5}\x{5ea}"],'feature' => ["\x{5ea}\x{5db}\x{5d5}\x{5e0}\x{5d4}"],'given' => ['* ',"\x{5d1}\x{5d4}\x{5d9}\x{5e0}\x{5ea}\x{5df} "],'name' => 'Hebrew','native' => "\x{5e2}\x{5d1}\x{5e8}\x{5d9}\x{5ea}",'rule' => ["\x{5db}\x{5dc}\x{5dc}"],'scenario' => ["\x{5d3}\x{5d5}\x{5d2}\x{5de}\x{5d0}","\x{5ea}\x{5e8}\x{5d7}\x{5d9}\x{5e9}"],'scenarioOutline' => ["\x{5ea}\x{5d1}\x{5e0}\x{5d9}\x{5ea} \x{5ea}\x{5e8}\x{5d7}\x{5d9}\x{5e9}"],'then' => ['* ',"\x{5d0}\x{5d6} ","\x{5d0}\x{5d6}\x{5d9} "],'when' => ['* ',"\x{5db}\x{5d0}\x{5e9}\x{5e8} "]},'hi' => {'and' => ['* ',"\x{914}\x{930} ","\x{924}\x{925}\x{93e} "],'background' => ["\x{92a}\x{943}\x{937}\x{94d}\x{920}\x{92d}\x{942}\x{92e}\x{93f}"],'but' => ['* ',"\x{92a}\x{930} ","\x{92a}\x{930}\x{928}\x{94d}\x{924}\x{941} ","\x{915}\x{93f}\x{928}\x{94d}\x{924}\x{941} "],'examples' => ["\x{909}\x{926}\x{93e}\x{939}\x{930}\x{923}"],'feature' => ["\x{930}\x{942}\x{92a} \x{932}\x{947}\x{916}"],'given' => ['* ',"\x{905}\x{917}\x{930} ","\x{92f}\x{926}\x{93f} ","\x{91a}\x{942}\x{902}\x{915}\x{93f} "],'name' => 'Hindi','native' => "\x{939}\x{93f}\x{902}\x{926}\x{940}",'rule' => ['Rule'],'scenario' => ["\x{92a}\x{930}\x{93f}\x{926}\x{943}\x{936}\x{94d}\x{92f}"],'scenarioOutline' => ["\x{92a}\x{930}\x{93f}\x{926}\x{943}\x{936}\x{94d}\x{92f} \x{930}\x{942}\x{92a}\x{930}\x{947}\x{916}\x{93e}"],'then' => ['* ',"\x{924}\x{92c} ","\x{924}\x{926}\x{93e} "],'when' => ['* ',"\x{91c}\x{92c} ","\x{915}\x{926}\x{93e} "]},'hr' => {'and' => ['* ','I '],'background' => ['Pozadina'],'but' => ['* ','Ali '],'examples' => ['Primjeri','Scenariji'],'feature' => ['Osobina',"Mogu\x{107}nost",'Mogucnost'],'given' => ['* ','Zadan ','Zadani ','Zadano ','Ukoliko '],'name' => 'Croatian','native' => 'hrvatski','rule' => ['Rule'],'scenario' => ['Primjer','Scenarij'],'scenarioOutline' => ['Skica','Koncept'],'then' => ['* ','Onda '],'when' => ['* ','Kada ','Kad ']},'ht' => {'and' => ['* ','Ak ','Epi ','E '],'background' => ["Kont\x{e8}ks",'Istorik'],'but' => ['* ','Men '],'examples' => ['Egzanp'],'feature' => ['Karakteristik','Mak','Fonksyonalite'],'given' => ['* ','Sipoze ','Sipoze ke ','Sipoze Ke '],'name' => 'Creole','native' => "krey\x{f2}l",'rule' => ['Rule'],'scenario' => ['Senaryo'],'scenarioOutline' => ['Plan senaryo','Plan Senaryo','Senaryo deskripsyon','Senaryo Deskripsyon','Dyagram senaryo','Dyagram Senaryo'],'then' => ['* ',"L\x{e8} sa a ",'Le sa a '],'when' => ['* ',"L\x{e8} ",'Le ']},'hu' => {'and' => ['* ',"\x{c9}s "],'background' => ["H\x{e1}tt\x{e9}r"],'but' => ['* ','De '],'examples' => ["P\x{e9}ld\x{e1}k"],'feature' => ["Jellemz\x{151}"],'given' => ['* ','Amennyiben ','Adott '],'name' => 'Hungarian','native' => 'magyar','rule' => ['Rule'],'scenario' => ["P\x{e9}lda","Forgat\x{f3}k\x{f6}nyv"],'scenarioOutline' => ["Forgat\x{f3}k\x{f6}nyv v\x{e1}zlat"],'then' => ['* ','Akkor '],'when' => ['* ','Majd ','Ha ','Amikor ']},'id' => {'and' => ['* ','Dan '],'background' => ['Dasar','Latar Belakang'],'but' => ['* ','Tapi ','Tetapi '],'examples' => ['Contoh','Misal'],'feature' => ['Fitur'],'given' => ['* ','Dengan ','Diketahui ','Diasumsikan ','Bila ','Jika '],'name' => 'Indonesian','native' => 'Bahasa Indonesia','rule' => ['Rule','Aturan'],'scenario' => ['Skenario'],'scenarioOutline' => ['Skenario konsep','Garis-Besar Skenario'],'then' => ['* ','Maka ','Kemudian '],'when' => ['* ','Ketika ']},'is' => {'and' => ['* ','Og '],'background' => ['Bakgrunnur'],'but' => ['* ','En '],'examples' => ["D\x{e6}mi","Atbur\x{f0}ar\x{e1}sir"],'feature' => ['Eiginleiki'],'given' => ['* ','Ef '],'name' => 'Icelandic','native' => "\x{cd}slenska",'rule' => ['Rule'],'scenario' => ["Atbur\x{f0}ar\x{e1}s"],'scenarioOutline' => ["L\x{fd}sing Atbur\x{f0}ar\x{e1}sar","L\x{fd}sing D\x{e6}ma"],'then' => ['* ',"\x{de}\x{e1} "],'when' => ['* ',"\x{de}egar "]},'it' => {'and' => ['* ','E '],'background' => ['Contesto'],'but' => ['* ','Ma '],'examples' => ['Esempi'],'feature' => ["Funzionalit\x{e0}"],'given' => ['* ','Dato ','Data ','Dati ','Date '],'name' => 'Italian','native' => 'italiano','rule' => ['Rule'],'scenario' => ['Esempio','Scenario'],'scenarioOutline' => ['Schema dello scenario'],'then' => ['* ','Allora '],'when' => ['* ','Quando ']},'ja' => {'and' => ['* ',"\x{304b}\x{3064}"],'background' => ["\x{80cc}\x{666f}"],'but' => ['* ',"\x{3057}\x{304b}\x{3057}","\x{4f46}\x{3057}","\x{305f}\x{3060}\x{3057}"],'examples' => ["\x{4f8b}","\x{30b5}\x{30f3}\x{30d7}\x{30eb}"],'feature' => ["\x{30d5}\x{30a3}\x{30fc}\x{30c1}\x{30e3}","\x{6a5f}\x{80fd}"],'given' => ['* ',"\x{524d}\x{63d0}"],'name' => 'Japanese','native' => "\x{65e5}\x{672c}\x{8a9e}",'rule' => ['Rule'],'scenario' => ["\x{30b7}\x{30ca}\x{30ea}\x{30aa}"],'scenarioOutline' => ["\x{30b7}\x{30ca}\x{30ea}\x{30aa}\x{30a2}\x{30a6}\x{30c8}\x{30e9}\x{30a4}\x{30f3}","\x{30b7}\x{30ca}\x{30ea}\x{30aa}\x{30c6}\x{30f3}\x{30d7}\x{30ec}\x{30fc}\x{30c8}","\x{30c6}\x{30f3}\x{30d7}\x{30ec}","\x{30b7}\x{30ca}\x{30ea}\x{30aa}\x{30c6}\x{30f3}\x{30d7}\x{30ec}"],'then' => ['* ',"\x{306a}\x{3089}\x{3070}"],'when' => ['* ',"\x{3082}\x{3057}"]},'jv' => {'and' => ['* ','Lan '],'background' => ['Dasar'],'but' => ['* ','Tapi ','Nanging ','Ananging '],'examples' => ['Conto','Contone'],'feature' => ['Fitur'],'given' => ['* ','Nalika ','Nalikaning '],'name' => 'Javanese','native' => 'Basa Jawa','rule' => ['Rule'],'scenario' => ['Skenario'],'scenarioOutline' => ['Konsep skenario'],'then' => ['* ','Njuk ','Banjur '],'when' => ['* ','Manawa ','Menawa ']},'ka' => {'and' => ['* ',"\x{10d3}\x{10d0}"],'background' => ["\x{10d9}\x{10dd}\x{10dc}\x{10e2}\x{10d4}\x{10e5}\x{10e1}\x{10e2}\x{10d8}"],'but' => ['* ',"\x{10db}\x{10d0}\x{10d2}\x{ad}\x{10e0}\x{10d0}\x{10db}"],'examples' => ["\x{10db}\x{10d0}\x{10d2}\x{10d0}\x{10da}\x{10d8}\x{10d7}\x{10d4}\x{10d1}\x{10d8}"],'feature' => ["\x{10d7}\x{10d5}\x{10d8}\x{10e1}\x{10d4}\x{10d1}\x{10d0}"],'given' => ['* ',"\x{10db}\x{10dd}\x{10ea}\x{10d4}\x{10db}\x{10e3}\x{10da}\x{10d8}"],'name' => 'Georgian','native' => "\x{10e5}\x{10d0}\x{10e0}\x{10d7}\x{10d5}\x{10d4}\x{10da}\x{10d8}",'rule' => ['Rule'],'scenario' => ["\x{10db}\x{10d0}\x{10d2}\x{10d0}\x{10da}\x{10d8}\x{10d7}\x{10d0}\x{10d3}","\x{10e1}\x{10ea}\x{10d4}\x{10dc}\x{10d0}\x{10e0}\x{10d8}\x{10e1}"],'scenarioOutline' => ["\x{10e1}\x{10ea}\x{10d4}\x{10dc}\x{10d0}\x{10e0}\x{10d8}\x{10e1} \x{10dc}\x{10d8}\x{10db}\x{10e3}\x{10e8}\x{10d8}"],'then' => ['* ',"\x{10db}\x{10d0}\x{10e8}\x{10d8}\x{10dc}"],'when' => ['* ',"\x{10e0}\x{10dd}\x{10d3}\x{10d4}\x{10e1}\x{10d0}\x{10ea}"]},'kn' => {'and' => ['* ',"\x{cae}\x{ca4}\x{ccd}\x{ca4}\x{cc1} "],'background' => ["\x{cb9}\x{cbf}\x{ca8}\x{ccd}\x{ca8}\x{cc6}\x{cb2}\x{cc6}"],'but' => ['* ',"\x{c86}\x{ca6}\x{cb0}\x{cc6} "],'examples' => ["\x{c89}\x{ca6}\x{cbe}\x{cb9}\x{cb0}\x{ca3}\x{cc6}\x{c97}\x{cb3}\x{cc1}"],'feature' => ["\x{cb9}\x{cc6}\x{c9a}\x{ccd}\x{c9a}\x{cb3}"],'given' => ['* ',"\x{ca8}\x{cbf}\x{cd5}\x{ca1}\x{cbf}\x{ca6} "],'name' => 'Kannada','native' => "\x{c95}\x{ca8}\x{ccd}\x{ca8}\x{ca1}",'rule' => ['Rule'],'scenario' => ["\x{c89}\x{ca6}\x{cbe}\x{cb9}\x{cb0}\x{ca3}\x{cc6}","\x{c95}\x{ca5}\x{cbe}\x{cb8}\x{cbe}\x{cb0}\x{cbe}\x{c82}\x{cb6}"],'scenarioOutline' => ["\x{cb5}\x{cbf}\x{cb5}\x{cb0}\x{ca3}\x{cc6}"],'then' => ['* ',"\x{ca8}\x{c82}\x{ca4}\x{cb0} "],'when' => ['* ',"\x{cb8}\x{ccd}\x{ca5}\x{cbf}\x{ca4}\x{cbf}\x{caf}\x{ca8}\x{ccd}\x{ca8}\x{cc1} "]},'ko' => {'and' => ['* ',"\x{adf8}\x{b9ac}\x{ace0}"],'background' => ["\x{bc30}\x{acbd}"],'but' => ['* ',"\x{d558}\x{c9c0}\x{b9cc}","\x{b2e8}"],'examples' => ["\x{c608}"],'feature' => ["\x{ae30}\x{b2a5}"],'given' => ['* ',"\x{c870}\x{ac74}","\x{ba3c}\x{c800}"],'name' => 'Korean','native' => "\x{d55c}\x{ad6d}\x{c5b4}",'rule' => ['Rule'],'scenario' => ["\x{c2dc}\x{b098}\x{b9ac}\x{c624}"],'scenarioOutline' => ["\x{c2dc}\x{b098}\x{b9ac}\x{c624} \x{ac1c}\x{c694}"],'then' => ['* ',"\x{adf8}\x{b7ec}\x{ba74}"],'when' => ['* ',"\x{b9cc}\x{c77c}","\x{b9cc}\x{c57d}"]},'lt' => {'and' => ['* ','Ir '],'background' => ['Kontekstas'],'but' => ['* ','Bet '],'examples' => ["Pavyzd\x{17e}iai",'Scenarijai','Variantai'],'feature' => ["Savyb\x{117}"],'given' => ['* ','Duota '],'name' => 'Lithuanian','native' => "lietuvi\x{173} kalba",'rule' => ['Rule'],'scenario' => ['Pavyzdys','Scenarijus'],'scenarioOutline' => ["Scenarijaus \x{161}ablonas"],'then' => ['* ','Tada '],'when' => ['* ','Kai ']},'lu' => {'and' => ['* ','an ','a '],'background' => ['Hannergrond'],'but' => ['* ','awer ',"m\x{e4} "],'examples' => ['Beispiller'],'feature' => ["Funktionalit\x{e9}it"],'given' => ['* ','ugeholl '],'name' => 'Luxemburgish','native' => "L\x{eb}tzebuergesch",'rule' => ['Rule'],'scenario' => ['Beispill','Szenario'],'scenarioOutline' => ['Plang vum Szenario'],'then' => ['* ','dann '],'when' => ['* ','wann ']},'lv' => {'and' => ['* ','Un '],'background' => ['Konteksts',"Situ\x{101}cija"],'but' => ['* ','Bet '],'examples' => ["Piem\x{113}ri",'Paraugs'],'feature' => ["Funkcionalit\x{101}te","F\x{12b}\x{10d}a"],'given' => ['* ','Kad '],'name' => 'Latvian','native' => "latvie\x{161}u",'rule' => ['Rule'],'scenario' => ["Piem\x{113}rs","Scen\x{101}rijs"],'scenarioOutline' => ["Scen\x{101}rijs p\x{113}c parauga"],'then' => ['* ','Tad '],'when' => ['* ','Ja ']},'mk-Cyrl' => {'and' => ['* ',"\x{418} "],'background' => ["\x{41a}\x{43e}\x{43d}\x{442}\x{435}\x{43a}\x{441}\x{442}","\x{421}\x{43e}\x{434}\x{440}\x{436}\x{438}\x{43d}\x{430}"],'but' => ['* ',"\x{41d}\x{43e} "],'examples' => ["\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}\x{438}","\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{458}\x{430}"],'feature' => ["\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{438}\x{43e}\x{43d}\x{430}\x{43b}\x{43d}\x{43e}\x{441}\x{442}","\x{411}\x{438}\x{437}\x{43d}\x{438}\x{441} \x{43f}\x{43e}\x{442}\x{440}\x{435}\x{431}\x{430}","\x{41c}\x{43e}\x{436}\x{43d}\x{43e}\x{441}\x{442}"],'given' => ['* ',"\x{414}\x{430}\x{434}\x{435}\x{43d}\x{43e} ","\x{414}\x{430}\x{434}\x{435}\x{43d}\x{430} "],'name' => 'Macedonian','native' => "\x{41c}\x{430}\x{43a}\x{435}\x{434}\x{43e}\x{43d}\x{441}\x{43a}\x{438}",'rule' => ['Rule'],'scenario' => ["\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}","\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{43e}","\x{41d}\x{430} \x{43f}\x{440}\x{438}\x{43c}\x{435}\x{440}"],'scenarioOutline' => ["\x{41f}\x{440}\x{435}\x{433}\x{43b}\x{435}\x{434} \x{43d}\x{430} \x{441}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{458}\x{430}","\x{421}\x{43a}\x{438}\x{446}\x{430}","\x{41a}\x{43e}\x{43d}\x{446}\x{435}\x{43f}\x{442}"],'then' => ['* ',"\x{422}\x{43e}\x{433}\x{430}\x{448} "],'when' => ['* ',"\x{41a}\x{43e}\x{433}\x{430} "]},'mk-Latn' => {'and' => ['* ','I '],'background' => ['Kontekst','Sodrzhina'],'but' => ['* ','No '],'examples' => ['Primeri','Scenaria'],'feature' => ['Funkcionalnost','Biznis potreba','Mozhnost'],'given' => ['* ','Dadeno ','Dadena '],'name' => 'Macedonian (Latin)','native' => 'Makedonski (Latinica)','rule' => ['Rule'],'scenario' => ['Scenario','Na primer'],'scenarioOutline' => ['Pregled na scenarija','Skica','Koncept'],'then' => ['* ','Togash '],'when' => ['* ','Koga ']},'mn' => {'and' => ['* ',"\x{41c}\x{4e9}\x{43d} ","\x{422}\x{44d}\x{433}\x{44d}\x{44d}\x{434} "],'background' => ["\x{410}\x{433}\x{443}\x{443}\x{43b}\x{433}\x{430}"],'but' => ['* ',"\x{413}\x{44d}\x{445}\x{434}\x{44d}\x{44d} ","\x{425}\x{430}\x{440}\x{438}\x{43d} "],'examples' => ["\x{422}\x{443}\x{445}\x{430}\x{439}\x{43b}\x{431}\x{430}\x{43b}"],'feature' => ["\x{424}\x{443}\x{43d}\x{43a}\x{446}","\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{438}\x{43e}\x{43d}\x{430}\x{43b}"],'given' => ['* ',"\x{4e8}\x{433}\x{4e9}\x{433}\x{434}\x{441}\x{4e9}\x{43d} \x{43d}\x{44c} ","\x{410}\x{43d}\x{445} "],'name' => 'Mongolian','native' => "\x{43c}\x{43e}\x{43d}\x{433}\x{43e}\x{43b}",'rule' => ['Rule'],'scenario' => ["\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}"],'scenarioOutline' => ["\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{44b}\x{43d} \x{442}\x{4e9}\x{43b}\x{4e9}\x{432}\x{43b}\x{4e9}\x{433}\x{4e9}\x{4e9}"],'then' => ['* ',"\x{422}\x{44d}\x{433}\x{44d}\x{445}\x{44d}\x{434} ","\x{4ae}\x{4af}\x{43d}\x{438}\x{439} \x{434}\x{430}\x{440}\x{430}\x{430} "],'when' => ['* ',"\x{425}\x{44d}\x{440}\x{44d}\x{432} "]},'mr' => {'and' => ['* ',"\x{906}\x{923}\x{93f} ","\x{924}\x{938}\x{947}\x{91a} "],'background' => ["\x{92a}\x{93e}\x{930}\x{94d}\x{936}\x{94d}\x{935}\x{92d}\x{942}\x{92e}\x{940}"],'but' => ['* ',"\x{92a}\x{923} ","\x{92a}\x{930}\x{902}\x{924}\x{941} "],'examples' => ["\x{909}\x{926}\x{93e}\x{939}\x{930}\x{923}"],'feature' => ["\x{935}\x{948}\x{936}\x{93f}\x{937}\x{94d}\x{91f}\x{94d}\x{92f}","\x{938}\x{941}\x{935}\x{93f}\x{927}\x{93e}"],'given' => ['* ',"\x{91c}\x{930}","\x{926}\x{93f}\x{932}\x{947}\x{932}\x{94d}\x{92f}\x{93e} \x{92a}\x{94d}\x{930}\x{92e}\x{93e}\x{923}\x{947} "],'name' => 'Marathi','native' => "\x{92e}\x{930}\x{93e}\x{920}\x{940}",'rule' => ["\x{928}\x{93f}\x{92f}\x{92e}"],'scenario' => ["\x{92a}\x{930}\x{93f}\x{926}\x{943}\x{936}\x{94d}\x{92f}"],'scenarioOutline' => ["\x{92a}\x{930}\x{93f}\x{926}\x{943}\x{936}\x{94d}\x{92f} \x{930}\x{942}\x{92a}\x{930}\x{947}\x{916}\x{93e}"],'then' => ['* ',"\x{92e}\x{917} ","\x{924}\x{947}\x{935}\x{94d}\x{939}\x{93e} "],'when' => ['* ',"\x{91c}\x{947}\x{935}\x{94d}\x{939}\x{93e} "]},'ne' => {'and' => ['* ',"\x{930} ","\x{905}\x{928}\x{940} "],'background' => ["\x{92a}\x{943}\x{937}\x{94d}\x{920}\x{92d}\x{942}\x{92e}\x{940}"],'but' => ['* ',"\x{924}\x{930} "],'examples' => ["\x{909}\x{926}\x{93e}\x{939}\x{930}\x{923}","\x{909}\x{926}\x{93e}\x{939}\x{930}\x{923}\x{939}\x{930}\x{941}"],'feature' => ["\x{938}\x{941}\x{935}\x{93f}\x{927}\x{93e}","\x{935}\x{93f}\x{936}\x{947}\x{937}\x{924}\x{93e}"],'given' => ['* ',"\x{926}\x{93f}\x{907}\x{90f}\x{915}\x{94b} ","\x{926}\x{93f}\x{90f}\x{915}\x{94b} ","\x{92f}\x{926}\x{93f} "],'name' => 'Nepali','native' => "\x{928}\x{947}\x{92a}\x{93e}\x{932}\x{940}",'rule' => ["\x{928}\x{93f}\x{92f}\x{92e}"],'scenario' => ["\x{92a}\x{930}\x{93f}\x{926}\x{943}\x{936}\x{94d}\x{92f}"],'scenarioOutline' => ["\x{92a}\x{930}\x{93f}\x{926}\x{943}\x{936}\x{94d}\x{92f} \x{930}\x{942}\x{92a}\x{930}\x{947}\x{916}\x{93e}"],'then' => ['* ',"\x{924}\x{94d}\x{92f}\x{938}\x{92a}\x{91b}\x{93f} ","\x{905}\x{928}\x{940} "],'when' => ['* ',"\x{91c}\x{92c} "]},'nl' => {'and' => ['* ','En '],'background' => ['Achtergrond'],'but' => ['* ','Maar '],'examples' => ['Voorbeelden'],'feature' => ['Functionaliteit'],'given' => ['* ','Gegeven ','Stel '],'name' => 'Dutch','native' => 'Nederlands','rule' => ['Rule'],'scenario' => ['Voorbeeld','Scenario'],'scenarioOutline' => ['Abstract Scenario'],'then' => ['* ','Dan '],'when' => ['* ','Als ','Wanneer ']},'no' => {'and' => ['* ','Og '],'background' => ['Bakgrunn'],'but' => ['* ','Men '],'examples' => ['Eksempler'],'feature' => ['Egenskap'],'given' => ['* ','Gitt '],'name' => 'Norwegian','native' => 'norsk','rule' => ['Regel'],'scenario' => ['Eksempel','Scenario'],'scenarioOutline' => ['Scenariomal','Abstrakt Scenario'],'then' => ['* ',"S\x{e5} "],'when' => ['* ',"N\x{e5}r "]},'pa' => {'and' => ['* ',"\x{a05}\x{a24}\x{a47} "],'background' => ["\x{a2a}\x{a3f}\x{a1b}\x{a4b}\x{a15}\x{a5c}"],'but' => ['* ',"\x{a2a}\x{a30} "],'examples' => ["\x{a09}\x{a26}\x{a3e}\x{a39}\x{a30}\x{a28}\x{a3e}\x{a02}"],'feature' => ["\x{a16}\x{a3e}\x{a38}\x{a40}\x{a05}\x{a24}","\x{a2e}\x{a41}\x{a39}\x{a3e}\x{a02}\x{a26}\x{a30}\x{a3e}","\x{a28}\x{a15}\x{a36} \x{a28}\x{a41}\x{a39}\x{a3e}\x{a30}"],'given' => ['* ',"\x{a1c}\x{a47}\x{a15}\x{a30} ","\x{a1c}\x{a3f}\x{a35}\x{a47}\x{a02} \x{a15}\x{a3f} "],'name' => 'Panjabi','native' => "\x{a2a}\x{a70}\x{a1c}\x{a3e}\x{a2c}\x{a40}",'rule' => ['Rule'],'scenario' => ["\x{a09}\x{a26}\x{a3e}\x{a39}\x{a30}\x{a28}","\x{a2a}\x{a1f}\x{a15}\x{a25}\x{a3e}"],'scenarioOutline' => ["\x{a2a}\x{a1f}\x{a15}\x{a25}\x{a3e} \x{a22}\x{a3e}\x{a02}\x{a1a}\x{a3e}","\x{a2a}\x{a1f}\x{a15}\x{a25}\x{a3e} \x{a30}\x{a42}\x{a2a} \x{a30}\x{a47}\x{a16}\x{a3e}"],'then' => ['* ',"\x{a24}\x{a26} "],'when' => ['* ',"\x{a1c}\x{a26}\x{a4b}\x{a02} "]},'pl' => {'and' => ['* ','Oraz ','I '],'background' => ["Za\x{142}o\x{17c}enia"],'but' => ['* ','Ale '],'examples' => ["Przyk\x{142}ady"],'feature' => ["W\x{142}a\x{15b}ciwo\x{15b}\x{107}",'Funkcja','Aspekt','Potrzeba biznesowa'],'given' => ['* ',"Zak\x{142}adaj\x{105}c ","Maj\x{105}c ","Zak\x{142}adaj\x{105}c, \x{17c}e "],'name' => 'Polish','native' => 'polski','rule' => ['Rule'],'scenario' => ["Przyk\x{142}ad",'Scenariusz'],'scenarioOutline' => ['Szablon scenariusza'],'then' => ['* ','Wtedy '],'when' => ['* ',"Je\x{17c}eli ","Je\x{15b}li ",'Gdy ','Kiedy ']},'pt' => {'and' => ['* ','E '],'background' => ['Contexto',"Cen\x{e1}rio de Fundo",'Cenario de Fundo','Fundo'],'but' => ['* ','Mas '],'examples' => ['Exemplos',"Cen\x{e1}rios",'Cenarios'],'feature' => ['Funcionalidade',"Caracter\x{ed}stica",'Caracteristica'],'given' => ['* ','Dado ','Dada ','Dados ','Dadas '],'name' => 'Portuguese','native' => "portugu\x{ea}s",'rule' => ['Regra'],'scenario' => ['Exemplo',"Cen\x{e1}rio",'Cenario'],'scenarioOutline' => ["Esquema do Cen\x{e1}rio",'Esquema do Cenario',"Delinea\x{e7}\x{e3}o do Cen\x{e1}rio",'Delineacao do Cenario'],'then' => ['* ',"Ent\x{e3}o ",'Entao '],'when' => ['* ','Quando ']},'ro' => {'and' => ['* ','Si ',"\x{218}i ","\x{15e}i "],'background' => ['Context'],'but' => ['* ','Dar '],'examples' => ['Exemple'],'feature' => ['Functionalitate',"Func\x{21b}ionalitate","Func\x{163}ionalitate"],'given' => ['* ','Date fiind ','Dat fiind ',"Dat\x{103} fiind",'Dati fiind ',"Da\x{21b}i fiind ","Da\x{163}i fiind "],'name' => 'Romanian','native' => "rom\x{e2}n\x{103}",'rule' => ['Rule'],'scenario' => ['Exemplu','Scenariu'],'scenarioOutline' => ['Structura scenariu',"Structur\x{103} scenariu"],'then' => ['* ','Atunci '],'when' => ['* ','Cand ',"C\x{e2}nd "]},'ru' => {'and' => ['* ',"\x{418} ","\x{41a} \x{442}\x{43e}\x{43c}\x{443} \x{436}\x{435} ","\x{422}\x{430}\x{43a}\x{436}\x{435} "],'background' => ["\x{41f}\x{440}\x{435}\x{434}\x{44b}\x{441}\x{442}\x{43e}\x{440}\x{438}\x{44f}","\x{41a}\x{43e}\x{43d}\x{442}\x{435}\x{43a}\x{441}\x{442}"],'but' => ['* ',"\x{41d}\x{43e} ","\x{410} ","\x{418}\x{43d}\x{430}\x{447}\x{435} "],'examples' => ["\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}\x{44b}"],'feature' => ["\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{438}\x{44f}","\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{438}\x{43e}\x{43d}\x{430}\x{43b}\x{44c}\x{43d}\x{43e}\x{441}\x{442}\x{44c}","\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{438}\x{43e}\x{43d}\x{430}\x{43b}","\x{421}\x{432}\x{43e}\x{439}\x{441}\x{442}\x{432}\x{43e}"],'given' => ['* ',"\x{414}\x{43e}\x{43f}\x{443}\x{441}\x{442}\x{438}\x{43c} ","\x{414}\x{430}\x{43d}\x{43e} ","\x{41f}\x{443}\x{441}\x{442}\x{44c} "],'name' => 'Russian','native' => "\x{440}\x{443}\x{441}\x{441}\x{43a}\x{438}\x{439}",'rule' => ["\x{41f}\x{440}\x{430}\x{432}\x{438}\x{43b}\x{43e}"],'scenario' => ["\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}","\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{439}"],'scenarioOutline' => ["\x{421}\x{442}\x{440}\x{443}\x{43a}\x{442}\x{443}\x{440}\x{430} \x{441}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{44f}"],'then' => ['* ',"\x{422}\x{43e} ","\x{417}\x{430}\x{442}\x{435}\x{43c} ","\x{422}\x{43e}\x{433}\x{434}\x{430} "],'when' => ['* ',"\x{41a}\x{43e}\x{433}\x{434}\x{430} ","\x{415}\x{441}\x{43b}\x{438} "]},'sk' => {'and' => ['* ','A ',"A tie\x{17e} ","A taktie\x{17e} ","A z\x{e1}rove\x{148} "],'background' => ['Pozadie'],'but' => ['* ','Ale '],'examples' => ["Pr\x{ed}klady"],'feature' => ["Po\x{17e}iadavka",'Funkcia',"Vlastnos\x{165}"],'given' => ['* ',"Pokia\x{13e} ",'Za predpokladu '],'name' => 'Slovak','native' => 'Slovensky','rule' => ['Rule'],'scenario' => ["Pr\x{ed}klad","Scen\x{e1}r"],'scenarioOutline' => ["N\x{e1}\x{10d}rt Scen\x{e1}ru","N\x{e1}\x{10d}rt Scen\x{e1}ra","Osnova Scen\x{e1}ra"],'then' => ['* ','Tak ','Potom '],'when' => ['* ',"Ke\x{10f} ",'Ak ']},'sl' => {'and' => ['In ','Ter '],'background' => ['Kontekst','Osnova','Ozadje'],'but' => ['Toda ','Ampak ','Vendar '],'examples' => ['Primeri','Scenariji'],'feature' => ['Funkcionalnost','Funkcija',"Mo\x{17e}nosti",'Moznosti','Lastnost',"Zna\x{10d}ilnost"],'given' => ['Dano ','Podano ','Zaradi ','Privzeto '],'name' => 'Slovenian','native' => 'Slovenski','rule' => ['Rule'],'scenario' => ['Primer','Scenarij'],'scenarioOutline' => ['Struktura scenarija','Skica','Koncept','Oris scenarija','Osnutek'],'then' => ['Nato ','Potem ','Takrat '],'when' => ['Ko ','Ce ',"\x{10c}e ",'Kadar ']},'sr-Cyrl' => {'and' => ['* ',"\x{418} "],'background' => ["\x{41a}\x{43e}\x{43d}\x{442}\x{435}\x{43a}\x{441}\x{442}","\x{41e}\x{441}\x{43d}\x{43e}\x{432}\x{430}","\x{41f}\x{43e}\x{437}\x{430}\x{434}\x{438}\x{43d}\x{430}"],'but' => ['* ',"\x{410}\x{43b}\x{438} "],'examples' => ["\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}\x{438}","\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{458}\x{438}"],'feature' => ["\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{438}\x{43e}\x{43d}\x{430}\x{43b}\x{43d}\x{43e}\x{441}\x{442}","\x{41c}\x{43e}\x{433}\x{443}\x{45b}\x{43d}\x{43e}\x{441}\x{442}","\x{41e}\x{441}\x{43e}\x{431}\x{438}\x{43d}\x{430}"],'given' => ['* ',"\x{417}\x{430} \x{434}\x{430}\x{442}\x{43e} ","\x{417}\x{430} \x{434}\x{430}\x{442}\x{435} ","\x{417}\x{430} \x{434}\x{430}\x{442}\x{438} "],'name' => 'Serbian','native' => "\x{421}\x{440}\x{43f}\x{441}\x{43a}\x{438}",'rule' => ['Rule'],'scenario' => ["\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}","\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{43e}","\x{41f}\x{440}\x{438}\x{43c}\x{435}\x{440}"],'scenarioOutline' => ["\x{421}\x{442}\x{440}\x{443}\x{43a}\x{442}\x{443}\x{440}\x{430} \x{441}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{458}\x{430}","\x{421}\x{43a}\x{438}\x{446}\x{430}","\x{41a}\x{43e}\x{43d}\x{446}\x{435}\x{43f}\x{442}"],'then' => ['* ',"\x{41e}\x{43d}\x{434}\x{430} "],'when' => ['* ',"\x{41a}\x{430}\x{434}\x{430} ","\x{41a}\x{430}\x{434} "]},'sr-Latn' => {'and' => ['* ','I '],'background' => ['Kontekst','Osnova','Pozadina'],'but' => ['* ','Ali '],'examples' => ['Primeri','Scenariji'],'feature' => ['Funkcionalnost',"Mogu\x{107}nost",'Mogucnost','Osobina'],'given' => ['* ','Za dato ','Za date ','Za dati '],'name' => 'Serbian (Latin)','native' => 'Srpski (Latinica)','rule' => ['Rule'],'scenario' => ['Scenario','Primer'],'scenarioOutline' => ['Struktura scenarija','Skica','Koncept'],'then' => ['* ','Onda '],'when' => ['* ','Kada ','Kad ']},'sv' => {'and' => ['* ','Och '],'background' => ['Bakgrund'],'but' => ['* ','Men '],'examples' => ['Exempel'],'feature' => ['Egenskap'],'given' => ['* ','Givet '],'name' => 'Swedish','native' => 'Svenska','rule' => ['Rule'],'scenario' => ['Scenario'],'scenarioOutline' => ['Abstrakt Scenario','Scenariomall'],'then' => ['* ',"S\x{e5} "],'when' => ['* ',"N\x{e4}r "]},'ta' => {'and' => ['* ',"\x{bae}\x{bc7}\x{bb2}\x{bc1}\x{bae}\x{bcd} ","\x{bae}\x{bb1}\x{bcd}\x{bb1}\x{bc1}\x{bae}\x{bcd} "],'background' => ["\x{baa}\x{bbf}\x{ba9}\x{bcd}\x{ba9}\x{ba3}\x{bbf}"],'but' => ['* ',"\x{b86}\x{ba9}\x{bbe}\x{bb2}\x{bcd} "],'examples' => ["\x{b8e}\x{b9f}\x{bc1}\x{ba4}\x{bcd}\x{ba4}\x{bc1}\x{b95}\x{bcd}\x{b95}\x{bbe}\x{b9f}\x{bcd}\x{b9f}\x{bc1}\x{b95}\x{bb3}\x{bcd}","\x{b95}\x{bbe}\x{b9f}\x{bcd}\x{b9a}\x{bbf}\x{b95}\x{bb3}\x{bcd}","\x{ba8}\x{bbf}\x{bb2}\x{bc8}\x{bae}\x{bc8}\x{b95}\x{bb3}\x{bbf}\x{bb2}\x{bcd}"],'feature' => ["\x{b85}\x{bae}\x{bcd}\x{b9a}\x{bae}\x{bcd}","\x{bb5}\x{ba3}\x{bbf}\x{b95} \x{ba4}\x{bc7}\x{bb5}\x{bc8}","\x{ba4}\x{bbf}\x{bb1}\x{ba9}\x{bcd}"],'given' => ['* ',"\x{b95}\x{bc6}\x{bbe}\x{b9f}\x{bc1}\x{b95}\x{bcd}\x{b95}\x{baa}\x{bcd}\x{baa}\x{b9f}\x{bcd}\x{b9f} "],'name' => 'Tamil','native' => "\x{ba4}\x{bae}\x{bbf}\x{bb4}\x{bcd}",'rule' => ['Rule'],'scenario' => ["\x{b89}\x{ba4}\x{bbe}\x{bb0}\x{ba3}\x{bae}\x{bbe}\x{b95}","\x{b95}\x{bbe}\x{b9f}\x{bcd}\x{b9a}\x{bbf}"],'scenarioOutline' => ["\x{b95}\x{bbe}\x{b9f}\x{bcd}\x{b9a}\x{bbf} \x{b9a}\x{bc1}\x{bb0}\x{bc1}\x{b95}\x{bcd}\x{b95}\x{bae}\x{bcd}","\x{b95}\x{bbe}\x{b9f}\x{bcd}\x{b9a}\x{bbf} \x{bb5}\x{bbe}\x{bb0}\x{bcd}\x{baa}\x{bcd}\x{baa}\x{bc1}\x{bb0}\x{bc1}"],'then' => ['* ',"\x{b85}\x{baa}\x{bcd}\x{baa}\x{bc6}\x{bbe}\x{bb4}\x{bc1}\x{ba4}\x{bc1} "],'when' => ['* ',"\x{b8e}\x{baa}\x{bcd}\x{baa}\x{bc7}\x{bbe}\x{ba4}\x{bc1} "]},'te' => {'and' => ['* ',"\x{c2e}\x{c30}\x{c3f}\x{c2f}\x{c41} "],'background' => ["\x{c28}\x{c47}\x{c2a}\x{c25}\x{c4d}\x{c2f}\x{c02}"],'but' => ['* ',"\x{c15}\x{c3e}\x{c28}\x{c3f} "],'examples' => ["\x{c09}\x{c26}\x{c3e}\x{c39}\x{c30}\x{c23}\x{c32}\x{c41}"],'feature' => ["\x{c17}\x{c41}\x{c23}\x{c2e}\x{c41}"],'given' => ['* ',"\x{c1a}\x{c46}\x{c2a}\x{c4d}\x{c2a}\x{c2c}\x{c21}\x{c3f}\x{c28}\x{c26}\x{c3f} "],'name' => 'Telugu','native' => "\x{c24}\x{c46}\x{c32}\x{c41}\x{c17}\x{c41}",'rule' => ['Rule'],'scenario' => ["\x{c09}\x{c26}\x{c3e}\x{c39}\x{c30}\x{c23}","\x{c38}\x{c28}\x{c4d}\x{c28}\x{c3f}\x{c35}\x{c47}\x{c36}\x{c02}"],'scenarioOutline' => ["\x{c15}\x{c25}\x{c28}\x{c02}"],'then' => ['* ',"\x{c05}\x{c2a}\x{c4d}\x{c2a}\x{c41}\x{c21}\x{c41} "],'when' => ['* ',"\x{c08} \x{c2a}\x{c30}\x{c3f}\x{c38}\x{c4d}\x{c25}\x{c3f}\x{c24}\x{c3f}\x{c32}\x{c4b} "]},'th' => {'and' => ['* ',"\x{e41}\x{e25}\x{e30} "],'background' => ["\x{e41}\x{e19}\x{e27}\x{e04}\x{e34}\x{e14}"],'but' => ['* ',"\x{e41}\x{e15}\x{e48} "],'examples' => ["\x{e0a}\x{e38}\x{e14}\x{e02}\x{e2d}\x{e07}\x{e15}\x{e31}\x{e27}\x{e2d}\x{e22}\x{e48}\x{e32}\x{e07}","\x{e0a}\x{e38}\x{e14}\x{e02}\x{e2d}\x{e07}\x{e40}\x{e2b}\x{e15}\x{e38}\x{e01}\x{e32}\x{e23}\x{e13}\x{e4c}"],'feature' => ["\x{e42}\x{e04}\x{e23}\x{e07}\x{e2b}\x{e25}\x{e31}\x{e01}","\x{e04}\x{e27}\x{e32}\x{e21}\x{e15}\x{e49}\x{e2d}\x{e07}\x{e01}\x{e32}\x{e23}\x{e17}\x{e32}\x{e07}\x{e18}\x{e38}\x{e23}\x{e01}\x{e34}\x{e08}","\x{e04}\x{e27}\x{e32}\x{e21}\x{e2a}\x{e32}\x{e21}\x{e32}\x{e23}\x{e16}"],'given' => ['* ',"\x{e01}\x{e33}\x{e2b}\x{e19}\x{e14}\x{e43}\x{e2b}\x{e49} "],'name' => 'Thai','native' => "\x{e44}\x{e17}\x{e22}",'rule' => ['Rule'],'scenario' => ["\x{e40}\x{e2b}\x{e15}\x{e38}\x{e01}\x{e32}\x{e23}\x{e13}\x{e4c}"],'scenarioOutline' => ["\x{e2a}\x{e23}\x{e38}\x{e1b}\x{e40}\x{e2b}\x{e15}\x{e38}\x{e01}\x{e32}\x{e23}\x{e13}\x{e4c}","\x{e42}\x{e04}\x{e23}\x{e07}\x{e2a}\x{e23}\x{e49}\x{e32}\x{e07}\x{e02}\x{e2d}\x{e07}\x{e40}\x{e2b}\x{e15}\x{e38}\x{e01}\x{e32}\x{e23}\x{e13}\x{e4c}"],'then' => ['* ',"\x{e14}\x{e31}\x{e07}\x{e19}\x{e31}\x{e49}\x{e19} "],'when' => ['* ',"\x{e40}\x{e21}\x{e37}\x{e48}\x{e2d} "]},'tlh' => {'and' => ['* ','\'ej ','latlh '],'background' => ['mo\''],'but' => ['* ','\'ach ','\'a '],'examples' => ['ghantoH','lutmey'],'feature' => ['Qap','Qu\'meH \'ut','perbogh','poQbogh malja\'','laH'],'given' => ['* ','ghu\' noblu\' ','DaH ghu\' bejlu\' '],'name' => 'Klingon','native' => 'tlhIngan','rule' => ['Rule'],'scenario' => ['lut'],'scenarioOutline' => ['lut chovnatlh'],'then' => ['* ','vaj '],'when' => ['* ','qaSDI\' ']},'tr' => {'and' => ['* ','Ve '],'background' => ["Ge\x{e7}mi\x{15f}"],'but' => ['* ','Fakat ','Ama '],'examples' => ["\x{d6}rnekler"],'feature' => ["\x{d6}zellik"],'given' => ['* ','Diyelim ki '],'name' => 'Turkish','native' => "T\x{fc}rk\x{e7}e",'rule' => ['Rule'],'scenario' => ["\x{d6}rnek",'Senaryo'],'scenarioOutline' => ["Senaryo tasla\x{11f}\x{131}"],'then' => ['* ','O zaman '],'when' => ['* ',"E\x{11f}er ki "]},'tt' => {'and' => ['* ',"\x{4ba}\x{4d9}\x{43c} ","\x{412}\x{4d9} "],'background' => ["\x{41a}\x{435}\x{440}\x{435}\x{448}"],'but' => ['* ',"\x{41b}\x{4d9}\x{43a}\x{438}\x{43d} ","\x{4d8}\x{43c}\x{43c}\x{430} "],'examples' => ["\x{4ae}\x{440}\x{43d}\x{4d9}\x{43a}\x{43b}\x{4d9}\x{440}","\x{41c}\x{438}\x{441}\x{430}\x{43b}\x{43b}\x{430}\x{440}"],'feature' => ["\x{41c}\x{4e9}\x{43c}\x{43a}\x{438}\x{43d}\x{43b}\x{435}\x{43a}","\x{4ae}\x{437}\x{435}\x{43d}\x{447}\x{4d9}\x{43b}\x{435}\x{43a}\x{43b}\x{435}\x{43b}\x{435}\x{43a}"],'given' => ['* ',"\x{4d8}\x{439}\x{442}\x{438}\x{43a} "],'name' => 'Tatar','native' => "\x{422}\x{430}\x{442}\x{430}\x{440}\x{447}\x{430}",'rule' => ['Rule'],'scenario' => ["\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{439}"],'scenarioOutline' => ["\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{439}\x{43d}\x{44b}\x{4a3} \x{442}\x{4e9}\x{437}\x{435}\x{43b}\x{435}\x{448}\x{435}"],'then' => ['* ',"\x{41d}\x{4d9}\x{442}\x{438}\x{497}\x{4d9}\x{434}\x{4d9} "],'when' => ['* ',"\x{4d8}\x{433}\x{4d9}\x{440} "]},'uk' => {'and' => ['* ',"\x{406} ","\x{410} \x{442}\x{430}\x{43a}\x{43e}\x{436} ","\x{422}\x{430} "],'background' => ["\x{41f}\x{435}\x{440}\x{435}\x{434}\x{443}\x{43c}\x{43e}\x{432}\x{430}"],'but' => ['* ',"\x{410}\x{43b}\x{435} "],'examples' => ["\x{41f}\x{440}\x{438}\x{43a}\x{43b}\x{430}\x{434}\x{438}"],'feature' => ["\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{456}\x{43e}\x{43d}\x{430}\x{43b}"],'given' => ['* ',"\x{41f}\x{440}\x{438}\x{43f}\x{443}\x{441}\x{442}\x{438}\x{43c}\x{43e} ","\x{41f}\x{440}\x{438}\x{43f}\x{443}\x{441}\x{442}\x{438}\x{43c}\x{43e}, \x{449}\x{43e} ","\x{41d}\x{435}\x{445}\x{430}\x{439} ","\x{414}\x{430}\x{43d}\x{43e} "],'name' => 'Ukrainian','native' => "\x{423}\x{43a}\x{440}\x{430}\x{457}\x{43d}\x{441}\x{44c}\x{43a}\x{430}",'rule' => ['Rule'],'scenario' => ["\x{41f}\x{440}\x{438}\x{43a}\x{43b}\x{430}\x{434}","\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{456}\x{439}"],'scenarioOutline' => ["\x{421}\x{442}\x{440}\x{443}\x{43a}\x{442}\x{443}\x{440}\x{430} \x{441}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{456}\x{44e}"],'then' => ['* ',"\x{422}\x{43e} ","\x{422}\x{43e}\x{434}\x{456} "],'when' => ['* ',"\x{42f}\x{43a}\x{449}\x{43e} ","\x{41a}\x{43e}\x{43b}\x{438} "]},'ur' => {'and' => ['* ',"\x{627}\x{648}\x{631} "],'background' => ["\x{67e}\x{633} \x{645}\x{646}\x{638}\x{631}"],'but' => ['* ',"\x{644}\x{6cc}\x{6a9}\x{646} "],'examples' => ["\x{645}\x{62b}\x{627}\x{644}\x{6cc}\x{6ba}"],'feature' => ["\x{635}\x{644}\x{627}\x{62d}\x{6cc}\x{62a}","\x{6a9}\x{627}\x{631}\x{648}\x{628}\x{627}\x{631} \x{6a9}\x{6cc} \x{636}\x{631}\x{648}\x{631}\x{62a}","\x{62e}\x{635}\x{648}\x{635}\x{6cc}\x{62a}"],'given' => ['* ',"\x{627}\x{6af}\x{631} ","\x{628}\x{627}\x{644}\x{641}\x{631}\x{636} ","\x{641}\x{631}\x{636} \x{6a9}\x{6cc}\x{627} "],'name' => 'Urdu','native' => "\x{627}\x{631}\x{62f}\x{648}",'rule' => ['Rule'],'scenario' => ["\x{645}\x{646}\x{638}\x{631}\x{646}\x{627}\x{645}\x{6c1}"],'scenarioOutline' => ["\x{645}\x{646}\x{638}\x{631} \x{646}\x{627}\x{645}\x{6d2} \x{6a9}\x{627} \x{62e}\x{627}\x{6a9}\x{6c1}"],'then' => ['* ',"\x{67e}\x{6be}\x{631} ","\x{62a}\x{628} "],'when' => ['* ',"\x{62c}\x{628} "]},'uz' => {'and' => ['* ',"\x{412}\x{430} "],'background' => ["\x{422}\x{430}\x{440}\x{438}\x{445}"],'but' => ['* ',"\x{41b}\x{435}\x{43a}\x{438}\x{43d} ","\x{411}\x{438}\x{440}\x{43e}\x{43a} ","\x{410}\x{43c}\x{43c}\x{43e} "],'examples' => ["\x{41c}\x{438}\x{441}\x{43e}\x{43b}\x{43b}\x{430}\x{440}"],'feature' => ["\x{424}\x{443}\x{43d}\x{43a}\x{446}\x{438}\x{43e}\x{43d}\x{430}\x{43b}"],'given' => ['* ',"\x{410}\x{433}\x{430}\x{440} "],'name' => 'Uzbek','native' => "\x{423}\x{437}\x{431}\x{435}\x{43a}\x{447}\x{430}",'rule' => ['Rule'],'scenario' => ["\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{439}"],'scenarioOutline' => ["\x{421}\x{446}\x{435}\x{43d}\x{430}\x{440}\x{438}\x{439} \x{441}\x{442}\x{440}\x{443}\x{43a}\x{442}\x{443}\x{440}\x{430}\x{441}\x{438}"],'then' => ['* ',"\x{423}\x{43d}\x{434}\x{430} "],'when' => ['* ',"\x{410}\x{433}\x{430}\x{440} "]},'vi' => {'and' => ['* ',"V\x{e0} "],'background' => ["B\x{1ed1}i c\x{1ea3}nh"],'but' => ['* ',"Nh\x{1b0}ng "],'examples' => ["D\x{1eef} li\x{1ec7}u"],'feature' => ["T\x{ed}nh n\x{103}ng"],'given' => ['* ',"Bi\x{1ebf}t ",'Cho '],'name' => 'Vietnamese','native' => "Ti\x{1ebf}ng Vi\x{1ec7}t",'rule' => ['Rule'],'scenario' => ["T\x{ec}nh hu\x{1ed1}ng","K\x{1ecb}ch b\x{1ea3}n"],'scenarioOutline' => ["Khung t\x{ec}nh hu\x{1ed1}ng","Khung k\x{1ecb}ch b\x{1ea3}n"],'then' => ['* ',"Th\x{ec} "],'when' => ['* ','Khi ']},'zh-CN' => {'and' => ['* ',"\x{800c}\x{4e14}","\x{5e76}\x{4e14}","\x{540c}\x{65f6}"],'background' => ["\x{80cc}\x{666f}"],'but' => ['* ',"\x{4f46}\x{662f}"],'examples' => ["\x{4f8b}\x{5b50}"],'feature' => ["\x{529f}\x{80fd}"],'given' => ['* ',"\x{5047}\x{5982}","\x{5047}\x{8bbe}","\x{5047}\x{5b9a}"],'name' => 'Chinese simplified','native' => "\x{7b80}\x{4f53}\x{4e2d}\x{6587}",'rule' => ['Rule'],'scenario' => ["\x{573a}\x{666f}","\x{5267}\x{672c}"],'scenarioOutline' => ["\x{573a}\x{666f}\x{5927}\x{7eb2}","\x{5267}\x{672c}\x{5927}\x{7eb2}"],'then' => ['* ',"\x{90a3}\x{4e48}"],'when' => ['* ',"\x{5f53}"]},'zh-TW' => {'and' => ['* ',"\x{800c}\x{4e14}","\x{4e26}\x{4e14}","\x{540c}\x{6642}"],'background' => ["\x{80cc}\x{666f}"],'but' => ['* ',"\x{4f46}\x{662f}"],'examples' => ["\x{4f8b}\x{5b50}"],'feature' => ["\x{529f}\x{80fd}"],'given' => ['* ',"\x{5047}\x{5982}","\x{5047}\x{8a2d}","\x{5047}\x{5b9a}"],'name' => 'Chinese traditional','native' => "\x{7e41}\x{9ad4}\x{4e2d}\x{6587}",'rule' => ['Rule'],'scenario' => ["\x{5834}\x{666f}","\x{5287}\x{672c}"],'scenarioOutline' => ["\x{5834}\x{666f}\x{5927}\x{7db1}","\x{5287}\x{672c}\x{5927}\x{7db1}"],'then' => ['* ',"\x{90a3}\x{9ebc}"],'when' => ['* ',"\x{7576}"]}}; + 1; diff --git a/gherkin/perl/lib/Gherkin/Generated/Parser.pm b/gherkin/perl/lib/Gherkin/Generated/Parser.pm index b4aa71885c..616aea5bee 100644 --- a/gherkin/perl/lib/Gherkin/Generated/Parser.pm +++ b/gherkin/perl/lib/Gherkin/Generated/Parser.pm @@ -13,9 +13,9 @@ our @RULE_TYPES = [ '_Comment', # #Comment '_TagLine', # #TagLine '_FeatureLine', # #FeatureLine + '_RuleLine', # #RuleLine '_BackgroundLine', # #BackgroundLine '_ScenarioLine', # #ScenarioLine - '_ScenarioOutlineLine', # #ScenarioOutlineLine '_ExamplesLine', # #ExamplesLine '_StepLine', # #StepLine '_DocStringSeparator', # #DocStringSeparator @@ -23,21 +23,22 @@ our @RULE_TYPES = [ '_Language', # #Language '_Other', # #Other 'GherkinDocument', # GherkinDocument! := Feature? - 'Feature', # Feature! := Feature_Header Background? Scenario_Definition* - 'Feature_Header', # Feature_Header! := #Language? Tags? #FeatureLine Description_Helper - 'Background', # Background! := #BackgroundLine Description_Helper Step* - 'Scenario_Definition', # Scenario_Definition! := Tags? (Scenario | ScenarioOutline) - 'Scenario', # Scenario! := #ScenarioLine Description_Helper Step* - 'ScenarioOutline', # ScenarioOutline! := #ScenarioOutlineLine Description_Helper Step* Examples_Definition* - 'Examples_Definition', # Examples_Definition! [#Empty|#Comment|#TagLine->#ExamplesLine] := Tags? Examples - 'Examples', # Examples! := #ExamplesLine Description_Helper Examples_Table? - 'Examples_Table', # Examples_Table! := #TableRow #TableRow* - 'Step', # Step! := #StepLine Step_Arg? - 'Step_Arg', # Step_Arg := (DataTable | DocString) + 'Feature', # Feature! := FeatureHeader Background? ScenarioDefinition* Rule* + 'FeatureHeader', # FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper + 'Rule', # Rule! := RuleHeader Background? ScenarioDefinition* + 'RuleHeader', # RuleHeader! := #RuleLine DescriptionHelper + 'Background', # Background! := #BackgroundLine DescriptionHelper Step* + 'ScenarioDefinition', # ScenarioDefinition! := Tags? Scenario + 'Scenario', # Scenario! := #ScenarioLine DescriptionHelper Step* ExamplesDefinition* + 'ExamplesDefinition', # ExamplesDefinition! [#Empty|#Comment|#TagLine->#ExamplesLine] := Tags? Examples + 'Examples', # Examples! := #ExamplesLine DescriptionHelper ExamplesTable? + 'ExamplesTable', # ExamplesTable! := #TableRow #TableRow* + 'Step', # Step! := #StepLine StepArg? + 'StepArg', # StepArg := (DataTable | DocString) 'DataTable', # DataTable! := #TableRow+ 'DocString', # DocString! := #DocStringSeparator #Other* #DocStringSeparator 'Tags', # Tags! := #TagLine+ - 'Description_Helper', # Description_Helper := #Empty* Description? #Comment* + 'DescriptionHelper', # DescriptionHelper := #Empty* Description? #Comment* 'Description', # Description! := #Other+ ]; @@ -69,12 +70,28 @@ our %states_to_match_names = ( 24 => "match_token_at_24", 25 => "match_token_at_25", 26 => "match_token_at_26", + 27 => "match_token_at_27", 28 => "match_token_at_28", 29 => "match_token_at_29", 30 => "match_token_at_30", 31 => "match_token_at_31", 32 => "match_token_at_32", 33 => "match_token_at_33", + 34 => "match_token_at_34", + 35 => "match_token_at_35", + 36 => "match_token_at_36", + 37 => "match_token_at_37", + 38 => "match_token_at_38", + 39 => "match_token_at_39", + 40 => "match_token_at_40", + 42 => "match_token_at_42", + 43 => "match_token_at_43", + 44 => "match_token_at_44", + 45 => "match_token_at_45", + 46 => "match_token_at_46", + 47 => "match_token_at_47", + 48 => "match_token_at_48", + 49 => "match_token_at_49", ); sub parse { @@ -177,35 +194,35 @@ sub match_FeatureLine { ); } -sub match_BackgroundLine { +sub match_RuleLine { my ($self, $context, $token) = @_; return if $token->is_eof; return $self->handle_external_error( $context, 0, # Default return value - sub { $context->token_matcher->match_BackgroundLine + sub { $context->token_matcher->match_RuleLine ( $token ) } ); } -sub match_ScenarioLine { +sub match_BackgroundLine { my ($self, $context, $token) = @_; return if $token->is_eof; return $self->handle_external_error( $context, 0, # Default return value - sub { $context->token_matcher->match_ScenarioLine + sub { $context->token_matcher->match_BackgroundLine ( $token ) } ); } -sub match_ScenarioOutlineLine { +sub match_ScenarioLine { my ($self, $context, $token) = @_; return if $token->is_eof; return $self->handle_external_error( $context, 0, # Default return value - sub { $context->token_matcher->match_ScenarioOutlineLine + sub { $context->token_matcher->match_ScenarioLine ( $token ) } ); } @@ -282,24 +299,24 @@ sub match_token_at_0 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Language($context, $token)) { $self->_start_rule($context, 'Feature'); - $self->_start_rule($context, 'Feature_Header'); + $self->_start_rule($context, 'FeatureHeader'); $self->_build($context, $token); return 1; } if ($self->match_TagLine($context, $token)) { $self->_start_rule($context, 'Feature'); - $self->_start_rule($context, 'Feature_Header'); + $self->_start_rule($context, 'FeatureHeader'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 2; } if ($self->match_FeatureLine($context, $token)) { $self->_start_rule($context, 'Feature'); - $self->_start_rule($context, 'Feature_Header'); + $self->_start_rule($context, 'FeatureHeader'); $self->_build($context, $token); return 3; } @@ -332,7 +349,7 @@ sub match_token_at_0 { return 0; } -# GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0 +# GherkinDocument:0>Feature:0>FeatureHeader:0>#Language:0 sub match_token_at_1 { my ( $self, $token, $context ) = @_; if ($self->match_TagLine($context, $token)) { @@ -362,7 +379,7 @@ sub match_token_at_1 { my @args = ( $token, ["#TagLine", "#FeatureLine", "#Comment", "#Empty"], #" - "State: 1 - GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0", + "State: 1 - GherkinDocument:0>Feature:0>FeatureHeader:0>#Language:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -373,7 +390,7 @@ sub match_token_at_1 { return 1; } -# GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0 +# GherkinDocument:0>Feature:0>FeatureHeader:1>Tags:0>#TagLine:0 sub match_token_at_2 { my ( $self, $token, $context ) = @_; if ($self->match_TagLine($context, $token)) { @@ -403,7 +420,7 @@ sub match_token_at_2 { my @args = ( $token, ["#TagLine", "#FeatureLine", "#Comment", "#Empty"], #" - "State: 2 - GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0", + "State: 2 - GherkinDocument:0>Feature:0>FeatureHeader:1>Tags:0>#TagLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -414,14 +431,14 @@ sub match_token_at_2 { return 2; } -# GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0 +# GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0 sub match_token_at_3 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); + $self->_end_rule($context, 'FeatureHeader'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); @@ -432,31 +449,31 @@ sub match_token_at_3 { return 5; } if ($self->match_BackgroundLine($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); + $self->_end_rule($context, 'FeatureHeader'); $self->_start_rule($context, 'Background'); $self->_build($context, $token); return 6; } if ($self->match_TagLine($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } if ($self->match_ScenarioLine($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_start_rule($context, 'Description'); @@ -472,8 +489,8 @@ sub match_token_at_3 { my @args = ( $token, - ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 3 - GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0", + ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 3 - GherkinDocument:0>Feature:0>FeatureHeader:2>#FeatureLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -484,15 +501,15 @@ sub match_token_at_3 { return 3; } -# GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:1>Description:0>#Other:0 +# GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0 sub match_token_at_4 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'Feature_Header'); + $self->_end_rule($context, 'FeatureHeader'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_end_rule($context, 'Description'); @@ -501,34 +518,34 @@ sub match_token_at_4 { } if ($self->match_BackgroundLine($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'Feature_Header'); + $self->_end_rule($context, 'FeatureHeader'); $self->_start_rule($context, 'Background'); $self->_build($context, $token); return 6; } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_build($context, $token); @@ -543,8 +560,8 @@ sub match_token_at_4 { my @args = ( $token, - ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 4 - GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:1>Description:0>#Other:0", + ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 4 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:1>Description:0>#Other:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -555,45 +572,45 @@ sub match_token_at_4 { return 4; } -# GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:2>#Comment:0 +# GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0 sub match_token_at_5 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); + $self->_end_rule($context, 'FeatureHeader'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); return 5; } if ($self->match_BackgroundLine($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); + $self->_end_rule($context, 'FeatureHeader'); $self->_start_rule($context, 'Background'); $self->_build($context, $token); return 6; } if ($self->match_TagLine($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } if ($self->match_ScenarioLine($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { - $self->_end_rule($context, 'Feature_Header'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'FeatureHeader'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); @@ -608,8 +625,8 @@ sub match_token_at_5 { my @args = ( $token, - ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"], #" - "State: 5 - GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:2>#Comment:0", + ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"], #" + "State: 5 - GherkinDocument:0>Feature:0>FeatureHeader:3>DescriptionHelper:2>#Comment:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -627,7 +644,7 @@ sub match_token_at_6 { $self->_end_rule($context, 'Background'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); @@ -644,24 +661,24 @@ sub match_token_at_6 { } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_start_rule($context, 'Description'); @@ -677,7 +694,7 @@ sub match_token_at_6 { my @args = ( $token, - ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" + ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"], #" "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0", ); @@ -689,7 +706,7 @@ sub match_token_at_6 { return 6; } -# GherkinDocument:0>Feature:1>Background:1>Description_Helper:1>Description:0>#Other:0 +# GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0 sub match_token_at_7 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { @@ -697,7 +714,7 @@ sub match_token_at_7 { $self->_end_rule($context, 'Background'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_end_rule($context, 'Description'); @@ -713,7 +730,7 @@ sub match_token_at_7 { if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; @@ -721,18 +738,18 @@ sub match_token_at_7 { if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_build($context, $token); @@ -747,8 +764,8 @@ sub match_token_at_7 { my @args = ( $token, - ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 7 - GherkinDocument:0>Feature:1>Background:1>Description_Helper:1>Description:0>#Other:0", + ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 7 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:1>Description:0>#Other:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -759,14 +776,14 @@ sub match_token_at_7 { return 7; } -# GherkinDocument:0>Feature:1>Background:1>Description_Helper:2>#Comment:0 +# GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0 sub match_token_at_8 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Background'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); @@ -779,24 +796,24 @@ sub match_token_at_8 { } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); @@ -811,8 +828,8 @@ sub match_token_at_8 { my @args = ( $token, - ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"], #" - "State: 8 - GherkinDocument:0>Feature:1>Background:1>Description_Helper:2>#Comment:0", + ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"], #" + "State: 8 - GherkinDocument:0>Feature:1>Background:1>DescriptionHelper:2>#Comment:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -831,7 +848,7 @@ sub match_token_at_9 { $self->_end_rule($context, 'Background'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_TableRow($context, $token)) { $self->_start_rule($context, 'DataTable'); @@ -841,7 +858,7 @@ sub match_token_at_9 { if ($self->match_DocStringSeparator($context, $token)) { $self->_start_rule($context, 'DocString'); $self->_build($context, $token); - return 32; + return 48; } if ($self->match_StepLine($context, $token)) { $self->_end_rule($context, 'Step'); @@ -852,7 +869,7 @@ sub match_token_at_9 { if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; @@ -860,18 +877,18 @@ sub match_token_at_9 { if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); @@ -890,7 +907,7 @@ sub match_token_at_9 { my @args = ( $token, - ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" + ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" "State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0", ); @@ -902,7 +919,7 @@ sub match_token_at_9 { return 9; } -# GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 +# GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 sub match_token_at_10 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { @@ -911,7 +928,7 @@ sub match_token_at_10 { $self->_end_rule($context, 'Background'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_TableRow($context, $token)) { $self->_build($context, $token); @@ -928,7 +945,7 @@ sub match_token_at_10 { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; @@ -937,19 +954,19 @@ sub match_token_at_10 { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); @@ -968,8 +985,8 @@ sub match_token_at_10 { my @args = ( $token, - ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0", + ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -980,7 +997,7 @@ sub match_token_at_10 { return 10; } -# GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0 +# GherkinDocument:0>Feature:2>ScenarioDefinition:0>Tags:0>#TagLine:0 sub match_token_at_11 { my ( $self, $token, $context ) = @_; if ($self->match_TagLine($context, $token)) { @@ -993,12 +1010,6 @@ sub match_token_at_11 { $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { - $self->_end_rule($context, 'Tags'); - $self->_start_rule($context, 'ScenarioOutline'); - $self->_build($context, $token); - return 17; - } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); return 11; @@ -1016,8 +1027,8 @@ sub match_token_at_11 { my @args = ( $token, - ["#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 11 - GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0", + ["#TagLine", "#ScenarioLine", "#Comment", "#Empty"], #" + "State: 11 - GherkinDocument:0>Feature:2>ScenarioDefinition:0>Tags:0>#TagLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1028,15 +1039,15 @@ sub match_token_at_11 { return 11; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0 +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0 sub match_token_at_12 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); @@ -1051,29 +1062,43 @@ sub match_token_at_12 { $self->_build($context, $token); return 15; } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 17; + } + } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } + if ($self->match_ExamplesLine($context, $token)) { + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 18; + } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_start_rule($context, 'Description'); @@ -1089,8 +1114,8 @@ sub match_token_at_12 { my @args = ( $token, - ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 12 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0", + ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 12 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1101,16 +1126,16 @@ sub match_token_at_12 { return 12; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:1>Description:0>#Other:0 +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0 sub match_token_at_13 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_end_rule($context, 'Description'); @@ -1123,32 +1148,48 @@ sub match_token_at_13 { $self->_build($context, $token); return 15; } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 17; + } + } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } + if ($self->match_ExamplesLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 18; + } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_build($context, $token); @@ -1163,8 +1204,8 @@ sub match_token_at_13 { my @args = ( $token, - ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 13 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:1>Description:0>#Other:0", + ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 13 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1175,15 +1216,15 @@ sub match_token_at_13 { return 13; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:2>#Comment:0 +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0 sub match_token_at_14 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); @@ -1194,29 +1235,43 @@ sub match_token_at_14 { $self->_build($context, $token); return 15; } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 17; + } + } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } + if ($self->match_ExamplesLine($context, $token)) { + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 18; + } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); @@ -1231,8 +1286,8 @@ sub match_token_at_14 { my @args = ( $token, - ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"], #" - "State: 14 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:2>#Comment:0", + ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"], #" + "State: 14 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1243,16 +1298,16 @@ sub match_token_at_14 { return 14; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:0>#StepLine:0 +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0 sub match_token_at_15 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_TableRow($context, $token)) { $self->_start_rule($context, 'DataTable'); @@ -1262,7 +1317,7 @@ sub match_token_at_15 { if ($self->match_DocStringSeparator($context, $token)) { $self->_start_rule($context, 'DocString'); $self->_build($context, $token); - return 30; + return 46; } if ($self->match_StepLine($context, $token)) { $self->_end_rule($context, 'Step'); @@ -1270,32 +1325,48 @@ sub match_token_at_15 { $self->_build($context, $token); return 15; } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 17; + } + } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } + if ($self->match_ExamplesLine($context, $token)) { + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 18; + } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); @@ -1314,8 +1385,8 @@ sub match_token_at_15 { my @args = ( $token, - ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 15 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:0>#StepLine:0", + ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 15 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1326,17 +1397,17 @@ sub match_token_at_15 { return 15; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 sub match_token_at_16 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_TableRow($context, $token)) { $self->_build($context, $token); @@ -1349,35 +1420,53 @@ sub match_token_at_16 { $self->_build($context, $token); return 15; } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_end_rule($context, 'DataTable'); + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 17; + } + } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } + if ($self->match_ExamplesLine($context, $token)) { + $self->_end_rule($context, 'DataTable'); + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 18; + } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); @@ -1396,8 +1485,8 @@ sub match_token_at_16 { my @args = ( $token, - ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 16 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0", + ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 16 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1408,71 +1497,125 @@ sub match_token_at_16 { return 16; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0 +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0 sub match_token_at_17 { + my ( $self, $token, $context ) = @_; + if ($self->match_TagLine($context, $token)) { + $self->_build($context, $token); + return 17; + } + if ($self->match_ExamplesLine($context, $token)) { + $self->_end_rule($context, 'Tags'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 18; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 17; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 17; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"], #" + "State: 17 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 17; +} + +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0 +sub match_token_at_18 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 17; + return 18; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 19; + return 20; } - if ($self->match_StepLine($context, $token)) { - $self->_start_rule($context, 'Step'); + if ($self->match_TableRow($context, $token)) { + $self->_start_rule($context, 'ExamplesTable'); $self->_build($context, $token); - return 20; + return 21; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 17; } } if ($self->match_TagLine($context, $token)) { - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } if ($self->match_ExamplesLine($context, $token)) { - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 18; } if ($self->match_ScenarioLine($context, $token)) { - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_start_rule($context, 'Description'); $self->_build($context, $token); - return 18; + return 19; } $token->detach; @@ -1483,8 +1626,8 @@ sub match_token_at_17 { my @args = ( $token, - ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 17 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0", + ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 18 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1492,77 +1635,89 @@ sub match_token_at_17 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 17; + return 18; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:1>Description:0>#Other:0 -sub match_token_at_18 { +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0 +sub match_token_at_19 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_end_rule($context, 'Description'); $self->_build($context, $token); - return 19; + return 20; } - if ($self->match_StepLine($context, $token)) { + if ($self->match_TableRow($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_start_rule($context, 'Step'); + $self->_start_rule($context, 'ExamplesTable'); $self->_build($context, $token); - return 20; + return 21; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 17; } } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } if ($self->match_ExamplesLine($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 18; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_build($context, $token); - return 18; + return 19; } $token->detach; @@ -1573,8 +1728,8 @@ sub match_token_at_18 { my @args = ( $token, - ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 18 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:1>Description:0>#Other:0", + ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 19 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1582,69 +1737,81 @@ sub match_token_at_18 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 18; + return 19; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:2>#Comment:0 -sub match_token_at_19 { +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0 +sub match_token_at_20 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 19; + return 20; } - if ($self->match_StepLine($context, $token)) { - $self->_start_rule($context, 'Step'); + if ($self->match_TableRow($context, $token)) { + $self->_start_rule($context, 'ExamplesTable'); $self->_build($context, $token); - return 20; + return 21; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 17; } } if ($self->match_TagLine($context, $token)) { - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } if ($self->match_ExamplesLine($context, $token)) { - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 18; } if ($self->match_ScenarioLine($context, $token)) { - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 19; + return 20; } $token->detach; @@ -1655,8 +1822,8 @@ sub match_token_at_19 { my @args = ( $token, - ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"], #" - "State: 19 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:2>#Comment:0", + ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"], #" + "State: 20 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1664,86 +1831,1076 @@ sub match_token_at_19 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 19; + return 20; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:0>#StepLine:0 -sub match_token_at_20 { +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0 +sub match_token_at_21 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { - $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_end_rule($context, 'Feature'); + $self->_end_rule($context, 'ExamplesTable'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_TableRow($context, $token)) { + $self->_build($context, $token); + return 21; + } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_end_rule($context, 'ExamplesTable'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 17; + } + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'ExamplesTable'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 11; + } + if ($self->match_ExamplesLine($context, $token)) { + $self->_end_rule($context, 'ExamplesTable'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 18; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'ExamplesTable'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 12; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'ExamplesTable'); + $self->_end_rule($context, 'Examples'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 21; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 21; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 21 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 21; +} + +# GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0 +sub match_token_at_22 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 22; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 24; + } + if ($self->match_BackgroundLine($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'Background'); + $self->_build($context, $token); + return 25; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Other($context, $token)) { + $self->_start_rule($context, 'Description'); + $self->_build($context, $token); + return 23; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 22 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:0>#RuleLine:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 22; +} + +# GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0 +sub match_token_at_23 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'RuleHeader'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Comment($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_build($context, $token); + return 24; + } + if ($self->match_BackgroundLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'Background'); + $self->_build($context, $token); + return 25; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'RuleHeader'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Other($context, $token)) { + $self->_build($context, $token); + return 23; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 23 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:1>Description:0>#Other:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 23; +} + +# GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0 +sub match_token_at_24 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 24; + } + if ($self->match_BackgroundLine($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'Background'); + $self->_build($context, $token); + return 25; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'RuleHeader'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 24; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"], #" + "State: 24 - GherkinDocument:0>Feature:3>Rule:0>RuleHeader:1>DescriptionHelper:2>#Comment:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 24; +} + +# GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0 +sub match_token_at_25 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 25; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 27; + } + if ($self->match_StepLine($context, $token)) { + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 28; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Other($context, $token)) { + $self->_start_rule($context, 'Description'); + $self->_build($context, $token); + return 26; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 25 - GherkinDocument:0>Feature:3>Rule:1>Background:0>#BackgroundLine:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 25; +} + +# GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0 +sub match_token_at_26 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Comment($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_build($context, $token); + return 27; + } + if ($self->match_StepLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 28; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Other($context, $token)) { + $self->_build($context, $token); + return 26; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 26 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:1>Description:0>#Other:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 26; +} + +# GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0 +sub match_token_at_27 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 27; + } + if ($self->match_StepLine($context, $token)) { + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 28; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 27; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Empty"], #" + "State: 27 - GherkinDocument:0>Feature:3>Rule:1>Background:1>DescriptionHelper:2>#Comment:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 27; +} + +# GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0 +sub match_token_at_28 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_TableRow($context, $token)) { + $self->_start_rule($context, 'DataTable'); + $self->_build($context, $token); + return 29; + } + if ($self->match_DocStringSeparator($context, $token)) { + $self->_start_rule($context, 'DocString'); + $self->_build($context, $token); + return 44; + } + if ($self->match_StepLine($context, $token)) { + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 28; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 28; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 28; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 28 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:0>#StepLine:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 28; +} + +# GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 +sub match_token_at_29 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'DataTable'); + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_TableRow($context, $token)) { + $self->_build($context, $token); + return 29; + } + if ($self->match_StepLine($context, $token)) { + $self->_end_rule($context, 'DataTable'); + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 28; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'DataTable'); + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'DataTable'); + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'DataTable'); + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 29; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 29; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 29 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 29; +} + +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0 +sub match_token_at_30 { + my ( $self, $token, $context ) = @_; + if ($self->match_TagLine($context, $token)) { $self->_build($context, $token); - return 27; + return 30; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Tags'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 30; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 30; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#TagLine", "#ScenarioLine", "#Comment", "#Empty"], #" + "State: 30 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:0>Tags:0>#TagLine:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 30; +} + +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0 +sub match_token_at_31 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 31; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 33; + } + if ($self->match_StepLine($context, $token)) { + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 34; + } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 36; + } + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ExamplesLine($context, $token)) { + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 37; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Other($context, $token)) { + $self->_start_rule($context, 'Description'); + $self->_build($context, $token); + return 32; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 31 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:0>#ScenarioLine:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 31; +} + +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0 +sub match_token_at_32 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Comment($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_build($context, $token); + return 33; + } + if ($self->match_StepLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 34; + } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 36; + } + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ExamplesLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 37; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Description'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Other($context, $token)) { + $self->_build($context, $token); + return 32; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 32 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:1>Description:0>#Other:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 32; +} + +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0 +sub match_token_at_33 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 33; + } + if ($self->match_StepLine($context, $token)) { + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 34; + } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 36; + } + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 30; + } + if ($self->match_ExamplesLine($context, $token)) { + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 37; + } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 33; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"], #" + "State: 33 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:1>DescriptionHelper:2>#Comment:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 33; +} + +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0 +sub match_token_at_34 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; } if ($self->match_TableRow($context, $token)) { $self->_start_rule($context, 'DataTable'); $self->_build($context, $token); - return 21; + return 35; } if ($self->match_DocStringSeparator($context, $token)) { $self->_start_rule($context, 'DocString'); $self->_build($context, $token); - return 28; + return 42; } if ($self->match_StepLine($context, $token)) { $self->_end_rule($context, 'Step'); $self->_start_rule($context, 'Step'); $self->_build($context, $token); - return 20; + return 34; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { $self->_end_rule($context, 'Step'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 36; } } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 11; + return 30; } if ($self->match_ExamplesLine($context, $token)) { $self->_end_rule($context, 'Step'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 37; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); - return 12; + return 31; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 20; + return 34; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 20; + return 34; } $token->detach; @@ -1754,8 +2911,8 @@ sub match_token_at_20 { my @args = ( $token, - ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 20 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:0>#StepLine:0", + ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 34 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:0>#StepLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1763,87 +2920,89 @@ sub match_token_at_20 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 20; + return 34; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 -sub match_token_at_21 { +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0 +sub match_token_at_35 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_TableRow($context, $token)) { $self->_build($context, $token); - return 21; + return 35; } if ($self->match_StepLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); $self->_start_rule($context, 'Step'); $self->_build($context, $token); - return 20; + return 34; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 36; } } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 11; + return 30; } if ($self->match_ExamplesLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 37; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); - return 12; + return 31; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'DataTable'); $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 21; + return 35; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 21; + return 35; } $token->detach; @@ -1854,8 +3013,8 @@ sub match_token_at_21 { my @args = ( $token, - ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 21 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0", + ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 35 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:0>DataTable:0>#TableRow:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1863,29 +3022,29 @@ sub match_token_at_21 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 21; + return 35; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0 -sub match_token_at_22 { +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0 +sub match_token_at_36 { my ( $self, $token, $context ) = @_; if ($self->match_TagLine($context, $token)) { $self->_build($context, $token); - return 22; + return 36; } if ($self->match_ExamplesLine($context, $token)) { $self->_end_rule($context, 'Tags'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 37; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 22; + return 36; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 22; + return 36; } $token->detach; @@ -1897,7 +3056,7 @@ sub match_token_at_22 { my @args = ( $token, ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"], #" - "State: 22 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0", + "State: 36 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:0>Tags:0>#TagLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -1905,86 +3064,88 @@ sub match_token_at_22 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 22; + return 36; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0 -sub match_token_at_23 { +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0 +sub match_token_at_37 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 23; + return 37; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 25; + return 39; } if ($self->match_TableRow($context, $token)) { - $self->_start_rule($context, 'Examples_Table'); + $self->_start_rule($context, 'ExamplesTable'); $self->_build($context, $token); - return 26; + return 40; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 36; } } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 11; + return 30; } if ($self->match_ExamplesLine($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 37; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); - return 12; + return 31; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_start_rule($context, 'Description'); $self->_build($context, $token); - return 24; + return 38; } $token->detach; @@ -1995,8 +3156,8 @@ sub match_token_at_23 { my @args = ( $token, - ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 23 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0", + ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 37 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:0>#ExamplesLine:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2004,89 +3165,91 @@ sub match_token_at_23 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 23; + return 37; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:1>Description:0>#Other:0 -sub match_token_at_24 { +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0 +sub match_token_at_38 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_end_rule($context, 'Description'); $self->_build($context, $token); - return 25; + return 39; } if ($self->match_TableRow($context, $token)) { $self->_end_rule($context, 'Description'); - $self->_start_rule($context, 'Examples_Table'); + $self->_start_rule($context, 'ExamplesTable'); $self->_build($context, $token); - return 26; + return 40; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 36; } } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 11; + return 30; } if ($self->match_ExamplesLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 37; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); - return 12; + return 31; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Description'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Other($context, $token)) { $self->_build($context, $token); - return 24; + return 38; } $token->detach; @@ -2097,8 +3260,8 @@ sub match_token_at_24 { my @args = ( $token, - ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"], #" - "State: 24 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:1>Description:0>#Other:0", + ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Other"], #" + "State: 38 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:1>Description:0>#Other:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2106,81 +3269,83 @@ sub match_token_at_24 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 24; + return 38; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:2>#Comment:0 -sub match_token_at_25 { +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0 +sub match_token_at_39 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 25; + return 39; } if ($self->match_TableRow($context, $token)) { - $self->_start_rule($context, 'Examples_Table'); + $self->_start_rule($context, 'ExamplesTable'); $self->_build($context, $token); - return 26; + return 40; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 36; } } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 11; + return 30; } if ($self->match_ExamplesLine($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 37; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); - return 12; + return 31; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 25; + return 39; } $token->detach; @@ -2191,8 +3356,8 @@ sub match_token_at_25 { my @args = ( $token, - ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"], #" - "State: 25 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:2>#Comment:0", + ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Empty"], #" + "State: 39 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:1>DescriptionHelper:2>#Comment:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2200,86 +3365,88 @@ sub match_token_at_25 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 25; + return 39; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0 -sub match_token_at_26 { +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0 +sub match_token_at_40 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { - $self->_end_rule($context, 'Examples_Table'); + $self->_end_rule($context, 'ExamplesTable'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_TableRow($context, $token)) { $self->_build($context, $token); - return 26; + return 40; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { - $self->_end_rule($context, 'Examples_Table'); + $self->_end_rule($context, 'ExamplesTable'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 36; } } if ($self->match_TagLine($context, $token)) { - $self->_end_rule($context, 'Examples_Table'); + $self->_end_rule($context, 'ExamplesTable'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 11; + return 30; } if ($self->match_ExamplesLine($context, $token)) { - $self->_end_rule($context, 'Examples_Table'); + $self->_end_rule($context, 'ExamplesTable'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 37; } if ($self->match_ScenarioLine($context, $token)) { - $self->_end_rule($context, 'Examples_Table'); + $self->_end_rule($context, 'ExamplesTable'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); - return 12; + return 31; } - if ($self->match_ScenarioOutlineLine($context, $token)) { - $self->_end_rule($context, 'Examples_Table'); + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'ExamplesTable'); $self->_end_rule($context, 'Examples'); - $self->_end_rule($context, 'Examples_Definition'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ExamplesDefinition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 26; + return 40; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 26; + return 40; } $token->detach; @@ -2290,8 +3457,8 @@ sub match_token_at_26 { my @args = ( $token, - ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 26 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0", + ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 40 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:3>ExamplesDefinition:1>Examples:2>ExamplesTable:0>#TableRow:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2299,19 +3466,19 @@ sub match_token_at_26 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 26; + return 40; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 -sub match_token_at_28 { +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 +sub match_token_at_42 { my ( $self, $token, $context ) = @_; if ($self->match_DocStringSeparator($context, $token)) { $self->_build($context, $token); - return 29; + return 43; } if ($self->match_Other($context, $token)) { $self->_build($context, $token); - return 28; + return 42; } $token->detach; @@ -2323,7 +3490,7 @@ sub match_token_at_28 { my @args = ( $token, ["#DocStringSeparator", "#Other"], #" - "State: 28 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0", + "State: 42 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2331,83 +3498,85 @@ sub match_token_at_28 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 28; + return 42; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 -sub match_token_at_29 { +# GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 +sub match_token_at_43 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_StepLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); $self->_start_rule($context, 'Step'); $self->_build($context, $token); - return 20; + return 34; } if ($self->match_TagLine($context, $token)) { if ($self->lookahead_0($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 22; + return 36; } } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); - return 11; + return 30; } if ($self->match_ExamplesLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); - $self->_start_rule($context, 'Examples_Definition'); + $self->_start_rule($context, 'ExamplesDefinition'); $self->_start_rule($context, 'Examples'); $self->_build($context, $token); - return 23; + return 37; } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); - return 12; + return 31; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); - $self->_end_rule($context, 'ScenarioOutline'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'Scenario'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 29; + return 43; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 29; + return 43; } $token->detach; @@ -2418,8 +3587,8 @@ sub match_token_at_29 { my @args = ( $token, - ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 29 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0", + ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 43 - GherkinDocument:0>Feature:3>Rule:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2427,20 +3596,128 @@ sub match_token_at_29 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 29; + return 43; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 -sub match_token_at_30 { +# GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 +sub match_token_at_44 { my ( $self, $token, $context ) = @_; if ($self->match_DocStringSeparator($context, $token)) { $self->_build($context, $token); - return 31; + return 45; } if ($self->match_Other($context, $token)) { + $self->_build($context, $token); + return 44; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#DocStringSeparator", "#Other"], #" + "State: 44 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 44; +} + +# GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 +sub match_token_at_45 { + my ( $self, $token, $context ) = @_; + if ($self->match_EOF($context, $token)) { + $self->_end_rule($context, 'DocString'); + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_end_rule($context, 'Feature'); + $self->_build($context, $token); + return 41; + } + if ($self->match_StepLine($context, $token)) { + $self->_end_rule($context, 'DocString'); + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'Step'); + $self->_build($context, $token); + return 28; + } + if ($self->match_TagLine($context, $token)) { + $self->_end_rule($context, 'DocString'); + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 30; } + if ($self->match_ScenarioLine($context, $token)) { + $self->_end_rule($context, 'DocString'); + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_start_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Scenario'); + $self->_build($context, $token); + return 31; + } + if ($self->match_RuleLine($context, $token)) { + $self->_end_rule($context, 'DocString'); + $self->_end_rule($context, 'Step'); + $self->_end_rule($context, 'Background'); + $self->_end_rule($context, 'Rule'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); + $self->_build($context, $token); + return 22; + } + if ($self->match_Comment($context, $token)) { + $self->_build($context, $token); + return 45; + } + if ($self->match_Empty($context, $token)) { + $self->_build($context, $token); + return 45; + } + + $token->detach; + + # Create the appropriate error + my $error_class = "Gherkin::Exceptions::" . ( + $token->is_eof ? 'UnexpectedEOF' : 'UnexpectedToken' ); + + my @args = ( + $token, + ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 45 - GherkinDocument:0>Feature:3>Rule:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0", + ); + + $error_class->throw( @args ) if $self->stop_at_first_error; + + eval {$error_class->throw( @args )}; + $self->add_error( $context, $@ ); + + return 45; +} + +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 +sub match_token_at_46 { + my ( $self, $token, $context ) = @_; + if ($self->match_DocStringSeparator($context, $token)) { + $self->_build($context, $token); + return 47; + } + if ($self->match_Other($context, $token)) { + $self->_build($context, $token); + return 46; + } $token->detach; @@ -2451,7 +3728,7 @@ sub match_token_at_30 { my @args = ( $token, ["#DocStringSeparator", "#Other"], #" - "State: 30 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0", + "State: 46 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2459,20 +3736,20 @@ sub match_token_at_30 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 30; + return 46; } -# GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 -sub match_token_at_31 { +# GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 +sub match_token_at_47 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_StepLine($context, $token)) { $self->_end_rule($context, 'DocString'); @@ -2481,43 +3758,61 @@ sub match_token_at_31 { $self->_build($context, $token); return 15; } + if ($self->match_TagLine($context, $token)) { + if ($self->lookahead_0($context, $token)) { + $self->_end_rule($context, 'DocString'); + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Tags'); + $self->_build($context, $token); + return 17; + } + } if ($self->match_TagLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; } + if ($self->match_ExamplesLine($context, $token)) { + $self->_end_rule($context, 'DocString'); + $self->_end_rule($context, 'Step'); + $self->_start_rule($context, 'ExamplesDefinition'); + $self->_start_rule($context, 'Examples'); + $self->_build($context, $token); + return 18; + } if ($self->match_ScenarioLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Scenario'); - $self->_end_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_end_rule($context, 'ScenarioDefinition'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 31; + return 47; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 31; + return 47; } $token->detach; @@ -2528,8 +3823,8 @@ sub match_token_at_31 { my @args = ( $token, - ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 31 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0", + ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 47 - GherkinDocument:0>Feature:2>ScenarioDefinition:1>Scenario:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2537,19 +3832,19 @@ sub match_token_at_31 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 31; + return 47; } -# GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 -sub match_token_at_32 { +# GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0 +sub match_token_at_48 { my ( $self, $token, $context ) = @_; if ($self->match_DocStringSeparator($context, $token)) { $self->_build($context, $token); - return 33; + return 49; } if ($self->match_Other($context, $token)) { $self->_build($context, $token); - return 32; + return 48; } $token->detach; @@ -2561,7 +3856,7 @@ sub match_token_at_32 { my @args = ( $token, ["#DocStringSeparator", "#Other"], #" - "State: 32 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0", + "State: 48 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:0>#DocStringSeparator:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2569,11 +3864,11 @@ sub match_token_at_32 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 32; + return 48; } -# GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 -sub match_token_at_33 { +# GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0 +sub match_token_at_49 { my ( $self, $token, $context ) = @_; if ($self->match_EOF($context, $token)) { $self->_end_rule($context, 'DocString'); @@ -2581,7 +3876,7 @@ sub match_token_at_33 { $self->_end_rule($context, 'Background'); $self->_end_rule($context, 'Feature'); $self->_build($context, $token); - return 27; + return 41; } if ($self->match_StepLine($context, $token)) { $self->_end_rule($context, 'DocString'); @@ -2594,7 +3889,7 @@ sub match_token_at_33 { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Tags'); $self->_build($context, $token); return 11; @@ -2603,27 +3898,27 @@ sub match_token_at_33 { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); + $self->_start_rule($context, 'ScenarioDefinition'); $self->_start_rule($context, 'Scenario'); $self->_build($context, $token); return 12; } - if ($self->match_ScenarioOutlineLine($context, $token)) { + if ($self->match_RuleLine($context, $token)) { $self->_end_rule($context, 'DocString'); $self->_end_rule($context, 'Step'); $self->_end_rule($context, 'Background'); - $self->_start_rule($context, 'Scenario_Definition'); - $self->_start_rule($context, 'ScenarioOutline'); + $self->_start_rule($context, 'Rule'); + $self->_start_rule($context, 'RuleHeader'); $self->_build($context, $token); - return 17; + return 22; } if ($self->match_Comment($context, $token)) { $self->_build($context, $token); - return 33; + return 49; } if ($self->match_Empty($context, $token)) { $self->_build($context, $token); - return 33; + return 49; } $token->detach; @@ -2634,8 +3929,8 @@ sub match_token_at_33 { my @args = ( $token, - ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"], #" - "State: 33 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0", + ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#RuleLine", "#Comment", "#Empty"], #" + "State: 49 - GherkinDocument:0>Feature:1>Background:2>Step:1>StepArg:0>__alt0:1>DocString:2>#DocStringSeparator:0", ); $error_class->throw( @args ) if $self->stop_at_first_error; @@ -2643,7 +3938,7 @@ sub match_token_at_33 { eval {$error_class->throw( @args )}; $self->add_error( $context, $@ ); - return 33; + return 49; } diff --git a/gherkin/perl/lib/Gherkin/TokenMatcher.pm b/gherkin/perl/lib/Gherkin/TokenMatcher.pm index 3ba6d6df50..21135a4d15 100644 --- a/gherkin/perl/lib/Gherkin/TokenMatcher.pm +++ b/gherkin/perl/lib/Gherkin/TokenMatcher.pm @@ -36,16 +36,20 @@ sub match_FeatureLine { $self->_match_title_line( $token, FeatureLine => $self->dialect->Feature ); } -sub match_ScenarioLine { +sub match_RuleLine { my ( $self, $token ) = @_; $self->_match_title_line( $token, - ScenarioLine => $self->dialect->Scenario ); + RuleLine => $self->dialect->Rule ); } -sub match_ScenarioOutlineLine { +sub match_ScenarioLine { my ( $self, $token ) = @_; - $self->_match_title_line( $token, - ScenarioOutlineLine => $self->dialect->ScenarioOutline ); + $self->_match_title_line( + $token, + ScenarioLine => $self->dialect->Scenario ) + or $self->_match_title_line( + $token, + ScenarioLine => $self->dialect->ScenarioOutline );; } sub match_BackgroundLine { From 440f1d8035cbf241db96cf2761f21c357203d341 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Sun, 27 Dec 2020 22:45:02 +0100 Subject: [PATCH 2/5] Fix new scenarios in tokenizer tests --- gherkin/perl/lib/Gherkin/Line.pm | 17 ++++++----------- gherkin/perl/lib/Gherkin/TokenMatcher.pm | 3 ++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/gherkin/perl/lib/Gherkin/Line.pm b/gherkin/perl/lib/Gherkin/Line.pm index d4a9e47cd9..e4c057d186 100644 --- a/gherkin/perl/lib/Gherkin/Line.pm +++ b/gherkin/perl/lib/Gherkin/Line.pm @@ -86,15 +86,7 @@ sub _split_table_cells_iterator { } elsif ( $char eq "\\" ) { $row =~ s/^(.)// || die "Unpossible"; $col += 1; - $char = $1; - if ( $char eq 'n' ) { - $cell .= "\n"; - } else { - if ( $char ne '|' && $char ne '\\' ) { - $cell .= '\\'; - } - $cell .= $char; - } + $cell .= '\\' . $1; } elsif ( defined $char ) { $cell .= $char; } else { @@ -104,6 +96,8 @@ sub _split_table_cells_iterator { } } +my %unescape_map = ( '\\\\' => '\\', '\\|' => '|', '\\n' => "\n" ); + sub table_cells { my ($self) = @_; my $cells = []; @@ -119,7 +113,8 @@ sub table_cells { my $stripped_cell = $cell; $stripped_cell =~ s/^\s+//; my $cell_indent = length($cell) - length($stripped_cell); - $stripped_cell =~ s/\s*$//; + $stripped_cell =~ s/\s+$//; + $stripped_cell =~ s/(\\\\|\\\||\\n)/$unescape_map{$1}/g; push( @$cells, { @@ -136,7 +131,7 @@ sub tags { my $self = shift; my $column = $self->indent + 1; my $items_line = $self->_trimmed_line_text; - $items_line =~ s/\s+$//; + $items_line =~ s/\s+(#.*)?$//; my @tags; my @items = split( /@/, $items_line ); diff --git a/gherkin/perl/lib/Gherkin/TokenMatcher.pm b/gherkin/perl/lib/Gherkin/TokenMatcher.pm index 21135a4d15..211df63f93 100644 --- a/gherkin/perl/lib/Gherkin/TokenMatcher.pm +++ b/gherkin/perl/lib/Gherkin/TokenMatcher.pm @@ -167,6 +167,7 @@ sub _unescaped_docstring { my ( $self, $text ) = @_; if ( $self->_active_doc_string_separator ) { $text =~ s!\\"\\"\\"!"""!; + $text =~ s!\\`\\`\\`!```!; return $text; } else { return $text; @@ -214,7 +215,7 @@ sub _match_DocStringSeparator { } $self->_set_token_matched( $token, - DocStringSeparator => { text => $content_type } ); + DocStringSeparator => { text => $content_type, keyword => $separator } ); } sub match_TableRow { From 5859e2ced088b24dbc4c41afe534e09a66bdcd00 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Mon, 28 Dec 2020 00:50:56 +0100 Subject: [PATCH 3/5] Fix the AST builder for the changes in the grammar Some tokens have their underscores stripped. Nesting of the elements in the result document is different from before and there's now a Rule element to be supported. --- gherkin/perl/bin/gherkin-generate-ast | 5 +- gherkin/perl/lib/Gherkin/AstBuilder.pm | 201 +++++++++++++++---------- 2 files changed, 122 insertions(+), 84 deletions(-) diff --git a/gherkin/perl/bin/gherkin-generate-ast b/gherkin/perl/bin/gherkin-generate-ast index 4059396338..f099e5a8c9 100755 --- a/gherkin/perl/bin/gherkin-generate-ast +++ b/gherkin/perl/bin/gherkin-generate-ast @@ -18,10 +18,9 @@ sub run { for my $file (@file_list) { my $gherkin_document = $parser->parse($file); + $gherkin_document->{uri} = $file; my $event = { - type => 'gherkin-document', - uri => $file, - document => $gherkin_document + gherkinDocument => $gherkin_document, }; print $fh $json->encode( $event ); print "\n" diff --git a/gherkin/perl/lib/Gherkin/AstBuilder.pm b/gherkin/perl/lib/Gherkin/AstBuilder.pm index f69a3d93b6..ed58e7b707 100644 --- a/gherkin/perl/lib/Gherkin/AstBuilder.pm +++ b/gherkin/perl/lib/Gherkin/AstBuilder.pm @@ -2,6 +2,7 @@ package Gherkin::AstBuilder; use strict; use warnings; +use Scalar::Util qw(reftype); use Gherkin::Exceptions; use Gherkin::AstNode; @@ -11,6 +12,7 @@ sub new { my $self = bless { stack => [], comments => [], + id => 0, }, $class; $self->reset; return $self; @@ -23,6 +25,7 @@ sub reset { my $self = shift; $self->{'stack'} = [ ast_node('None') ]; $self->{'comments'} = []; + $self->{'id'} = 0; } sub current_node { @@ -47,7 +50,6 @@ sub build { push( @{ $self->{'comments'} }, { - type => 'Comment', location => $self->get_location($token), text => $token->matched_text } @@ -89,7 +91,7 @@ sub get_tags { push( @tags, { - type => 'Tag', + id => $self->next_id, location => $self->get_location( $token, $item->{'column'} ), name => $item->{'text'} @@ -109,7 +111,7 @@ sub get_table_rows { push( @rows, { - type => 'TableRow', + id => $self->next_id, location => $self->get_location($token), cells => $self->get_cells($token) } @@ -143,13 +145,13 @@ sub get_cells { for my $cell_item ( @{ $table_row_token->matched_items } ) { push( @cells, - { - type => 'TableCell', - location => $self->get_location( - $table_row_token, $cell_item->{'column'} - ), - value => $cell_item->{'text'} - } + $self->reject_nones( + { + location => $self->get_location( + $table_row_token, $cell_item->{'column'} + ), + value => $cell_item->{'text'} + }) ); } @@ -165,50 +167,69 @@ sub reject_nones { my $defined_only = {}; for my $key ( keys %$values ) { my $value = $values->{$key}; - $defined_only->{$key} = $value if defined $value; + if (defined $value) { + if (ref $value) { + if (reftype $value eq 'ARRAY') { + $defined_only->{$key} = $value + if (scalar(@$value) > 0); + } + else { + $defined_only->{$key} = $value; + } + } + elsif (not ref $value) { + $defined_only->{$key} = $value + unless "$value" eq ''; + } + } } return $defined_only; } +sub next_id { + my $self = shift; + my $id = $self->{'id'}++; + return "$id"; +} + sub transform_node { my ( $self, $node ) = @_; + if ( $node->rule_type eq 'Step' ) { - my $step_line = $node->get_token('StepLine'); - my $step_argument = - $node->get_single('DataTable') - || $node->get_single('DocString') - || undef; + my $step_line = $node->get_token('StepLine'); + my $data_table = $node->get_single('DataTable') || undef; + my $doc_string = $node->get_single('DocString') || undef; return $self->reject_nones( { - type => $node->rule_type, - location => $self->get_location($step_line), - keyword => $step_line->matched_keyword, - text => $step_line->matched_text, - argument => $step_argument + id => $self->next_id, + location => $self->get_location($step_line), + keyword => $step_line->matched_keyword, + text => $step_line->matched_text, + docString => $doc_string, + dataTable => $data_table, } ); } elsif ( $node->rule_type eq 'DocString' ) { my $separator_token = $node->get_tokens('DocStringSeparator')->[0]; - my $content_type = $separator_token->matched_text; - $content_type = undef if length $content_type < 1; - my $line_tokens = $node->get_tokens('Other'); + my $media_type = $separator_token->matched_text; + my $delimiter = $separator_token->matched_keyword; + my $line_tokens = $node->get_tokens('Other'); my $content = join( "\n", map { $_->matched_text } @$line_tokens ); return $self->reject_nones( { - type => $node->rule_type, location => $self->get_location($separator_token), - contentType => $content_type, - content => $content + content => $content, + mediaType => $media_type, + delimiter => $delimiter } ); } elsif ( $node->rule_type eq 'DataTable' ) { my $rows = $self->get_table_rows($node); return $self->reject_nones( { - type => $node->rule_type, location => $rows->[0]->{'location'}, rows => $rows } @@ -220,7 +241,7 @@ sub transform_node { return $self->reject_nones( { - type => $node->rule_type, + id => $self->next_id, location => $self->get_location($background_line), keyword => $background_line->matched_keyword, name => $background_line->matched_text, @@ -228,59 +249,71 @@ sub transform_node { steps => $steps } ); - } elsif ( $node->rule_type eq 'Scenario_Definition' ) { + } elsif ( $node->rule_type eq 'ScenarioDefinition' ) { my $tags = $self->get_tags($node); my $scenario_node = $node->get_single('Scenario'); - if ($scenario_node) { - my $scenario_line = $scenario_node->get_token('ScenarioLine'); - my $description = $self->get_description($scenario_node); - my $steps = $self->get_steps($scenario_node); + my $scenario_line = $scenario_node->get_token('ScenarioLine'); + my $description = $self->get_description($scenario_node); + my $steps = $self->get_steps($scenario_node); + my $examples = $scenario_node->get_items('ExamplesDefinition'); - return $self->reject_nones( - { - type => $scenario_node->rule_type, - tags => $tags, - location => $self->get_location($scenario_line), - keyword => $scenario_line->matched_keyword, - name => $scenario_line->matched_text, - description => $description, - steps => $steps - } - ); - } else { - my $scenario_outline_node = $node->get_single('ScenarioOutline'); - - die "Internal grammar error" unless $scenario_outline_node; - my $scenario_outline_line = - $scenario_outline_node->get_token('ScenarioOutlineLine'); - my $description = $self->get_description($scenario_outline_node); - my $steps = $self->get_steps($scenario_outline_node); - my $examples = - $scenario_outline_node->get_items('Examples_Definition'); - - return $self->reject_nones( - { - type => $scenario_outline_node->rule_type, - tags => $tags, - location => $self->get_location($scenario_outline_line), - keyword => $scenario_outline_line->matched_keyword, - name => $scenario_outline_line->matched_text, - description => $description, - steps => $steps, - examples => $examples - } + return $self->reject_nones( + { + id => $self->next_id, + tags => $tags, + location => $self->get_location($scenario_line), + keyword => $scenario_line->matched_keyword, + name => $scenario_line->matched_text, + description => $description, + steps => $steps, + examples => $examples + } ); + } elsif ( $node->rule_type eq 'Rule' ) { + my $header = $node->get_single('RuleHeader'); + unless ($header) { + warn "Missing RuleHeader!"; + return; } - } elsif ( $node->rule_type eq 'Examples_Definition' ) { + my $rule_line = $header->get_token('RuleLine'); + unless ($rule_line) { + warn "Missing RuleLine"; + return; + } + my $tags = $self->get_tags($header); + + my $children = []; + my $background = $node->get_single('Background'); + if ( $background ) { + push( @{ $children }, { background => $background }) + } + for my $scenario_definition ( @{ $node->get_items('ScenarioDefinition') } ) { + push( @{ $children }, { scenario => $scenario_definition }) + } + + my $description = $self->get_description($header); + + return $self->reject_nones( + { + id => $self->next_id, + tags => $tags, + location => $self->get_location($rule_line), + keyword => $rule_line->matched_keyword, + name => $rule_line->matched_text, + description => $description, + children => $children + } + ); + } elsif ( $node->rule_type eq 'ExamplesDefinition' ) { my $tags = $self->get_tags($node); my $examples_node = $node->get_single('Examples'); my $examples_line = $examples_node->get_token('ExamplesLine'); my $description = $self->get_description($examples_node); - my $examples_table = $examples_node->get_single('Examples_Table'); + my $examples_table = $examples_node->get_single('ExamplesTable'); return $self->reject_nones( { - type => $examples_node->rule_type, + id => $self->next_id, tags => $tags, location => $self->get_location($examples_line), keyword => $examples_line->matched_keyword, @@ -290,7 +323,7 @@ sub transform_node { tableBody => $examples_table->{'tableBody'} || undef } ); - } elsif ( $node->rule_type eq 'Examples_Table' ) { + } elsif ( $node->rule_type eq 'ExamplesTable' ) { my $rows = $self->get_table_rows($node); my $table_header = shift(@$rows) if $rows; @@ -310,27 +343,34 @@ sub transform_node { return join "\n", map { $_->matched_text } @description; } elsif ( $node->rule_type eq 'Feature' ) { - my $header = $node->get_single('Feature_Header'); - return unless $header; + my $header = $node->get_single('FeatureHeader'); + unless ($header) { + warn "Missing FeatureHeader!"; + return; + } my $feature_line = $header->get_token('FeatureLine'); - return unless $feature_line; + unless ($feature_line) { + warn "Missing FeatureLine"; + return; + } my $tags = $self->get_tags($header); my $children = []; my $background = $node->get_single('Background'); if ( $background ) { - push( @{ $children }, $background) + push( @{ $children }, { background => $background }) } - for my $scenario_definition ( @{ $node->get_items('Scenario_Definition') } ) { - push( @{ $children }, $scenario_definition) + for my $scenario_definition ( @{ $node->get_items('ScenarioDefinition') } ) { + push( @{ $children }, { scenario => $scenario_definition }) + } + for my $rule_definition ( @{ $node->get_items('Rule') } ) { + push( @{ $children }, { rule => $rule_definition }) } - my $description = $self->get_description($header); my $language = $feature_line->matched_gherkin_dialect; return $self->reject_nones( { - type => $node->rule_type, tags => $tags, location => $self->get_location($feature_line), language => $language, @@ -345,9 +385,8 @@ sub transform_node { return $self->reject_nones( { - type => $node->rule_type, feature => $feature, - comments => $self->{'comments'} + comments => $self->{'comments'}, } ); } else { From 8795a43965c2d60bf11f92480395379ea5977210 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Mon, 28 Dec 2020 14:38:47 +0100 Subject: [PATCH 4/5] Generate predictable ID and set 'uri' in gherkinDocument While at it, return a full AST instead of just the gherkinDocument content (which introduces the need to wrap of the return value later). --- gherkin/perl/bin/gherkin-generate-ast | 16 +++++----- gherkin/perl/bin/gherkin-generate-pickles | 14 ++++++--- gherkin/perl/gherkin-perl.razor | 7 ++--- gherkin/perl/lib/Gherkin/AstBuilder.pm | 31 ++++++++++++-------- gherkin/perl/lib/Gherkin/Generated/Parser.pm | 9 +++--- gherkin/perl/lib/Gherkin/ParserBase.pm | 7 +++-- 6 files changed, 48 insertions(+), 36 deletions(-) diff --git a/gherkin/perl/bin/gherkin-generate-ast b/gherkin/perl/bin/gherkin-generate-ast index f099e5a8c9..122950f431 100755 --- a/gherkin/perl/bin/gherkin-generate-ast +++ b/gherkin/perl/bin/gherkin-generate-ast @@ -11,18 +11,20 @@ package App::GherkinGenerateAst; sub run { my ($class, $fh, @file_list) = @_; + my $next_id = 0; my $json = Cpanel::JSON::XS->new->utf8->canonical; - my $parser = Gherkin::Parser->new(); + my $parser = Gherkin::Parser->new( + Gherkin::AstBuilder->new( + sub { + my $id = $next_id++; + return "$id"; + }) + ); for my $file (@file_list) { - my $gherkin_document = $parser->parse($file); - $gherkin_document->{uri} = $file; - my $event = { - gherkinDocument => $gherkin_document, - }; - print $fh $json->encode( $event ); + print $fh $json->encode( $parser->parse($file, $file) ); print "\n" } diff --git a/gherkin/perl/bin/gherkin-generate-pickles b/gherkin/perl/bin/gherkin-generate-pickles index 27c45e46fc..f426d954ed 100755 --- a/gherkin/perl/bin/gherkin-generate-pickles +++ b/gherkin/perl/bin/gherkin-generate-pickles @@ -15,16 +15,22 @@ sub run { my ( $class, $fh, @file_list ) = @_; my $json = Cpanel::JSON::XS->new->utf8->canonical; - my $parser = Gherkin::Parser->new(); + my $next_id = 0; + my $id_generator = + sub { + my $id = $next_id++; + return "$id"; + }; + my $parser = Gherkin::Parser->new( + Gherkin::AstBuilder->new($id_generator) + ); for my $file (@file_list) { my $pickles = Gherkin::Pickles::Compiler->compile( - $parser->parse($file) + $parser->parse($file, $file), $id_generator ); for my $pickle (@$pickles) { my $event = { - type => 'pickle', - uri => $file, pickle => $pickle }; print $fh $json->encode($event); diff --git a/gherkin/perl/gherkin-perl.razor b/gherkin/perl/gherkin-perl.razor index 27937b8d1e..4dc980ebf7 100644 --- a/gherkin/perl/gherkin-perl.razor +++ b/gherkin/perl/gherkin-perl.razor @@ -59,19 +59,18 @@ our %states_to_match_names = ( ); sub parse { - my ( $self, $token_scanner, $token_matcher ) = @@_; + my ( $self, $token_scanner, $uri ) = @@_; - $token_matcher ||= Gherkin::TokenMatcher->new(); $token_scanner = Gherkin::TokenScanner->new($token_scanner) unless ref $token_scanner && (ref $token_scanner ne 'SCALAR'); - $self->ast_builder->reset(); + $self->ast_builder->reset($uri); $token_matcher->reset(); my $context = Gherkin::ParserContext->new( { token_scanner => $token_scanner, - token_matcher => $token_matcher, + token_matcher => $self->token_matcher, } ); diff --git a/gherkin/perl/lib/Gherkin/AstBuilder.pm b/gherkin/perl/lib/Gherkin/AstBuilder.pm index ed58e7b707..fca756d677 100644 --- a/gherkin/perl/lib/Gherkin/AstBuilder.pm +++ b/gherkin/perl/lib/Gherkin/AstBuilder.pm @@ -9,10 +9,13 @@ use Gherkin::AstNode; sub new { my $class = shift; + my ($id_generator) = @_; + my $self = bless { - stack => [], - comments => [], - id => 0, + stack => [], + comments => [], + id_generator => $id_generator, + uri => '', }, $class; $self->reset; return $self; @@ -22,10 +25,11 @@ sub new { sub ast_node { Gherkin::AstNode->new( $_[0] ) } sub reset { - my $self = shift; + my $self = shift; + my ($uri) = @_; $self->{'stack'} = [ ast_node('None') ]; $self->{'comments'} = []; - $self->{'id'} = 0; + $self->{'uri'} = $uri; } sub current_node { @@ -189,8 +193,7 @@ sub reject_nones { sub next_id { my $self = shift; - my $id = $self->{'id'}++; - return "$id"; + return $self->{'id_generator'}->(); } sub transform_node { @@ -383,12 +386,14 @@ sub transform_node { } elsif ( $node->rule_type eq 'GherkinDocument' ) { my $feature = $node->get_single('Feature'); - return $self->reject_nones( - { - feature => $feature, - comments => $self->{'comments'}, - } - ); + return { + gherkinDocument => $self->reject_nones( + { + uri => $self->{'uri'}, + feature => $feature, + comments => $self->{'comments'}, + }) + }; } else { return $node; } diff --git a/gherkin/perl/lib/Gherkin/Generated/Parser.pm b/gherkin/perl/lib/Gherkin/Generated/Parser.pm index 616aea5bee..664d7d3308 100644 --- a/gherkin/perl/lib/Gherkin/Generated/Parser.pm +++ b/gherkin/perl/lib/Gherkin/Generated/Parser.pm @@ -95,19 +95,18 @@ our %states_to_match_names = ( ); sub parse { - my ( $self, $token_scanner, $token_matcher ) = @_; + my ( $self, $token_scanner, $uri ) = @_; - $token_matcher ||= Gherkin::TokenMatcher->new(); $token_scanner = Gherkin::TokenScanner->new($token_scanner) unless ref $token_scanner && (ref $token_scanner ne 'SCALAR'); - $self->ast_builder->reset(); - $token_matcher->reset(); + $self->ast_builder->reset($uri); + $self->token_matcher->reset(); my $context = Gherkin::ParserContext->new( { token_scanner => $token_scanner, - token_matcher => $token_matcher, + token_matcher => $self->token_matcher, } ); diff --git a/gherkin/perl/lib/Gherkin/ParserBase.pm b/gherkin/perl/lib/Gherkin/ParserBase.pm index 2799b5b66f..fb3f54f799 100644 --- a/gherkin/perl/lib/Gherkin/ParserBase.pm +++ b/gherkin/perl/lib/Gherkin/ParserBase.pm @@ -4,7 +4,7 @@ use strict; use warnings; use Class::XSAccessor accessors => - [ qw/ast_builder stop_at_first_error max_errors/, ]; + [ qw/ast_builder token_matcher stop_at_first_error max_errors/, ]; use Gherkin::ParserContext; use Gherkin::Exceptions; @@ -14,9 +14,10 @@ use Gherkin::TokenMatcher; use Gherkin::TokenScanner; sub new { - my ( $class, $ast_builder ) = @_; + my ( $class, $ast_builder, $token_matcher ) = @_; bless { - ast_builder => $ast_builder || Gherkin::AstBuilder->new(), + ast_builder => $ast_builder, + token_matcher => $token_matcher || Gherkin::TokenMatcher->new(), stop_at_first_error => 0, max_errors => 10, }, From f3781ec57fb4b26ef1c486175bc6e92639ad150a Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Mon, 28 Dec 2020 14:55:02 +0100 Subject: [PATCH 5/5] Include Rule support and the new AST structure in Pickle generation --- gherkin/perl/bin/gherkin-generate-pickles | 5 +- gherkin/perl/lib/Gherkin/Pickles/Compiler.pm | 307 ++++++++++--------- 2 files changed, 159 insertions(+), 153 deletions(-) diff --git a/gherkin/perl/bin/gherkin-generate-pickles b/gherkin/perl/bin/gherkin-generate-pickles index f426d954ed..231a9d5452 100755 --- a/gherkin/perl/bin/gherkin-generate-pickles +++ b/gherkin/perl/bin/gherkin-generate-pickles @@ -30,10 +30,7 @@ sub run { $parser->parse($file, $file), $id_generator ); for my $pickle (@$pickles) { - my $event = { - pickle => $pickle - }; - print $fh $json->encode($event); + print $fh $json->encode($pickle); print "\n" } } diff --git a/gherkin/perl/lib/Gherkin/Pickles/Compiler.pm b/gherkin/perl/lib/Gherkin/Pickles/Compiler.pm index c1e0dbec7c..21abcb50af 100644 --- a/gherkin/perl/lib/Gherkin/Pickles/Compiler.pm +++ b/gherkin/perl/lib/Gherkin/Pickles/Compiler.pm @@ -2,26 +2,36 @@ package Gherkin::Pickles::Compiler; use strict; use warnings; +use Scalar::Util qw(reftype); sub compile { - my ( $class, $gherkin_document ) = @_; + my ( $class, $gherkin_document, $id_generator ) = @_; my @pickles; - my $feature = $gherkin_document->{'feature'}; + my $feature = $gherkin_document->{'gherkinDocument'}->{'feature'}; my $language = $feature->{'language'}; my $feature_tags = $feature->{'tags'}; my $background_steps = []; - for my $scenario_definition ( @{ $feature->{'children'} } ) { - my @args = ( - $feature_tags, $background_steps, $scenario_definition, $language, \@pickles - ); - if ( $scenario_definition->{'type'} eq 'Background' ) { - $background_steps = $class->_pickle_steps($scenario_definition) - } elsif ( $scenario_definition->{'type'} eq 'Scenario' ) { - $class->_compile_scenario(@args); + for my $child ( @{ $feature->{'children'} } ) { + if ( $child->{'background'} ) { + $background_steps = $child->{'background'}->{'steps'}; + } elsif ( $child->{'scenario'} ) { + $class->_compile_scenario( + $gherkin_document->{'gherkinDocument'}->{'uri'}, + $feature_tags, $background_steps, + $child->{'scenario'}, $language, $id_generator, + \@pickles + ); + } elsif ( $child->{'rule'} ) { + $class->_compile_rule( + $gherkin_document->{'gherkinDocument'}->{'uri'}, + $feature_tags, $background_steps, + $child->{'rule'}, $language, $id_generator, + \@pickles + ); } else { - $class->_compile_scenario_outline(@args); + ...; } } @@ -29,156 +39,169 @@ sub compile { } sub _pickle_steps { - my ( $class, $scenario_definition ) = @_; - my @steps = map { $class->_pickle_step( $_ ) } - @{ $scenario_definition->{'steps'} }; - return \@steps; + my ( $class, $steps, $id_generator ) = @_; + return [ map { $class->_pickle_step( $_, $id_generator ) } @$steps ]; } -sub _compile_scenario { - my ( $class, $feature_tags, $background_steps, $scenario, $language, $pickles ) - = @_; - - my $array_reference = $scenario->{'steps'}; - my @actual_array = @$array_reference; - my $array_size = @actual_array; - - my @tags = ( @$feature_tags, @{ $scenario->{'tags'} || [] } ); - - my @steps; - if ($array_size > 0) { - @steps = ( - @$background_steps, - map { $class->_pickle_step( $_ ) } - @{ $scenario->{'steps'} || [] } - ); - } +sub reject_nones { + my ( $values ) = @_; + + return [ grep { defined $_ } @$values ] + if reftype $values eq 'ARRAY'; - push( - @$pickles, - { - tags => $class->_pickle_tags( \@tags ), - language => $language, - name => $scenario->{'name'}, - locations => - [ $class->_pickle_location( $scenario->{'location'} ) ], - steps => \@steps, + my $defined_only = {}; + for my $key ( keys %$values ) { + my $value = $values->{$key}; + if (defined $value) { + if (ref $value) { + if (reftype $value eq 'ARRAY') { + $defined_only->{$key} = $value + if (scalar(@$value) > 0); + } + else { + $defined_only->{$key} = $value; + } + } + elsif (not ref $value) { + $defined_only->{$key} = $value + unless "$value" eq ''; + } } - ); -} + } -sub _compile_scenario_outline { - my ( $class, $feature_tags, $background_steps, $scenario_outline, $language, $pickles ) - = @_; + return $defined_only; +} - my $array_reference = $scenario_outline->{'steps'}; - my @actual_array = @$array_reference; - my $array_size = @actual_array; +sub _compile_scenario { + my ( $class, $uri, $feature_tags, $background_steps, + $scenario, $language, $id_generator, $pickles ) + = @_; - for my $examples ( @{ $scenario_outline->{'examples'} || [] } ) { + for my $examples ( @{ $scenario->{'examples'} || + [ { tableHeader => {}, + tableBody => [ { cells => [] } ]} ] } ) { my $variable_cells = $examples->{'tableHeader'}->{'cells'}; for my $values ( @{ $examples->{'tableBody'} || [] } ) { my $value_cells = $values->{'cells'}; my @tags = ( - @$feature_tags, - @{ $scenario_outline->{'tags'} || [] }, + @{ $feature_tags || [] }, + @{ $scenario->{'tags'} || [] }, @{ $examples->{'tags'} || [] } ); my @steps; - if ($array_size > 0) { - @steps = @$background_steps; - } - - for my $scenario_outline_step ( @{ $scenario_outline->{'steps'} } ) - { - my $step_text = - $class->_interpolate( $scenario_outline_step->{'text'}, - $variable_cells, $value_cells, ); - my $arguments = - $class->_create_pickle_arguments( - $scenario_outline_step->{'argument'}, - $variable_cells, $value_cells, ); - push( - @steps, - { - text => $step_text, - arguments => $arguments, - locations => [ - $class->_pickle_location( - $values->{'location'} - ), - $class->_pickle_step_location( - $scenario_outline_step - ), - ] - } - ); + if ($scenario->{'steps'} and @{ $scenario->{'steps'} }) { + @steps = @{ $class->_pickle_steps($background_steps, + $id_generator) }; + for my $step (@{ $scenario->{'steps'} } ) + { + my $step_text = + $class->_interpolate( $step->{'text'}, + $variable_cells, $value_cells, ); + my $arguments = + $class->_create_pickle_arguments( + $step, + $variable_cells, $value_cells, ); + push( + @steps, + reject_nones( + { + id => $id_generator->(), + text => $step_text, + argument => $arguments, + astNodeIds => reject_nones( + [ + $step->{'id'}, + $values->{'id'} + ]), + }) + ); + } } push( @$pickles, { - name => - $class->_interpolate( - $scenario_outline->{'name'}, $variable_cells, - $value_cells, - ), - language => $language, - steps => \@steps, - tags => $class->_pickle_tags( \@tags ), - locations => [ - $class->_pickle_location( - $values->{'location'} - ), - $class->_pickle_location( - $scenario_outline->{'location'} - ), - ], + pickle => + reject_nones( + { + id => $id_generator->(), + name => + $class->_interpolate( + $scenario->{'name'}, $variable_cells, + $value_cells, + ), + language => $language, + steps => \@steps, + tags => $class->_pickle_tags( \@tags ), + uri => $uri, + astNodeIds=> reject_nones( + [ + $scenario->{'id'}, + $values->{'id'} + ]) + }) } ); } } } +sub _compile_rule { + my ( $class, $uri, $feature_tags, $feature_background_steps, + $rule_definition, $language, $id_generator, $pickles ) + = @_; + my $background_steps = $feature_background_steps; + + for my $child ( @{ $rule_definition->{'children'} } ) { + if ( $child->{'background'} ) { + $background_steps = + [ @$feature_background_steps, + @{ $child->{'background'}->{'steps'} } ]; + } elsif ( $child->{'scenario'} ) { + $class->_compile_scenario( + $uri, $feature_tags, $background_steps, + $child->{'scenario'}, $language, $id_generator, + $pickles + ); + } else { + ...; + } + } +} + sub _create_pickle_arguments { my ( $class, $argument, $variables, $values ) = @_; - my $result = []; - - return $result unless $argument; - if ( $argument->{'type'} eq 'DataTable' ) { + if ( $argument->{'dataTable'} ) { + my $data = $argument->{'dataTable'}; my $table = { rows => [] }; - for my $row ( @{ $argument->{'rows'} || [] } ) { + for my $row ( @{ $data->{'rows'} || [] } ) { my @cells = map { - { - location => - $class->_pickle_location( $_->{'location'} ), - value => $class->_interpolate( - $_->{'value'}, $variables, $values - ) - } + reject_nones( + { + value => $class->_interpolate($_->{'value'}, + $variables, $values) + }) } @{ $row->{'cells'} || [] }; push( @{ $table->{'rows'} }, { cells => \@cells } ); } - push( @$result, $table ); - } elsif ( $argument->{'type'} eq 'DocString' ) { - my $docstring = { - location => $class->_pickle_location( $argument->{'location'} ), - content => $class->_interpolate($argument->{'content'}, $variables, $values), + return { + dataTable => $table + }; + } elsif ( $argument->{'docString'} ) { + my $docstring = $argument->{'docString'}; + return { + docString => reject_nones({ + mediaType => $class->_interpolate($docstring->{'mediaType'}, + $variables, $values), + content => $class->_interpolate($docstring->{'content'}, + $variables, $values) + }) }; - if(defined $argument->{'contentType'}){ - $docstring->{'contentType'} = $class->_interpolate($argument->{'contentType'}, $variables, $values) - } - push( - @$result, - $docstring - ); - } else { - die "Internal error"; } - return $result; + return undef; } sub _interpolate { @@ -187,38 +210,24 @@ sub _interpolate { for my $variable_cell ( @{ $variable_cells || [] } ) { my $from = '<' . $variable_cell->{'value'} . '>'; my $to = $value_cells->[ $n++ ]->{'value'}; - $name =~ s/$from/$to/g; + $name =~ s/$from/$to/g if $name; } return $name; } sub _pickle_step { - my ( $class, $step ) = @_; + my ( $class, $step, $id_generator ) = @_; - return { + return reject_nones({ text => $step->{'text'}, - arguments => + id => $id_generator->(), + astNodeIds => [ + $step->{'id'} + ], + argument => $class->_create_pickle_arguments( $step->{'argument'}, [], [], ), - locations => [ $class->_pickle_step_location( $step ) ], - }; -} - -sub _pickle_step_location { - my ( $class, $step ) = @_; - return { - line => $step->{'location'}->{'line'}, - column => $step->{'location'}->{'column'} + - length( $step->{'keyword'} ), - }; -} - -sub _pickle_location { - my ( $class, $location ) = @_; - return { - line => $location->{'line'}, - column => $location->{'column'}, - }; + }); } sub _pickle_tags { @@ -229,8 +238,8 @@ sub _pickle_tags { sub _pickle_tag { my ( $class, $tag ) = @_; return { - name => $tag->{'name'}, - location => $class->_pickle_location( $tag->{'location'} ) + name => $tag->{'name'}, + astNodeId => $tag->{'id'} }; }