diff --git a/gherkin/c/include/pickle_string.h b/gherkin/c/include/pickle_string.h index 228498ed906..381253ebb43 100644 --- a/gherkin/c/include/pickle_string.h +++ b/gherkin/c/include/pickle_string.h @@ -13,10 +13,11 @@ extern "C" { typedef struct PickleString { PickleArgumentType type; PickleLocation location; + wchar_t* content_type; wchar_t* content; } PickleString; -const PickleString* PickleString_new(const wchar_t* content, int line, int column); +const PickleString* PickleString_new(const wchar_t* content, int line, int column, const wchar_t* content_type); void PickleString_delete(const PickleString* pickle_string); diff --git a/gherkin/c/src/compiler.c b/gherkin/c/src/compiler.c index 7b246b41125..f940a2e1fd5 100644 --- a/gherkin/c/src/compiler.c +++ b/gherkin/c/src/compiler.c @@ -140,12 +140,19 @@ static const PickleArgument* create_pickle_argument(const StepArgument* step_arg else if (step_argument->type == Gherkin_DocString) { const DocString* doc_string = (DocString*)step_argument; if (!example_header) { - argument = (const PickleArgument*)PickleString_new(doc_string->content, doc_string->location.line, doc_string->location.column); + argument = (const PickleArgument*)PickleString_new(doc_string->content, doc_string->location.line, doc_string->location.column, doc_string->content_type); } else { const wchar_t* expanded_text = create_expanded_text(doc_string->content, example_header, body_row); - argument = (const PickleArgument*)PickleString_new(expanded_text, doc_string->location.line, doc_string->location.column); + const wchar_t* expanded_content_type = 0; + if(doc_string->content_type){ + expanded_content_type = create_expanded_text(doc_string->content_type, example_header, body_row); + } + argument = (const PickleArgument*)PickleString_new(expanded_text, doc_string->location.line, doc_string->location.column, expanded_content_type); free((void*)expanded_text); + if(expanded_content_type != 0){ + free((void*)expanded_content_type); + } } } } diff --git a/gherkin/c/src/pickle_printer.c b/gherkin/c/src/pickle_printer.c index 9d7e90fc5b9..9a247c588a1 100644 --- a/gherkin/c/src/pickle_printer.c +++ b/gherkin/c/src/pickle_printer.c @@ -64,7 +64,13 @@ static void print_pickle_string(FILE* file, const PickleString* pickle_string) { if (pickle_string->content) { PrintUtilities_print_json_string(file, pickle_string->content); } - fprintf(file, "\"}"); + fprintf(file, "\""); + if(pickle_string->content_type) { + fprintf(file, ",\"contentType\":\""); + PrintUtilities_print_json_string(file, pickle_string->content_type); + fprintf(file, "\""); + } + fprintf(file, "}"); } static void print_tag(FILE* file, const PickleTag* tag) { diff --git a/gherkin/c/src/pickle_string.c b/gherkin/c/src/pickle_string.c index e6504e395e6..6305a5dc3df 100644 --- a/gherkin/c/src/pickle_string.c +++ b/gherkin/c/src/pickle_string.c @@ -2,7 +2,7 @@ #include "string_utilities.h" #include -const PickleString* PickleString_new(const wchar_t* content, int line, int column) { +const PickleString* PickleString_new(const wchar_t* content, int line, int column, const wchar_t* content_type) { PickleString* pickle_string = (PickleString*)malloc(sizeof(PickleString)); pickle_string->type = Argument_String; pickle_string->location.line = line; @@ -11,6 +11,10 @@ const PickleString* PickleString_new(const wchar_t* content, int line, int colum if (content) { pickle_string->content = StringUtilities_copy_string(content); } + pickle_string->content_type = 0; + if (content_type && wcslen(content_type) > 0) { + pickle_string->content_type = StringUtilities_copy_string(content_type); + } return pickle_string; } @@ -21,5 +25,8 @@ void PickleString_delete(const PickleString* pickle_string) { if (pickle_string->content) { free((void*)pickle_string->content); } + if (pickle_string->content_type) { + free((void*)pickle_string->content_type); + } free((void*)pickle_string); } diff --git a/gherkin/c/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/c/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/c/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/c/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/c/testdata/good/scenario_outline_with_docstring.feature b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/c/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/dotnet/Gherkin/Pickles/Compiler.cs b/gherkin/dotnet/Gherkin/Pickles/Compiler.cs index ef080df8fa8..59c086dfbbc 100644 --- a/gherkin/dotnet/Gherkin/Pickles/Compiler.cs +++ b/gherkin/dotnet/Gherkin/Pickles/Compiler.cs @@ -160,7 +160,8 @@ protected virtual List CreatePickleArguments(StepArgument argument, IE result.Add( new PickleString( PickleLocation(ds.Location), - Interpolate(ds.Content, variableCells, valueCells) + Interpolate(ds.Content, variableCells, valueCells), + ds.ContentType == null ? null : Interpolate(ds.ContentType, variableCells, valueCells) ) ); } else { diff --git a/gherkin/dotnet/Gherkin/Pickles/PickleString.cs b/gherkin/dotnet/Gherkin/Pickles/PickleString.cs index 54503489000..75a790a30ee 100644 --- a/gherkin/dotnet/Gherkin/Pickles/PickleString.cs +++ b/gherkin/dotnet/Gherkin/Pickles/PickleString.cs @@ -11,11 +11,14 @@ public override PickleLocation Location } public string Content { get; private set; } + + public string ContentType { get; private set; } - public PickleString(PickleLocation location, string content) + public PickleString(PickleLocation location, string content, string contentType = null) { this.location = location; Content = content; + ContentType = contentType; } } } diff --git a/gherkin/dotnet/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/dotnet/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/dotnet/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/dotnet/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/dotnet/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/go/pickles.go b/gherkin/go/pickles.go index 498a4eef343..aa5445164e8 100644 --- a/gherkin/go/pickles.go +++ b/gherkin/go/pickles.go @@ -15,8 +15,9 @@ type ( } PickleString struct { - Location Location `json:"location"` - Content string `json:"content"` + Location Location `json:"location"` + ContentType string `json:"contentType,omitempty"` + Content string `json:"content"` } PickleCell struct { @@ -171,8 +172,9 @@ func pickleArgument(arg interface{}, keys, vals []*TableCell) []Argument { switch t := arg.(type) { case *DocString: args = append(args, &PickleString{ - Location: *t.Location, - Content: trans(t.Content), + Location: *t.Location, + ContentType: trans(t.ContentType), + Content: trans(t.Content), }) case *DataTable: rows := make([]*PickleRow, len(t.Rows)) diff --git a/gherkin/go/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/go/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/go/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/go/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/go/testdata/good/scenario_outline_with_docstring.feature b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/go/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/java/src/main/java/gherkin/pickles/Compiler.java b/gherkin/java/src/main/java/gherkin/pickles/Compiler.java index 5193f615aeb..c1b23c3709f 100644 --- a/gherkin/java/src/main/java/gherkin/pickles/Compiler.java +++ b/gherkin/java/src/main/java/gherkin/pickles/Compiler.java @@ -152,7 +152,8 @@ private List createPickleArguments(Node argument, List vari result.add( new PickleString( pickleLocation(ds.getLocation()), - interpolate(ds.getContent(), variableCells, valueCells) + interpolate(ds.getContent(), variableCells, valueCells), + ds.getContentType() == null ? null : interpolate(ds.getContentType(), variableCells, valueCells) ) ); } else { diff --git a/gherkin/java/src/main/java/gherkin/pickles/PickleString.java b/gherkin/java/src/main/java/gherkin/pickles/PickleString.java index e1daa27863a..c3c1040393f 100644 --- a/gherkin/java/src/main/java/gherkin/pickles/PickleString.java +++ b/gherkin/java/src/main/java/gherkin/pickles/PickleString.java @@ -1,12 +1,20 @@ package gherkin.pickles; +import gherkin.deps.com.google.gson.annotations.SerializedName; + public class PickleString implements Argument { private final PickleLocation location; private final String content; + private final String contentType; - public PickleString(PickleLocation location, String content) { + public PickleString(PickleLocation location, String content, String contentType) { this.location = location; this.content = content; + this.contentType = contentType; + } + + public PickleString(PickleLocation location, String content) { + this(location, content, null); } @Override @@ -17,4 +25,8 @@ public PickleLocation getLocation() { public String getContent() { return content; } + + public String getContentType() { + return contentType; + } } diff --git a/gherkin/java/src/test/java/gherkin/ParserTest.java b/gherkin/java/src/test/java/gherkin/ParserTest.java index a17c1b97736..45049393aa3 100644 --- a/gherkin/java/src/test/java/gherkin/ParserTest.java +++ b/gherkin/java/src/test/java/gherkin/ParserTest.java @@ -3,8 +3,12 @@ import gherkin.ast.GherkinDocument; import gherkin.deps.com.google.gson.Gson; import gherkin.deps.com.google.gson.JsonParser; +import gherkin.pickles.Compiler; +import gherkin.pickles.Pickle; import org.junit.Test; +import java.util.List; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -87,4 +91,66 @@ public void change_default_language() throws Exception { jsonParser.parse(gson.toJson(gherkinDocument))); } + @Test + public void doc_string_content_type() throws Exception { + Gson gson = new Gson(); + JsonParser jsonParser = new JsonParser(); + String in1 = "" + + "Feature: Foo\n" + + " Scenario: Bar\n" + + " Given x\n" + + " \"\"\"json\n" + + " {}\n" + + " \"\"\""; + TokenMatcher matcher = new TokenMatcher(); + Parser parser = new Parser<>(new AstBuilder()); + + GherkinDocument gherkinDocument = parser.parse(in1, matcher); + + assertEquals( + jsonParser.parse("" + + "{\"feature\":{\"tags\":[]," + + " \"language\":\"en\"," + + " \"keyword\":\"Feature\"," + + " \"name\":\"Foo\"," + + " \"children\":[{" + + " \"tags\":[]," + + " \"keyword\":\"Scenario\"," + + " \"name\":\"Bar\"," + + " \"steps\":[{" + + " \"keyword\":\"Given \"," + + " \"text\":\"x\"," + + " \"argument\":{" + + " \"content\":\"{}\"," + + " \"type\":\"DocString\"," + + " \"location\":{\"line\":4,\"column\":7}," + + " \"contentType\":\"json\"}," + + " \"type\":\"Step\"," + + " \"location\":{\"line\":3,\"column\":5}}]," + + " \"type\":\"Scenario\"," + + " \"location\":{\"line\":2,\"column\":3}}]," + + " \"type\":\"Feature\"," + + " \"location\":{\"line\":1,\"column\":1}}," + + "\"comments\":[]," + + "\"type\":\"GherkinDocument\"}"), + jsonParser.parse(gson.toJson(gherkinDocument))); + + + Compiler compiler = new Compiler(); + List pickles = compiler.compile(gherkinDocument); + + assertEquals( jsonParser.parse("" + + "[{\"name\":\"Bar\",\"language\":\"en\"," + + " \"steps\":[{" + + " \"text\":\"x\"," + + " \"arguments\": [{" + + " \"location\":{\"line\":4,\"column\":7}," + + " \"content\":\"{}\",\"contentType\":\"json\"}]," + + " \"locations\":[{\"line\":3,\"column\":11}]}]," + + " \"tags\":[],\"locations\":[{\"line\":2,\"column\":3}]}]" ), + jsonParser.parse(gson.toJson(pickles)) + ); + + } + } diff --git a/gherkin/java/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/java/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/java/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/java/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/java/testdata/good/scenario_outline_with_docstring.feature b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/java/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/javascript/dist/gherkin.js b/gherkin/javascript/dist/gherkin.js index 3b99a2f95f0..445369662fa 100644 --- a/gherkin/javascript/dist/gherkin.js +++ b/gherkin/javascript/dist/gherkin.js @@ -6346,8 +6346,11 @@ function Compiler() { } else if (argument.type === 'DocString') { var docString = { location: pickleLocation(argument.location), - content: interpolate(argument.content, variableCells, valueCells) + content: interpolate(argument.content, variableCells, valueCells), }; + if(argument.contentType) { + docString.contentType = interpolate(argument.contentType, variableCells, valueCells); + } result.push(docString); } else { throw Error('Internal error'); diff --git a/gherkin/javascript/dist/gherkin.min.js b/gherkin/javascript/dist/gherkin.min.js index 63bb7a4bf08..12260550dfe 100644 --- a/gherkin/javascript/dist/gherkin.min.js +++ b/gherkin/javascript/dist/gherkin.min.js @@ -24,4 +24,4 @@ THE SOFTWARE. (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0?separatorToken.matchedText:undefined;var lineTokens=node.getTokens("Other");var content=lineTokens.map(function(t){return t.matchedText}).join("\n");var result={type:node.ruleType,location:getLocation(separatorToken),content:content};if(contentType){result.contentType=contentType}return result;case"DataTable":var rows=getTableRows(node);return{type:node.ruleType,location:rows[0].location,rows:rows};case"Background":var backgroundLine=node.getToken("BackgroundLine");var description=getDescription(node);var steps=getSteps(node);return{type:node.ruleType,location:getLocation(backgroundLine),keyword:backgroundLine.matchedKeyword,name:backgroundLine.matchedText,description:description,steps:steps};case"Scenario_Definition":var tags=getTags(node);var scenarioNode=node.getSingle("Scenario");if(scenarioNode){var scenarioLine=scenarioNode.getToken("ScenarioLine");var description=getDescription(scenarioNode);var steps=getSteps(scenarioNode);return{type:scenarioNode.ruleType,tags:tags,location:getLocation(scenarioLine),keyword:scenarioLine.matchedKeyword,name:scenarioLine.matchedText,description:description,steps:steps}}else{var scenarioOutlineNode=node.getSingle("ScenarioOutline");if(!scenarioOutlineNode)throw new Error("Internal grammar error");var scenarioOutlineLine=scenarioOutlineNode.getToken("ScenarioOutlineLine");var description=getDescription(scenarioOutlineNode);var steps=getSteps(scenarioOutlineNode);var examples=scenarioOutlineNode.getItems("Examples_Definition");return{type:scenarioOutlineNode.ruleType,tags:tags,location:getLocation(scenarioOutlineLine),keyword:scenarioOutlineLine.matchedKeyword,name:scenarioOutlineLine.matchedText,description:description,steps:steps,examples:examples}}case"Examples_Definition":var tags=getTags(node);var examplesNode=node.getSingle("Examples");var examplesLine=examplesNode.getToken("ExamplesLine");var description=getDescription(examplesNode);var exampleTable=examplesNode.getSingle("Examples_Table");return{type:examplesNode.ruleType,tags:tags,location:getLocation(examplesLine),keyword:examplesLine.matchedKeyword,name:examplesLine.matchedText,description:description,tableHeader:exampleTable!=undefined?exampleTable.tableHeader:undefined,tableBody:exampleTable!=undefined?exampleTable.tableBody:undefined};case"Examples_Table":var rows=getTableRows(node);return{tableHeader:rows!=undefined?rows[0]:undefined,tableBody:rows!=undefined?rows.slice(1):undefined};case"Description":var lineTokens=node.getTokens("Other");var end=lineTokens.length;while(end>0&&lineTokens[end-1].line.trimmedLineText===""){end--}lineTokens=lineTokens.slice(0,end);var description=lineTokens.map(function(token){return token.matchedText}).join("\n");return description;case"Feature":var header=node.getSingle("Feature_Header");if(!header)return null;var tags=getTags(header);var featureLine=header.getToken("FeatureLine");if(!featureLine)return null;var children=[];var background=node.getSingle("Background");if(background)children.push(background);children=children.concat(node.getItems("Scenario_Definition"));var description=getDescription(header);var language=featureLine.matchedGherkinDialect;return{type:node.ruleType,tags:tags,location:getLocation(featureLine),language:language,keyword:featureLine.matchedKeyword,name:featureLine.matchedText,description:description,children:children};case"GherkinDocument":var feature=node.getSingle("Feature");return{type:node.ruleType,feature:feature,comments:comments};default:return node}}}},{"./ast_node":3,"./errors":6}],3:[function(require,module,exports){function AstNode(ruleType){this.ruleType=ruleType;this._subItems={}}AstNode.prototype.add=function(ruleType,obj){var items=this._subItems[ruleType];if(items===undefined)this._subItems[ruleType]=items=[];items.push(obj)};AstNode.prototype.getSingle=function(ruleType){return(this._subItems[ruleType]||[])[0]};AstNode.prototype.getItems=function(ruleType){return this._subItems[ruleType]||[]};AstNode.prototype.getToken=function(tokenType){return this.getSingle(tokenType)};AstNode.prototype.getTokens=function(tokenType){return this._subItems[tokenType]||[]};module.exports=AstNode},{}],4:[function(require,module,exports){var regexAstralSymbols=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;module.exports=function countSymbols(string){return string.replace(regexAstralSymbols,"_").length}},{}],5:[function(require,module,exports){module.exports=require("./gherkin-languages.json")},{"./gherkin-languages.json":8}],6:[function(require,module,exports){var Errors={};["ParserException","CompositeParserException","UnexpectedTokenException","UnexpectedEOFException","AstBuilderException","NoSuchLanguageException"].forEach(function(name){function ErrorProto(message){this.message=message||"Unspecified "+name;if(Error.captureStackTrace){Error.captureStackTrace(this,arguments.callee)}}ErrorProto.prototype=Object.create(Error.prototype);ErrorProto.prototype.name=name;ErrorProto.prototype.constructor=ErrorProto;Errors[name]=ErrorProto});Errors.CompositeParserException.create=function(errors){var message="Parser errors:\n"+errors.map(function(e){return e.message}).join("\n");var err=new Errors.CompositeParserException(message);err.errors=errors;return err};Errors.UnexpectedTokenException.create=function(token,expectedTokenTypes,stateComment){var message="expected: "+expectedTokenTypes.join(", ")+", got '"+token.getTokenValue().trim()+"'";var location=!token.location.column?{line:token.location.line,column:token.line.indent+1}:token.location;return createError(Errors.UnexpectedEOFException,message,location)};Errors.UnexpectedEOFException.create=function(token,expectedTokenTypes,stateComment){var message="unexpected end of file, expected: "+expectedTokenTypes.join(", ");return createError(Errors.UnexpectedTokenException,message,token.location)};Errors.AstBuilderException.create=function(message,location){return createError(Errors.AstBuilderException,message,location)};Errors.NoSuchLanguageException.create=function(language,location){var message="Language not supported: "+language;return createError(Errors.NoSuchLanguageException,message,location)};function createError(Ctor,message,location){var fullMessage="("+location.line+":"+location.column+"): "+message;var error=new Ctor(fullMessage);error.location=location;return error}module.exports=Errors},{}],7:[function(require,module,exports){var Parser=require("./parser");var Compiler=require("./pickles/compiler");var compiler=new Compiler;var parser=new Parser;parser.stopAtFirstError=false;function generateEvents(data,uri,types,language){types=Object.assign({source:true,"gherkin-document":true,pickle:true},types||{});result=[];try{if(types["source"]){result.push({type:"source",uri:uri,data:data,media:{encoding:"utf-8",type:"text/x.cucumber.gherkin+plain"}})}if(!types["gherkin-document"]&&!types["pickle"])return result;var gherkinDocument=parser.parse(data,language);if(types["gherkin-document"]){result.push({type:"gherkin-document",uri:uri,document:gherkinDocument})}if(types["pickle"]){var pickles=compiler.compile(gherkinDocument);for(var p in pickles){result.push({type:"pickle",uri:uri,pickle:pickles[p]})}}}catch(err){var errors=err.errors||[err];for(var e in errors){result.push({type:"attachment",source:{uri:uri,start:{line:errors[e].location.line,column:errors[e].location.column}},data:errors[e].message,media:{encoding:"utf-8",type:"text/x.cucumber.stacktrace+plain"}})}}return result}module.exports=generateEvents},{"./parser":10,"./pickles/compiler":11}],8:[function(require,module,exports){module.exports={af:{and:["* ","En "],background:["Agtergrond"],but:["* ","Maar "],examples:["Voorbeelde"],feature:["Funksie","Besigheid Behoefte","Vermoë"],given:["* ","Gegewe "],name:"Afrikaans",native:"Afrikaans",scenario:["Situasie"],scenarioOutline:["Situasie Uiteensetting"],then:["* ","Dan "],when:["* ","Wanneer "]},am:{and:["* ","Եվ "],background:["Կոնտեքստ"],but:["* ","Բայց "],examples:["Օրինակներ"],feature:["Ֆունկցիոնալություն","Հատկություն"],given:["* ","Դիցուք "],name:"Armenian",native:"հայերեն",scenario:["Սցենար"],scenarioOutline:["Սցենարի կառուցվացքը"],then:["* ","Ապա "],when:["* ","Եթե ","Երբ "]},an:{and:["* ","Y ","E "],background:["Antecedents"],but:["* ","Pero "],examples:["Eixemplos"],feature:["Caracteristica"],given:["* ","Dau ","Dada ","Daus ","Dadas "],name:"Aragonese",native:"Aragonés",scenario:["Caso"],scenarioOutline:["Esquema del caso"],then:["* ","Alavez ","Allora ","Antonces "],when:["* ","Cuan "]},ar:{and:["* ","و "],background:["الخلفية"],but:["* ","لكن "],examples:["امثلة"],feature:["خاصية"],given:["* ","بفرض "],name:"Arabic",native:"العربية",scenario:["سيناريو"],scenarioOutline:["سيناريو مخطط"],then:["* ","اذاً ","ثم "],when:["* ","متى ","عندما "]},ast:{and:["* ","Y ","Ya "],background:["Antecedentes"],but:["* ","Peru "],examples:["Exemplos"],feature:["Carauterística"],given:["* ","Dáu ","Dada ","Daos ","Daes "],name:"Asturian",native:"asturianu",scenario:["Casu"],scenarioOutline:["Esbozu del casu"],then:["* ","Entós "],when:["* ","Cuando "]},az:{and:["* ","Və ","Həm "],background:["Keçmiş","Kontekst"],but:["* ","Amma ","Ancaq "],examples:["Nümunələr"],feature:["Özəllik"],given:["* ","Tutaq ki ","Verilir "],name:"Azerbaijani",native:"Azərbaycanca",scenario:["Ssenari"],scenarioOutline:["Ssenarinin strukturu"],then:["* ","O halda "],when:["* ","Əgər ","Nə vaxt ki "]},bg:{and:["* ","И "],background:["Предистория"],but:["* ","Но "],examples:["Примери"],feature:["Функционалност"],given:["* ","Дадено "],name:"Bulgarian",native:"български",scenario:["Сценарий"],scenarioOutline:["Рамка на сценарий"],then:["* ","То "],when:["* ","Когато "]},bm:{and:["* ","Dan "],background:["Latar Belakang"],but:["* ","Tetapi ","Tapi "],examples:["Contoh"],feature:["Fungsi"],given:["* ","Diberi ","Bagi "],name:"Malay",native:"Bahasa Melayu",scenario:["Senario","Situasi","Keadaan"],scenarioOutline:["Kerangka Senario","Kerangka Situasi","Kerangka Keadaan","Garis Panduan Senario"],then:["* ","Maka ","Kemudian "],when:["* ","Apabila "]},bs:{and:["* ","I ","A "],background:["Pozadina"],but:["* ","Ali "],examples:["Primjeri"],feature:["Karakteristika"],given:["* ","Dato "],name:"Bosnian",native:"Bosanski",scenario:["Scenariju","Scenario"],scenarioOutline:["Scenariju-obris","Scenario-outline"],then:["* ","Zatim "],when:["* ","Kada "]},ca:{and:["* ","I "],background:["Rerefons","Antecedents"],but:["* ","Però "],examples:["Exemples"],feature:["Característica","Funcionalitat"],given:["* ","Donat ","Donada ","Atès ","Atesa "],name:"Catalan",native:"català",scenario:["Escenari"],scenarioOutline:["Esquema de l'escenari"],then:["* ","Aleshores ","Cal "],when:["* ","Quan "]},cs:{and:["* ","A také ","A "],background:["Pozadí","Kontext"],but:["* ","Ale "],examples:["Příklady"],feature:["Požadavek"],given:["* ","Pokud ","Za předpokladu "],name:"Czech",native:"Česky",scenario:["Scénář"],scenarioOutline:["Náčrt Scénáře","Osnova scénáře"],then:["* ","Pak "],when:["* ","Když "]},"cy-GB":{and:["* ","A "],background:["Cefndir"],but:["* ","Ond "],examples:["Enghreifftiau"],feature:["Arwedd"],given:["* ","Anrhegedig a "],name:"Welsh",native:"Cymraeg",scenario:["Scenario"],scenarioOutline:["Scenario Amlinellol"],then:["* ","Yna "],when:["* ","Pryd "]},da:{and:["* ","Og "],background:["Baggrund"],but:["* ","Men "],examples:["Eksempler"],feature:["Egenskab"],given:["* ","Givet "],name:"Danish",native:"dansk",scenario:["Scenarie"],scenarioOutline:["Abstrakt Scenario"],then:["* ","Så "],when:["* ","Når "]},de:{and:["* ","Und "],background:["Grundlage"],but:["* ","Aber "],examples:["Beispiele"],feature:["Funktionalität"],given:["* ","Angenommen ","Gegeben sei ","Gegeben seien "],name:"German",native:"Deutsch",scenario:["Szenario"],scenarioOutline:["Szenariogrundriss"],then:["* ","Dann "],when:["* ","Wenn "]},el:{and:["* ","Και "],background:["Υπόβαθρο"],but:["* ","Αλλά "],examples:["Παραδείγματα","Σενάρια"],feature:["Δυνατότητα","Λειτουργία"],given:["* ","Δεδομένου "],name:"Greek",native:"Ελληνικά",scenario:["Σενάριο"],scenarioOutline:["Περιγραφή Σεναρίου","Περίγραμμα Σεναρίου"],then:["* ","Τότε "],when:["* ","Όταν "]},em:{and:["* ","😂"],background:["💤"],but:["* ","😔"],examples:["📓"],feature:["📚"],given:["* ","😐"],name:"Emoji",native:"😀",scenario:["📕"],scenarioOutline:["📖"],then:["* ","🙏"],when:["* ","🎬"]},en:{and:["* ","And "],background:["Background"],but:["* ","But "],examples:["Examples","Scenarios"],feature:["Feature","Business Need","Ability"],given:["* ","Given "],name:"English",native:"English",scenario:["Scenario"],scenarioOutline:["Scenario Outline","Scenario Template"],then:["* ","Then "],when:["* ","When "]},"en-Scouse":{and:["* ","An "],background:["Dis is what went down"],but:["* ","Buh "],examples:["Examples"],feature:["Feature"],given:["* ","Givun ","Youse know when youse got "],name:"Scouse",native:"Scouse",scenario:["The thing of it is"],scenarioOutline:["Wharrimean is"],then:["* ","Dun ","Den youse gotta "],when:["* ","Wun ","Youse know like when "]},"en-au":{and:["* ","Too right "],background:["First off"],but:["* ","Yeah nah "],examples:["You'll wanna"],feature:["Pretty much"],given:["* ","Y'know "],name:"Australian",native:"Australian",scenario:["Awww, look mate"],scenarioOutline:["Reckon it's like"],then:["* ","But at the end of the day I reckon "],when:["* ","It's just unbelievable "]},"en-lol":{and:["* ","AN "],background:["B4"],but:["* ","BUT "],examples:["EXAMPLZ"],feature:["OH HAI"],given:["* ","I CAN HAZ "],name:"LOLCAT",native:"LOLCAT",scenario:["MISHUN"],scenarioOutline:["MISHUN SRSLY"],then:["* ","DEN "],when:["* ","WEN "]},"en-old":{and:["* ","Ond ","7 "],background:["Aer","Ær"],but:["* ","Ac "],examples:["Se the","Se þe","Se ðe"],feature:["Hwaet","Hwæt"],given:["* ","Thurh ","Þurh ","Ðurh "],name:"Old English",native:"Englisc",scenario:["Swa"],scenarioOutline:["Swa hwaer swa","Swa hwær swa"],then:["* ","Tha ","Þa ","Ða ","Tha the ","Þa þe ","Ða ðe "],when:["* ","Tha ","Þa ","Ða "]},"en-pirate":{and:["* ","Aye "],background:["Yo-ho-ho"],but:["* ","Avast! "],examples:["Dead men tell no tales"],feature:["Ahoy matey!"],given:["* ","Gangway! "],name:"Pirate",native:"Pirate",scenario:["Heave to"],scenarioOutline:["Shiver me timbers"],then:["* ","Let go and haul "],when:["* ","Blimey! "]},eo:{and:["* ","Kaj "],background:["Fono"],but:["* ","Sed "],examples:["Ekzemploj"],feature:["Trajto"],given:["* ","Donitaĵo ","Komence "],name:"Esperanto",native:"Esperanto",scenario:["Scenaro","Kazo"],scenarioOutline:["Konturo de la scenaro","Skizo","Kazo-skizo"],then:["* ","Do "],when:["* ","Se "]},es:{and:["* ","Y ","E "],background:["Antecedentes"],but:["* ","Pero "],examples:["Ejemplos"],feature:["Característica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Spanish",native:"español",scenario:["Escenario"],scenarioOutline:["Esquema del escenario"],then:["* ","Entonces "],when:["* ","Cuando "]},et:{and:["* ","Ja "],background:["Taust"],but:["* ","Kuid "],examples:["Juhtumid"],feature:["Omadus"],given:["* ","Eeldades "],name:"Estonian",native:"eesti keel",scenario:["Stsenaarium"],scenarioOutline:["Raamstsenaarium"],then:["* ","Siis "],when:["* ","Kui "]},fa:{and:["* ","و "],background:["زمینه"],but:["* ","اما "],examples:["نمونه ها"],feature:["وِیژگی"],given:["* ","با فرض "],name:"Persian",native:"فارسی",scenario:["سناریو"],scenarioOutline:["الگوی سناریو"],then:["* ","آنگاه "],when:["* ","هنگامی "]},fi:{and:["* ","Ja "],background:["Tausta"],but:["* ","Mutta "],examples:["Tapaukset"],feature:["Ominaisuus"],given:["* ","Oletetaan "],name:"Finnish",native:"suomi",scenario:["Tapaus"],scenarioOutline:["Tapausaihio"],then:["* ","Niin "],when:["* ","Kun "]},fr:{and:["* ","Et que ","Et qu'","Et "],background:["Contexte"],but:["* ","Mais que ","Mais qu'","Mais "],examples:["Exemples"],feature:["Fonctionnalité"],given:["* ","Soit ","Etant donné que ","Etant donné qu'","Etant donné ","Etant donnée ","Etant donnés ","Etant données ","Étant donné que ","Étant donné qu'","Étant donné ","Étant donnée ","Étant donnés ","Étant données "],name:"French",native:"français",scenario:["Scénario"],scenarioOutline:["Plan du scénario","Plan du Scénario"],then:["* ","Alors "],when:["* ","Quand ","Lorsque ","Lorsqu'"]},ga:{and:["* ","Agus"],background:["Cúlra"],but:["* ","Ach"],examples:["Samplaí"],feature:["Gné"],given:["* ","Cuir i gcás go","Cuir i gcás nach","Cuir i gcás gur","Cuir i gcás nár"],name:"Irish",native:"Gaeilge",scenario:["Cás"],scenarioOutline:["Cás Achomair"],then:["* ","Ansin"],when:["* ","Nuair a","Nuair nach","Nuair ba","Nuair nár"]},gj:{and:["* ","અને "],background:["બેકગ્રાઉન્ડ"],but:["* ","પણ "],examples:["ઉદાહરણો"],feature:["લક્ષણ","વ્યાપાર જરૂર","ક્ષમતા"],given:["* ","આપેલ છે "],name:"Gujarati",native:"ગુજરાતી",scenario:["સ્થિતિ"],scenarioOutline:["પરિદ્દશ્ય રૂપરેખા","પરિદ્દશ્ય ઢાંચો"],then:["* ","પછી "],when:["* ","ક્યારે "]},gl:{and:["* ","E "],background:["Contexto"],but:["* ","Mais ","Pero "],examples:["Exemplos"],feature:["Característica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Galician",native:"galego",scenario:["Escenario"],scenarioOutline:["Esbozo do escenario"],then:["* ","Entón ","Logo "],when:["* ","Cando "]},he:{and:["* ","וגם "],background:["רקע"],but:["* ","אבל "],examples:["דוגמאות"],feature:["תכונה"],given:["* ","בהינתן "],name:"Hebrew",native:"עברית",scenario:["תרחיש"],scenarioOutline:["תבנית תרחיש"],then:["* ","אז ","אזי "],when:["* ","כאשר "]},hi:{and:["* ","और ","तथा "],background:["पृष्ठभूमि"],but:["* ","पर ","परन्तु ","किन्तु "],examples:["उदाहरण"],feature:["रूप लेख"],given:["* ","अगर ","यदि ","चूंकि "],name:"Hindi",native:"हिंदी",scenario:["परिदृश्य"],scenarioOutline:["परिदृश्य रूपरेखा"],then:["* ","तब ","तदा "],when:["* ","जब ","कदा "]},hr:{and:["* ","I "],background:["Pozadina"],but:["* ","Ali "],examples:["Primjeri","Scenariji"],feature:["Osobina","Mogućnost","Mogucnost"],given:["* ","Zadan ","Zadani ","Zadano "],name:"Croatian",native:"hrvatski",scenario:["Scenarij"],scenarioOutline:["Skica","Koncept"],then:["* ","Onda "],when:["* ","Kada ","Kad "]},ht:{and:["* ","Ak ","Epi ","E "],background:["Kontèks","Istorik"],but:["* ","Men "],examples:["Egzanp"],feature:["Karakteristik","Mak","Fonksyonalite"],given:["* ","Sipoze ","Sipoze ke ","Sipoze Ke "],name:"Creole",native:"kreyòl",scenario:["Senaryo"],scenarioOutline:["Plan senaryo","Plan Senaryo","Senaryo deskripsyon","Senaryo Deskripsyon","Dyagram senaryo","Dyagram Senaryo"],then:["* ","Lè sa a ","Le sa a "],when:["* ","Lè ","Le "]},hu:{and:["* ","És "],background:["Háttér"],but:["* ","De "],examples:["Példák"],feature:["Jellemző"],given:["* ","Amennyiben ","Adott "],name:"Hungarian",native:"magyar",scenario:["Forgatókönyv"],scenarioOutline:["Forgatókönyv vázlat"],then:["* ","Akkor "],when:["* ","Majd ","Ha ","Amikor "]},id:{and:["* ","Dan "],background:["Dasar"],but:["* ","Tapi "],examples:["Contoh"],feature:["Fitur"],given:["* ","Dengan "],name:"Indonesian",native:"Bahasa Indonesia",scenario:["Skenario"],scenarioOutline:["Skenario konsep"],then:["* ","Maka "],when:["* ","Ketika "]},is:{and:["* ","Og "],background:["Bakgrunnur"],but:["* ","En "],examples:["Dæmi","Atburðarásir"],feature:["Eiginleiki"],given:["* ","Ef "],name:"Icelandic",native:"Íslenska",scenario:["Atburðarás"],scenarioOutline:["Lýsing Atburðarásar","Lýsing Dæma"],then:["* ","Þá "],when:["* ","Þegar "]},it:{and:["* ","E "],background:["Contesto"],but:["* ","Ma "],examples:["Esempi"],feature:["Funzionalità"],given:["* ","Dato ","Data ","Dati ","Date "],name:"Italian",native:"italiano",scenario:["Scenario"],scenarioOutline:["Schema dello scenario"],then:["* ","Allora "],when:["* ","Quando "]},ja:{and:["* ","かつ"],background:["背景"],but:["* ","しかし","但し","ただし"],examples:["例","サンプル"],feature:["フィーチャ","機能"],given:["* ","前提"],name:"Japanese",native:"日本語",scenario:["シナリオ"],scenarioOutline:["シナリオアウトライン","シナリオテンプレート","テンプレ","シナリオテンプレ"],then:["* ","ならば"],when:["* ","もし"]},jv:{and:["* ","Lan "],background:["Dasar"],but:["* ","Tapi ","Nanging ","Ananging "],examples:["Conto","Contone"],feature:["Fitur"],given:["* ","Nalika ","Nalikaning "],name:"Javanese",native:"Basa Jawa",scenario:["Skenario"],scenarioOutline:["Konsep skenario"],then:["* ","Njuk ","Banjur "],when:["* ","Manawa ","Menawa "]},ka:{and:["* ","და"],background:["კონტექსტი"],but:["* ","მაგ­რამ"],examples:["მაგალითები"],feature:["თვისება"],given:["* ","მოცემული"],name:"Georgian",native:"ქართველი",scenario:["სცენარის"],scenarioOutline:["სცენარის ნიმუში"],then:["* ","მაშინ"],when:["* ","როდესაც"]},kn:{and:["* ","ಮತ್ತು "],background:["ಹಿನ್ನೆಲೆ"],but:["* ","ಆದರೆ "],examples:["ಉದಾಹರಣೆಗಳು"],feature:["ಹೆಚ್ಚಳ"],given:["* ","ನೀಡಿದ "],name:"Kannada",native:"ಕನ್ನಡ",scenario:["ಕಥಾಸಾರಾಂಶ"],scenarioOutline:["ವಿವರಣೆ"],then:["* ","ನಂತರ "],when:["* ","ಸ್ಥಿತಿಯನ್ನು "]},ko:{and:["* ","그리고"],background:["배경"],but:["* ","하지만","단"],examples:["예"],feature:["기능"],given:["* ","조건","먼저"],name:"Korean",native:"한국어",scenario:["시나리오"],scenarioOutline:["시나리오 개요"],then:["* ","그러면"],when:["* ","만일","만약"]},lt:{and:["* ","Ir "],background:["Kontekstas"],but:["* ","Bet "],examples:["Pavyzdžiai","Scenarijai","Variantai"],feature:["Savybė"],given:["* ","Duota "],name:"Lithuanian",native:"lietuvių kalba",scenario:["Scenarijus"],scenarioOutline:["Scenarijaus šablonas"],then:["* ","Tada "],when:["* ","Kai "]},lu:{and:["* ","an ","a "],background:["Hannergrond"],but:["* ","awer ","mä "],examples:["Beispiller"],feature:["Funktionalitéit"],given:["* ","ugeholl "],name:"Luxemburgish",native:"Lëtzebuergesch",scenario:["Szenario"],scenarioOutline:["Plang vum Szenario"],then:["* ","dann "],when:["* ","wann "]},lv:{and:["* ","Un "],background:["Konteksts","Situācija"],but:["* ","Bet "],examples:["Piemēri","Paraugs"],feature:["Funkcionalitāte","Fīča"],given:["* ","Kad "],name:"Latvian",native:"latviešu",scenario:["Scenārijs"],scenarioOutline:["Scenārijs pēc parauga"],then:["* ","Tad "],when:["* ","Ja "]},"mk-Cyrl":{and:["* ","И "],background:["Контекст","Содржина"],but:["* ","Но "],examples:["Примери","Сценарија"],feature:["Функционалност","Бизнис потреба","Можност"],given:["* ","Дадено ","Дадена "],name:"Macedonian",native:"Македонски",scenario:["Сценарио","На пример"],scenarioOutline:["Преглед на сценарија","Скица","Концепт"],then:["* ","Тогаш "],when:["* ","Кога "]},"mk-Latn":{and:["* ","I "],background:["Kontekst","Sodrzhina"],but:["* ","No "],examples:["Primeri","Scenaria"],feature:["Funkcionalnost","Biznis potreba","Mozhnost"],given:["* ","Dadeno ","Dadena "],name:"Macedonian (Latin)",native:"Makedonski (Latinica)",scenario:["Scenario","Na primer"],scenarioOutline:["Pregled na scenarija","Skica","Koncept"],then:["* ","Togash "],when:["* ","Koga "]},mn:{and:["* ","Мөн ","Тэгээд "],background:["Агуулга"],but:["* ","Гэхдээ ","Харин "],examples:["Тухайлбал"],feature:["Функц","Функционал"],given:["* ","Өгөгдсөн нь ","Анх "],name:"Mongolian",native:"монгол",scenario:["Сценар"],scenarioOutline:["Сценарын төлөвлөгөө"],then:["* ","Тэгэхэд ","Үүний дараа "],when:["* ","Хэрэв "]},nl:{and:["* ","En "],background:["Achtergrond"],but:["* ","Maar "],examples:["Voorbeelden"],feature:["Functionaliteit"],given:["* ","Gegeven ","Stel "],name:"Dutch",native:"Nederlands",scenario:["Scenario"],scenarioOutline:["Abstract Scenario"],then:["* ","Dan "],when:["* ","Als ","Wanneer "]},no:{and:["* ","Og "],background:["Bakgrunn"],but:["* ","Men "],examples:["Eksempler"],feature:["Egenskap"],given:["* ","Gitt "],name:"Norwegian",native:"norsk",scenario:["Scenario"],scenarioOutline:["Scenariomal","Abstrakt Scenario"],then:["* ","Så "],when:["* ","Når "]},pa:{and:["* ","ਅਤੇ "],background:["ਪਿਛੋਕੜ"],but:["* ","ਪਰ "],examples:["ਉਦਾਹਰਨਾਂ"],feature:["ਖਾਸੀਅਤ","ਮੁਹਾਂਦਰਾ","ਨਕਸ਼ ਨੁਹਾਰ"],given:["* ","ਜੇਕਰ ","ਜਿਵੇਂ ਕਿ "],name:"Panjabi",native:"ਪੰਜਾਬੀ",scenario:["ਪਟਕਥਾ"],scenarioOutline:["ਪਟਕਥਾ ਢਾਂਚਾ","ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ"],then:["* ","ਤਦ "],when:["* ","ਜਦੋਂ "]},pl:{and:["* ","Oraz ","I "],background:["Założenia"],but:["* ","Ale "],examples:["Przykłady"],feature:["Właściwość","Funkcja","Aspekt","Potrzeba biznesowa"],given:["* ","Zakładając ","Mając ","Zakładając, że "],name:"Polish",native:"polski",scenario:["Scenariusz"],scenarioOutline:["Szablon scenariusza"],then:["* ","Wtedy "],when:["* ","Jeżeli ","Jeśli ","Gdy ","Kiedy "]},pt:{and:["* ","E "],background:["Contexto","Cenário de Fundo","Cenario de Fundo","Fundo"],but:["* ","Mas "],examples:["Exemplos","Cenários","Cenarios"],feature:["Funcionalidade","Característica","Caracteristica"],given:["* ","Dado ","Dada ","Dados ","Dadas "],name:"Portuguese",native:"português",scenario:["Cenário","Cenario"],scenarioOutline:["Esquema do Cenário","Esquema do Cenario","Delineação do Cenário","Delineacao do Cenario"],then:["* ","Então ","Entao "],when:["* ","Quando "]},ro:{and:["* ","Si ","Și ","Şi "],background:["Context"],but:["* ","Dar "],examples:["Exemple"],feature:["Functionalitate","Funcționalitate","Funcţionalitate"],given:["* ","Date fiind ","Dat fiind ","Dată fiind","Dati fiind ","Dați fiind ","Daţi fiind "],name:"Romanian",native:"română",scenario:["Scenariu"],scenarioOutline:["Structura scenariu","Structură scenariu"],then:["* ","Atunci "],when:["* ","Cand ","Când "]},ru:{and:["* ","И ","К тому же ","Также "],background:["Предыстория","Контекст"],but:["* ","Но ","А ","Иначе "],examples:["Примеры"],feature:["Функция","Функциональность","Функционал","Свойство"],given:["* ","Допустим ","Дано ","Пусть ","Если "],name:"Russian",native:"русский",scenario:["Сценарий"],scenarioOutline:["Структура сценария"],then:["* ","То ","Затем ","Тогда "],when:["* ","Когда "]},sk:{and:["* ","A ","A tiež ","A taktiež ","A zároveň "],background:["Pozadie"],but:["* ","Ale "],examples:["Príklady"],feature:["Požiadavka","Funkcia","Vlastnosť"],given:["* ","Pokiaľ ","Za predpokladu "],name:"Slovak",native:"Slovensky",scenario:["Scenár"],scenarioOutline:["Náčrt Scenáru","Náčrt Scenára","Osnova Scenára"],then:["* ","Tak ","Potom "],when:["* ","Keď ","Ak "]},sl:{and:["In ","Ter "],background:["Kontekst","Osnova","Ozadje"],but:["Toda ","Ampak ","Vendar "],examples:["Primeri","Scenariji"],feature:["Funkcionalnost","Funkcija","Možnosti","Moznosti","Lastnost","Značilnost"],given:["Dano ","Podano ","Zaradi ","Privzeto "],name:"Slovenian",native:"Slovenski",scenario:["Scenarij","Primer"],scenarioOutline:["Struktura scenarija","Skica","Koncept","Oris scenarija","Osnutek"],then:["Nato ","Potem ","Takrat "],when:["Ko ","Ce ","Če ","Kadar "]},"sr-Cyrl":{and:["* ","И "],background:["Контекст","Основа","Позадина"],but:["* ","Али "],examples:["Примери","Сценарији"],feature:["Функционалност","Могућност","Особина"],given:["* ","За дато ","За дате ","За дати "],name:"Serbian",native:"Српски",scenario:["Сценарио","Пример"],scenarioOutline:["Структура сценарија","Скица","Концепт"],then:["* ","Онда "],when:["* ","Када ","Кад "]},"sr-Latn":{and:["* ","I "],background:["Kontekst","Osnova","Pozadina"],but:["* ","Ali "],examples:["Primeri","Scenariji"],feature:["Funkcionalnost","Mogućnost","Mogucnost","Osobina"],given:["* ","Za dato ","Za date ","Za dati "],name:"Serbian (Latin)",native:"Srpski (Latinica)",scenario:["Scenario","Primer"],scenarioOutline:["Struktura scenarija","Skica","Koncept"],then:["* ","Onda "],when:["* ","Kada ","Kad "]},sv:{and:["* ","Och "],background:["Bakgrund"],but:["* ","Men "],examples:["Exempel"],feature:["Egenskap"],given:["* ","Givet "],name:"Swedish",native:"Svenska",scenario:["Scenario"],scenarioOutline:["Abstrakt Scenario","Scenariomall"],then:["* ","Så "],when:["* ","När "]},ta:{and:["* ","மேலும் ","மற்றும் "],background:["பின்னணி"],but:["* ","ஆனால் "],examples:["எடுத்துக்காட்டுகள்","காட்சிகள்"," நிலைமைகளில்"],feature:["அம்சம்","வணிக தேவை","திறன்"],given:["* ","கொடுக்கப்பட்ட "],name:"Tamil",native:"தமிழ்",scenario:["காட்சி"],scenarioOutline:["காட்சி சுருக்கம்","காட்சி வார்ப்புரு"],then:["* ","அப்பொழுது "],when:["* ","எப்போது "]},th:{and:["* ","และ "],background:["แนวคิด"],but:["* ","แต่ "],examples:["ชุดของตัวอย่าง","ชุดของเหตุการณ์"],feature:["โครงหลัก","ความต้องการทางธุรกิจ","ความสามารถ"],given:["* ","กำหนดให้ "],name:"Thai",native:"ไทย",scenario:["เหตุการณ์"],scenarioOutline:["สรุปเหตุการณ์","โครงสร้างของเหตุการณ์"],then:["* ","ดังนั้น "],when:["* ","เมื่อ "]},tl:{and:["* ","మరియు "],background:["నేపథ్యం"],but:["* ","కాని "],examples:["ఉదాహరణలు"],feature:["గుణము"],given:["* ","చెప్పబడినది "],name:"Telugu",native:"తెలుగు",scenario:["సన్నివేశం"], scenarioOutline:["కథనం"],then:["* ","అప్పుడు "],when:["* ","ఈ పరిస్థితిలో "]},tlh:{and:["* ","'ej ","latlh "],background:["mo'"],but:["* ","'ach ","'a "],examples:["ghantoH","lutmey"],feature:["Qap","Qu'meH 'ut","perbogh","poQbogh malja'","laH"],given:["* ","ghu' noblu' ","DaH ghu' bejlu' "],name:"Klingon",native:"tlhIngan",scenario:["lut"],scenarioOutline:["lut chovnatlh"],then:["* ","vaj "],when:["* ","qaSDI' "]},tr:{and:["* ","Ve "],background:["Geçmiş"],but:["* ","Fakat ","Ama "],examples:["Örnekler"],feature:["Özellik"],given:["* ","Diyelim ki "],name:"Turkish",native:"Türkçe",scenario:["Senaryo"],scenarioOutline:["Senaryo taslağı"],then:["* ","O zaman "],when:["* ","Eğer ki "]},tt:{and:["* ","Һәм ","Вә "],background:["Кереш"],but:["* ","Ләкин ","Әмма "],examples:["Үрнәкләр","Мисаллар"],feature:["Мөмкинлек","Үзенчәлеклелек"],given:["* ","Әйтик "],name:"Tatar",native:"Татарча",scenario:["Сценарий"],scenarioOutline:["Сценарийның төзелеше"],then:["* ","Нәтиҗәдә "],when:["* ","Әгәр "]},uk:{and:["* ","І ","А також ","Та "],background:["Передумова"],but:["* ","Але "],examples:["Приклади"],feature:["Функціонал"],given:["* ","Припустимо ","Припустимо, що ","Нехай ","Дано "],name:"Ukrainian",native:"Українська",scenario:["Сценарій"],scenarioOutline:["Структура сценарію"],then:["* ","То ","Тоді "],when:["* ","Якщо ","Коли "]},ur:{and:["* ","اور "],background:["پس منظر"],but:["* ","لیکن "],examples:["مثالیں"],feature:["صلاحیت","کاروبار کی ضرورت","خصوصیت"],given:["* ","اگر ","بالفرض ","فرض کیا "],name:"Urdu",native:"اردو",scenario:["منظرنامہ"],scenarioOutline:["منظر نامے کا خاکہ"],then:["* ","پھر ","تب "],when:["* ","جب "]},uz:{and:["* ","Ва "],background:["Тарих"],but:["* ","Лекин ","Бирок ","Аммо "],examples:["Мисоллар"],feature:["Функционал"],given:["* ","Агар "],name:"Uzbek",native:"Узбекча",scenario:["Сценарий"],scenarioOutline:["Сценарий структураси"],then:["* ","Унда "],when:["* ","Агар "]},vi:{and:["* ","Và "],background:["Bối cảnh"],but:["* ","Nhưng "],examples:["Dữ liệu"],feature:["Tính năng"],given:["* ","Biết ","Cho "],name:"Vietnamese",native:"Tiếng Việt",scenario:["Tình huống","Kịch bản"],scenarioOutline:["Khung tình huống","Khung kịch bản"],then:["* ","Thì "],when:["* ","Khi "]},"zh-CN":{and:["* ","而且","并且","同时"],background:["背景"],but:["* ","但是"],examples:["例子"],feature:["功能"],given:["* ","假如","假设","假定"],name:"Chinese simplified",native:"简体中文",scenario:["场景","剧本"],scenarioOutline:["场景大纲","剧本大纲"],then:["* ","那么"],when:["* ","当"]},"zh-TW":{and:["* ","而且","並且","同時"],background:["背景"],but:["* ","但是"],examples:["例子"],feature:["功能"],given:["* ","假如","假設","假定"],name:"Chinese traditional",native:"繁體中文",scenario:["場景","劇本"],scenarioOutline:["場景大綱","劇本大綱"],then:["* ","那麼"],when:["* ","當"]}}},{}],9:[function(require,module,exports){var countSymbols=require("./count_symbols");function GherkinLine(lineText,lineNumber){this.lineText=lineText;this.lineNumber=lineNumber;this.trimmedLineText=lineText.replace(/^\s+/g,"");this.isEmpty=this.trimmedLineText.length==0;this.indent=countSymbols(lineText)-countSymbols(this.trimmedLineText)}GherkinLine.prototype.startsWith=function startsWith(prefix){return this.trimmedLineText.indexOf(prefix)==0};GherkinLine.prototype.startsWithTitleKeyword=function startsWithTitleKeyword(keyword){return this.startsWith(keyword+":")};GherkinLine.prototype.getLineText=function getLineText(indentToRemove){if(indentToRemove<0||indentToRemove>this.indent){return this.trimmedLineText}else{return this.lineText.substring(indentToRemove)}};GherkinLine.prototype.getRestTrimmed=function getRestTrimmed(length){return this.trimmedLineText.substring(length).trim()};GherkinLine.prototype.getTableCells=function getTableCells(){var cells=[];var col=0;var startCol=col+1;var cell="";var firstCell=true;while(col0){throw Errors.CompositeParserException.create(context.errors)}return getResult()};function addError(context,error){context.errors.push(error);if(context.errors.length>10)throw Errors.CompositeParserException.create(context.errors)}function startRule(context,ruleType){handleAstError(context,function(){builder.startRule(ruleType)})}function endRule(context,ruleType){handleAstError(context,function(){builder.endRule(ruleType)})}function build(context,token){handleAstError(context,function(){builder.build(token)})}function getResult(){return builder.getResult()}function handleAstError(context,action){handleExternalError(context,true,action)}function handleExternalError(context,defaultValue,action){if(self.stopAtFirstError)return action();try{return action()}catch(e){if(e instanceof Errors.CompositeParserException){e.errors.forEach(function(error){addError(context,error)})}else if(e instanceof Errors.ParserException||e instanceof Errors.AstBuilderException||e instanceof Errors.UnexpectedTokenException||e instanceof Errors.NoSuchLanguageException){addError(context,e)}else{throw e}}return defaultValue}function readToken(context){return context.tokenQueue.length>0?context.tokenQueue.shift():context.tokenScanner.read()}function matchToken(state,token,context){switch(state){case 0:return matchTokenAt_0(token,context);case 1:return matchTokenAt_1(token,context);case 2:return matchTokenAt_2(token,context);case 3:return matchTokenAt_3(token,context);case 4:return matchTokenAt_4(token,context);case 5:return matchTokenAt_5(token,context);case 6:return matchTokenAt_6(token,context);case 7:return matchTokenAt_7(token,context);case 8:return matchTokenAt_8(token,context);case 9:return matchTokenAt_9(token,context);case 10:return matchTokenAt_10(token,context);case 11:return matchTokenAt_11(token,context);case 12:return matchTokenAt_12(token,context);case 13:return matchTokenAt_13(token,context);case 14:return matchTokenAt_14(token,context);case 15:return matchTokenAt_15(token,context);case 16:return matchTokenAt_16(token,context);case 17:return matchTokenAt_17(token,context);case 18:return matchTokenAt_18(token,context);case 19:return matchTokenAt_19(token,context);case 20:return matchTokenAt_20(token,context);case 21:return matchTokenAt_21(token,context);case 22:return matchTokenAt_22(token,context);case 23:return matchTokenAt_23(token,context);case 24:return matchTokenAt_24(token,context);case 25:return matchTokenAt_25(token,context);case 26:return matchTokenAt_26(token,context);case 28:return matchTokenAt_28(token,context);case 29:return matchTokenAt_29(token,context);case 30:return matchTokenAt_30(token,context);case 31:return matchTokenAt_31(token,context);case 32:return matchTokenAt_32(token,context);case 33:return matchTokenAt_33(token,context);default:throw new Error("Unknown state: "+state)}}function matchTokenAt_0(token,context){if(match_EOF(context,token)){build(context,token);return 27}if(match_Language(context,token)){startRule(context,"Feature");startRule(context,"Feature_Header");build(context,token);return 1}if(match_TagLine(context,token)){startRule(context,"Feature");startRule(context,"Feature_Header");startRule(context,"Tags");build(context,token);return 2}if(match_FeatureLine(context,token)){startRule(context,"Feature");startRule(context,"Feature_Header");build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 0}if(match_Empty(context,token)){build(context,token);return 0}var stateComment="State: 0 - Start";token.detach();var expectedTokens=["#EOF","#Language","#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 0}function matchTokenAt_1(token,context){if(match_TagLine(context,token)){startRule(context,"Tags");build(context,token);return 2}if(match_FeatureLine(context,token)){build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 1}if(match_Empty(context,token)){build(context,token);return 1}var stateComment="State: 1 - GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0";token.detach();var expectedTokens=["#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 1}function matchTokenAt_2(token,context){if(match_TagLine(context,token)){build(context,token);return 2}if(match_FeatureLine(context,token)){endRule(context,"Tags");build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 2}if(match_Empty(context,token)){build(context,token);return 2}var stateComment="State: 2 - GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#FeatureLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 2}function matchTokenAt_3(token,context){if(match_EOF(context,token)){endRule(context,"Feature_Header");endRule(context,"Feature");build(context,token);return 27}if(match_Empty(context,token)){build(context,token);return 3}if(match_Comment(context,token)){build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"Feature_Header");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 4}var stateComment="State: 3 - GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 3}function matchTokenAt_4(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Feature_Header");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"Description");endRule(context,"Feature_Header");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Description");endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){build(context,token);return 4}var stateComment="State: 4 - GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 4}function matchTokenAt_5(token,context){if(match_EOF(context,token)){endRule(context,"Feature_Header");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){build(context,token);return 5}if(match_BackgroundLine(context,token)){endRule(context,"Feature_Header");startRule(context,"Background");build(context,token);return 6}if(match_TagLine(context,token)){endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Feature_Header");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Empty(context,token)){build(context,token);return 5}var stateComment="State: 5 - GherkinDocument:0>Feature:0>Feature_Header:3>Description_Helper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#BackgroundLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 5}function matchTokenAt_6(token,context){if(match_EOF(context,token)){endRule(context,"Background");endRule(context,"Feature");build(context,token);return 27}if(match_Empty(context,token)){build(context,token);return 6}if(match_Comment(context,token)){build(context,token);return 8}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 7}var stateComment="State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 6}function matchTokenAt_7(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 8}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Description");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){build(context,token);return 7}var stateComment="State: 7 - GherkinDocument:0>Feature:1>Background:1>Description_Helper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 7}function matchTokenAt_8(token,context){if(match_EOF(context,token)){endRule(context,"Background");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){build(context,token);return 8}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Empty(context,token)){build(context,token);return 8}var stateComment="State: 8 - GherkinDocument:0>Feature:1>Background:1>Description_Helper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 8}function matchTokenAt_9(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 27}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 10}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 32}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 9}if(match_Empty(context,token)){build(context,token);return 9}var stateComment="State: 9 - GherkinDocument:0>Feature:1>Background:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 9}function matchTokenAt_10(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 27}if(match_TableRow(context,token)){build(context,token);return 10}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 10}if(match_Empty(context,token)){build(context,token);return 10}var stateComment="State: 10 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 10}function matchTokenAt_11(token,context){if(match_TagLine(context,token)){build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Tags");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Tags");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 11}if(match_Empty(context,token)){build(context,token);return 11}var stateComment="State: 11 - GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 11}function matchTokenAt_12(token,context){if(match_EOF(context,token)){endRule(context,"Scenario");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Empty(context,token)){build(context,token);return 12}if(match_Comment(context,token)){build(context,token);return 14}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 13}var stateComment="State: 12 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 12}function matchTokenAt_13(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 14}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Description");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){build(context,token);return 13}var stateComment="State: 13 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 13}function matchTokenAt_14(token,context){if(match_EOF(context,token)){endRule(context,"Scenario");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){build(context,token);return 14}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Empty(context,token)){build(context,token);return 14}var stateComment="State: 14 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Description_Helper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 14}function matchTokenAt_15(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 16}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 30}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 15}if(match_Empty(context,token)){build(context,token);return 15}var stateComment="State: 15 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 15}function matchTokenAt_16(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_TableRow(context,token)){build(context,token);return 16}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition") ;startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 16}if(match_Empty(context,token)){build(context,token);return 16}var stateComment="State: 16 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 16}function matchTokenAt_17(token,context){if(match_EOF(context,token)){endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Empty(context,token)){build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 19}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 20}if(match_TagLine(context,token)){if(lookahead_0(context,token)){startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 18}var stateComment="State: 17 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 17}function matchTokenAt_18(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 19}if(match_StepLine(context,token)){endRule(context,"Description");startRule(context,"Step");build(context,token);return 20}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Description");startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Description");startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Description");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){build(context,token);return 18}var stateComment="State: 18 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 18}function matchTokenAt_19(token,context){if(match_EOF(context,token)){endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){build(context,token);return 19}if(match_StepLine(context,token)){startRule(context,"Step");build(context,token);return 20}if(match_TagLine(context,token)){if(lookahead_0(context,token)){startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Empty(context,token)){build(context,token);return 19}var stateComment="State: 19 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>Description_Helper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 19}function matchTokenAt_20(token,context){if(match_EOF(context,token)){endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_TableRow(context,token)){startRule(context,"DataTable");build(context,token);return 21}if(match_DocStringSeparator(context,token)){startRule(context,"DocString");build(context,token);return 28}if(match_StepLine(context,token)){endRule(context,"Step");startRule(context,"Step");build(context,token);return 20}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Step");startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Step");startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 20}if(match_Empty(context,token)){build(context,token);return 20}var stateComment="State: 20 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:0>#StepLine:0";token.detach();var expectedTokens=["#EOF","#TableRow","#DocStringSeparator","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 20}function matchTokenAt_21(token,context){if(match_EOF(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_TableRow(context,token)){build(context,token);return 21}if(match_StepLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Step");build(context,token);return 20}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"DataTable");endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 21}if(match_Empty(context,token)){build(context,token);return 21}var stateComment="State: 21 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 21}function matchTokenAt_22(token,context){if(match_TagLine(context,token)){build(context,token);return 22}if(match_ExamplesLine(context,token)){endRule(context,"Tags");startRule(context,"Examples");build(context,token);return 23}if(match_Comment(context,token)){build(context,token);return 22}if(match_Empty(context,token)){build(context,token);return 22}var stateComment="State: 22 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0";token.detach();var expectedTokens=["#TagLine","#ExamplesLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 22}function matchTokenAt_23(token,context){if(match_EOF(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Empty(context,token)){build(context,token);return 23}if(match_Comment(context,token)){build(context,token);return 25}if(match_TableRow(context,token)){startRule(context,"Examples_Table");build(context,token);return 26}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){startRule(context,"Description");build(context,token);return 24}var stateComment="State: 23 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0";token.detach();var expectedTokens=["#EOF","#Empty","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 23}function matchTokenAt_24(token,context){if(match_EOF(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){endRule(context,"Description");build(context,token);return 25}if(match_TableRow(context,token)){endRule(context,"Description");startRule(context,"Examples_Table");build(context,token);return 26}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"Examples_Definition");startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"Examples_Definition");startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Description");endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Other(context,token)){build(context,token);return 24}var stateComment="State: 24 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:1>Description:0>#Other:0";token.detach();var expectedTokens=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 24}function matchTokenAt_25(token,context){if(match_EOF(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_Comment(context,token)){build(context,token);return 25}if(match_TableRow(context,token)){startRule(context,"Examples_Table");build(context,token);return 26}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Empty(context,token)){build(context,token);return 25}var stateComment="State: 25 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Description_Helper:2>#Comment:0";token.detach();var expectedTokens=["#EOF","#Comment","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 25}function matchTokenAt_26(token,context){if(match_EOF(context,token)){endRule(context,"Examples_Table");endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_TableRow(context,token)){build(context,token);return 26}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"Examples_Table");endRule(context,"Examples");endRule(context,"Examples_Definition");startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"Examples_Table");endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"Examples_Table");endRule(context,"Examples");endRule(context,"Examples_Definition");startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"Examples_Table");endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"Examples_Table");endRule(context,"Examples");endRule(context,"Examples_Definition");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 26}if(match_Empty(context,token)){build(context,token);return 26}var stateComment="State: 26 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0";token.detach();var expectedTokens=["#EOF","#TableRow","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 26}function matchTokenAt_28(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 29}if(match_Other(context,token)){build(context,token);return 28}var stateComment="State: 28 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 28}function matchTokenAt_29(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 20}if(match_TagLine(context,token)){if(lookahead_0(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Examples_Definition");startRule(context,"Tags");build(context,token);return 22}}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ExamplesLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Examples_Definition");startRule(context,"Examples");build(context,token);return 23}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"ScenarioOutline");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 29}if(match_Empty(context,token)){build(context,token);return 29}var stateComment="State: 29 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ExamplesLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 29}function matchTokenAt_30(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 31}if(match_Other(context,token)){build(context,token);return 30}var stateComment="State: 30 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 30}function matchTokenAt_31(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");endRule(context,"Feature");build(context,token);return 27}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 15}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Scenario");endRule(context,"Scenario_Definition");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 31}if(match_Empty(context,token)){build(context,token);return 31}var stateComment="State: 31 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 31}function matchTokenAt_32(token,context){if(match_DocStringSeparator(context,token)){build(context,token);return 33}if(match_Other(context,token)){build(context,token);return 32}var stateComment="State: 32 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0";token.detach();var expectedTokens=["#DocStringSeparator","#Other"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 32}function matchTokenAt_33(token,context){if(match_EOF(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");endRule(context,"Feature");build(context,token);return 27}if(match_StepLine(context,token)){endRule(context,"DocString");endRule(context,"Step");startRule(context,"Step");build(context,token);return 9}if(match_TagLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Tags");build(context,token);return 11}if(match_ScenarioLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"Scenario");build(context,token);return 12}if(match_ScenarioOutlineLine(context,token)){endRule(context,"DocString");endRule(context,"Step");endRule(context,"Background");startRule(context,"Scenario_Definition");startRule(context,"ScenarioOutline");build(context,token);return 17}if(match_Comment(context,token)){build(context,token);return 33}if(match_Empty(context,token)){build(context,token);return 33}var stateComment="State: 33 - GherkinDocument:0>Feature:1>Background:2>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0";token.detach();var expectedTokens=["#EOF","#StepLine","#TagLine","#ScenarioLine","#ScenarioOutlineLine","#Comment","#Empty"];var error=token.isEof?Errors.UnexpectedEOFException.create(token,expectedTokens,stateComment):Errors.UnexpectedTokenException.create(token,expectedTokens,stateComment);if(self.stopAtFirstError)throw error;addError(context,error);return 33}function match_EOF(context,token){return handleExternalError(context,false,function(){return context.tokenMatcher.match_EOF(token)})}function match_Empty(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Empty(token)})}function match_Comment(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Comment(token)})}function match_TagLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_TagLine(token)})}function match_FeatureLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_FeatureLine(token)})}function match_BackgroundLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_BackgroundLine(token)})}function match_ScenarioLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_ScenarioLine(token)})}function match_ScenarioOutlineLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_ScenarioOutlineLine(token)})}function match_ExamplesLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_ExamplesLine(token)})}function match_StepLine(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_StepLine(token)})}function match_DocStringSeparator(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_DocStringSeparator(token)})}function match_TableRow(context,token){ -if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_TableRow(token)})}function match_Language(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Language(token)})}function match_Other(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Other(token)})}function lookahead_0(context,currentToken){currentToken.detach();var token;var queue=[];var match=false;do{token=readToken(context);token.detach();queue.push(token);if(false||match_ExamplesLine(context,token)){match=true;break}}while(false||match_Empty(context,token)||match_Comment(context,token)||match_TagLine(context,token));context.tokenQueue=context.tokenQueue.concat(queue);return match}}},{"./ast_builder":2,"./errors":6,"./token_matcher":13,"./token_scanner":14}],11:[function(require,module,exports){var countSymbols=require("../count_symbols");function Compiler(){this.compile=function(gherkin_document){var pickles=[];if(gherkin_document.feature==null)return pickles;var feature=gherkin_document.feature;var language=feature.language;var featureTags=feature.tags;var backgroundSteps=[];feature.children.forEach(function(scenarioDefinition){if(scenarioDefinition.type==="Background"){backgroundSteps=pickleSteps(scenarioDefinition)}else if(scenarioDefinition.type==="Scenario"){compileScenario(featureTags,backgroundSteps,scenarioDefinition,language,pickles)}else{compileScenarioOutline(featureTags,backgroundSteps,scenarioDefinition,language,pickles)}});return pickles};function compileScenario(featureTags,backgroundSteps,scenario,language,pickles){var steps=scenario.steps.length==0?[]:[].concat(backgroundSteps);var tags=[].concat(featureTags).concat(scenario.tags);scenario.steps.forEach(function(step){steps.push(pickleStep(step))});var pickle={tags:pickleTags(tags),name:scenario.name,language:language,locations:[pickleLocation(scenario.location)],steps:steps};pickles.push(pickle)}function compileScenarioOutline(featureTags,backgroundSteps,scenarioOutline,language,pickles){scenarioOutline.examples.filter(function(e){return e.tableHeader!=undefined}).forEach(function(examples){var variableCells=examples.tableHeader.cells;examples.tableBody.forEach(function(values){var valueCells=values.cells;var steps=scenarioOutline.steps.length==0?[]:[].concat(backgroundSteps);var tags=[].concat(featureTags).concat(scenarioOutline.tags).concat(examples.tags);scenarioOutline.steps.forEach(function(scenarioOutlineStep){var stepText=interpolate(scenarioOutlineStep.text,variableCells,valueCells);var args=createPickleArguments(scenarioOutlineStep.argument,variableCells,valueCells);var pickleStep={text:stepText,arguments:args,locations:[pickleLocation(values.location),pickleStepLocation(scenarioOutlineStep)]};steps.push(pickleStep)});var pickle={name:interpolate(scenarioOutline.name,variableCells,valueCells),language:language,steps:steps,tags:pickleTags(tags),locations:[pickleLocation(values.location),pickleLocation(scenarioOutline.location)]};pickles.push(pickle)})})}function createPickleArguments(argument,variableCells,valueCells){var result=[];if(!argument)return result;if(argument.type==="DataTable"){var table={rows:argument.rows.map(function(row){return{cells:row.cells.map(function(cell){return{location:pickleLocation(cell.location),value:interpolate(cell.value,variableCells,valueCells)}})}})};result.push(table)}else if(argument.type==="DocString"){var docString={location:pickleLocation(argument.location),content:interpolate(argument.content,variableCells,valueCells)};result.push(docString)}else{throw Error("Internal error")}return result}function interpolate(name,variableCells,valueCells){variableCells.forEach(function(variableCell,n){var valueCell=valueCells[n];var search=new RegExp("<"+variableCell.value+">","g");name=name.replace(search,valueCell.value)});return name}function pickleSteps(scenarioDefinition){return scenarioDefinition.steps.map(function(step){return pickleStep(step)})}function pickleStep(step){return{text:step.text,arguments:createPickleArguments(step.argument,[],[]),locations:[pickleStepLocation(step)]}}function pickleStepLocation(step){return{line:step.location.line,column:step.location.column+(step.keyword?countSymbols(step.keyword):0)}}function pickleLocation(location){return{line:location.line,column:location.column}}function pickleTags(tags){return tags.map(function(tag){return pickleTag(tag)})}function pickleTag(tag){return{name:tag.name,location:pickleLocation(tag.location)}}}module.exports=Compiler},{"../count_symbols":4}],12:[function(require,module,exports){function Token(line,location){this.line=line;this.location=location;this.isEof=line==null}Token.prototype.getTokenValue=function(){return this.isEof?"EOF":this.line.getLineText(-1)};Token.prototype.detach=function(){};module.exports=Token},{}],13:[function(require,module,exports){var DIALECTS=require("./dialects");var Errors=require("./errors");var LANGUAGE_PATTERN=/^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/;module.exports=function TokenMatcher(defaultDialectName){defaultDialectName=defaultDialectName||"en";var dialect;var dialectName;var activeDocStringSeparator;var indentToRemove;function changeDialect(newDialectName,location){var newDialect=DIALECTS[newDialectName];if(!newDialect){throw Errors.NoSuchLanguageException.create(newDialectName,location)}dialectName=newDialectName;dialect=newDialect}this.reset=function(){if(dialectName!=defaultDialectName)changeDialect(defaultDialectName);activeDocStringSeparator=null;indentToRemove=0};this.reset();this.match_TagLine=function match_TagLine(token){if(token.line.startsWith("@")){setTokenMatched(token,"TagLine",null,null,null,token.line.getTags());return true}return false};this.match_FeatureLine=function match_FeatureLine(token){return matchTitleLine(token,"FeatureLine",dialect.feature)};this.match_ScenarioLine=function match_ScenarioLine(token){return matchTitleLine(token,"ScenarioLine",dialect.scenario)};this.match_ScenarioOutlineLine=function match_ScenarioOutlineLine(token){return matchTitleLine(token,"ScenarioOutlineLine",dialect.scenarioOutline)};this.match_BackgroundLine=function match_BackgroundLine(token){return matchTitleLine(token,"BackgroundLine",dialect.background)};this.match_ExamplesLine=function match_ExamplesLine(token){return matchTitleLine(token,"ExamplesLine",dialect.examples)};this.match_TableRow=function match_TableRow(token){if(token.line.startsWith("|")){setTokenMatched(token,"TableRow",null,null,null,token.line.getTableCells());return true}return false};this.match_Empty=function match_Empty(token){if(token.line.isEmpty){setTokenMatched(token,"Empty",null,null,0);return true}return false};this.match_Comment=function match_Comment(token){if(token.line.startsWith("#")){var text=token.line.getLineText(0);setTokenMatched(token,"Comment",text,null,0);return true}return false};this.match_Language=function match_Language(token){var match;if(match=token.line.trimmedLineText.match(LANGUAGE_PATTERN)){var newDialectName=match[1];setTokenMatched(token,"Language",newDialectName);changeDialect(newDialectName,token.location);return true}return false};this.match_DocStringSeparator=function match_DocStringSeparator(token){return activeDocStringSeparator==null?_match_DocStringSeparator(token,'"""',true)||_match_DocStringSeparator(token,"```",true):_match_DocStringSeparator(token,activeDocStringSeparator,false)};function _match_DocStringSeparator(token,separator,isOpen){if(token.line.startsWith(separator)){var contentType=null;if(isOpen){contentType=token.line.getRestTrimmed(separator.length);activeDocStringSeparator=separator;indentToRemove=token.line.indent}else{activeDocStringSeparator=null;indentToRemove=0}setTokenMatched(token,"DocStringSeparator",contentType);return true}return false}this.match_EOF=function match_EOF(token){if(token.isEof){setTokenMatched(token,"EOF");return true}return false};this.match_StepLine=function match_StepLine(token){var keywords=[].concat(dialect.given).concat(dialect.when).concat(dialect.then).concat(dialect.and).concat(dialect.but);var length=keywords.length;for(var i=0,keyword;i0&&lines[lines.length-1].trim()==""){lines.pop()}var lineNumber=0;this.read=function(){var line=lines[lineNumber++];var location={line:lineNumber,column:0};return line==null?new Token(null,location):new Token(new GherkinLine(line,lineNumber),location)}}},{"./gherkin_line":9,"./token":12}]},{},[1]); +if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_TableRow(token)})}function match_Language(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Language(token)})}function match_Other(context,token){if(token.isEof)return false;return handleExternalError(context,false,function(){return context.tokenMatcher.match_Other(token)})}function lookahead_0(context,currentToken){currentToken.detach();var token;var queue=[];var match=false;do{token=readToken(context);token.detach();queue.push(token);if(false||match_ExamplesLine(context,token)){match=true;break}}while(false||match_Empty(context,token)||match_Comment(context,token)||match_TagLine(context,token));context.tokenQueue=context.tokenQueue.concat(queue);return match}}},{"./ast_builder":2,"./errors":6,"./token_matcher":13,"./token_scanner":14}],11:[function(require,module,exports){var countSymbols=require("../count_symbols");function Compiler(){this.compile=function(gherkin_document){var pickles=[];if(gherkin_document.feature==null)return pickles;var feature=gherkin_document.feature;var language=feature.language;var featureTags=feature.tags;var backgroundSteps=[];feature.children.forEach(function(scenarioDefinition){if(scenarioDefinition.type==="Background"){backgroundSteps=pickleSteps(scenarioDefinition)}else if(scenarioDefinition.type==="Scenario"){compileScenario(featureTags,backgroundSteps,scenarioDefinition,language,pickles)}else{compileScenarioOutline(featureTags,backgroundSteps,scenarioDefinition,language,pickles)}});return pickles};function compileScenario(featureTags,backgroundSteps,scenario,language,pickles){var steps=scenario.steps.length==0?[]:[].concat(backgroundSteps);var tags=[].concat(featureTags).concat(scenario.tags);scenario.steps.forEach(function(step){steps.push(pickleStep(step))});var pickle={tags:pickleTags(tags),name:scenario.name,language:language,locations:[pickleLocation(scenario.location)],steps:steps};pickles.push(pickle)}function compileScenarioOutline(featureTags,backgroundSteps,scenarioOutline,language,pickles){scenarioOutline.examples.filter(function(e){return e.tableHeader!=undefined}).forEach(function(examples){var variableCells=examples.tableHeader.cells;examples.tableBody.forEach(function(values){var valueCells=values.cells;var steps=scenarioOutline.steps.length==0?[]:[].concat(backgroundSteps);var tags=[].concat(featureTags).concat(scenarioOutline.tags).concat(examples.tags);scenarioOutline.steps.forEach(function(scenarioOutlineStep){var stepText=interpolate(scenarioOutlineStep.text,variableCells,valueCells);var args=createPickleArguments(scenarioOutlineStep.argument,variableCells,valueCells);var pickleStep={text:stepText,arguments:args,locations:[pickleLocation(values.location),pickleStepLocation(scenarioOutlineStep)]};steps.push(pickleStep)});var pickle={name:interpolate(scenarioOutline.name,variableCells,valueCells),language:language,steps:steps,tags:pickleTags(tags),locations:[pickleLocation(values.location),pickleLocation(scenarioOutline.location)]};pickles.push(pickle)})})}function createPickleArguments(argument,variableCells,valueCells){var result=[];if(!argument)return result;if(argument.type==="DataTable"){var table={rows:argument.rows.map(function(row){return{cells:row.cells.map(function(cell){return{location:pickleLocation(cell.location),value:interpolate(cell.value,variableCells,valueCells)}})}})};result.push(table)}else if(argument.type==="DocString"){var docString={location:pickleLocation(argument.location),content:interpolate(argument.content,variableCells,valueCells)};if(argument.contentType){docString.contentType=interpolate(argument.contentType,variableCells,valueCells)}result.push(docString)}else{throw Error("Internal error")}return result}function interpolate(name,variableCells,valueCells){variableCells.forEach(function(variableCell,n){var valueCell=valueCells[n];var search=new RegExp("<"+variableCell.value+">","g");name=name.replace(search,valueCell.value)});return name}function pickleSteps(scenarioDefinition){return scenarioDefinition.steps.map(function(step){return pickleStep(step)})}function pickleStep(step){return{text:step.text,arguments:createPickleArguments(step.argument,[],[]),locations:[pickleStepLocation(step)]}}function pickleStepLocation(step){return{line:step.location.line,column:step.location.column+(step.keyword?countSymbols(step.keyword):0)}}function pickleLocation(location){return{line:location.line,column:location.column}}function pickleTags(tags){return tags.map(function(tag){return pickleTag(tag)})}function pickleTag(tag){return{name:tag.name,location:pickleLocation(tag.location)}}}module.exports=Compiler},{"../count_symbols":4}],12:[function(require,module,exports){function Token(line,location){this.line=line;this.location=location;this.isEof=line==null}Token.prototype.getTokenValue=function(){return this.isEof?"EOF":this.line.getLineText(-1)};Token.prototype.detach=function(){};module.exports=Token},{}],13:[function(require,module,exports){var DIALECTS=require("./dialects");var Errors=require("./errors");var LANGUAGE_PATTERN=/^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/;module.exports=function TokenMatcher(defaultDialectName){defaultDialectName=defaultDialectName||"en";var dialect;var dialectName;var activeDocStringSeparator;var indentToRemove;function changeDialect(newDialectName,location){var newDialect=DIALECTS[newDialectName];if(!newDialect){throw Errors.NoSuchLanguageException.create(newDialectName,location)}dialectName=newDialectName;dialect=newDialect}this.reset=function(){if(dialectName!=defaultDialectName)changeDialect(defaultDialectName);activeDocStringSeparator=null;indentToRemove=0};this.reset();this.match_TagLine=function match_TagLine(token){if(token.line.startsWith("@")){setTokenMatched(token,"TagLine",null,null,null,token.line.getTags());return true}return false};this.match_FeatureLine=function match_FeatureLine(token){return matchTitleLine(token,"FeatureLine",dialect.feature)};this.match_ScenarioLine=function match_ScenarioLine(token){return matchTitleLine(token,"ScenarioLine",dialect.scenario)};this.match_ScenarioOutlineLine=function match_ScenarioOutlineLine(token){return matchTitleLine(token,"ScenarioOutlineLine",dialect.scenarioOutline)};this.match_BackgroundLine=function match_BackgroundLine(token){return matchTitleLine(token,"BackgroundLine",dialect.background)};this.match_ExamplesLine=function match_ExamplesLine(token){return matchTitleLine(token,"ExamplesLine",dialect.examples)};this.match_TableRow=function match_TableRow(token){if(token.line.startsWith("|")){setTokenMatched(token,"TableRow",null,null,null,token.line.getTableCells());return true}return false};this.match_Empty=function match_Empty(token){if(token.line.isEmpty){setTokenMatched(token,"Empty",null,null,0);return true}return false};this.match_Comment=function match_Comment(token){if(token.line.startsWith("#")){var text=token.line.getLineText(0);setTokenMatched(token,"Comment",text,null,0);return true}return false};this.match_Language=function match_Language(token){var match;if(match=token.line.trimmedLineText.match(LANGUAGE_PATTERN)){var newDialectName=match[1];setTokenMatched(token,"Language",newDialectName);changeDialect(newDialectName,token.location);return true}return false};this.match_DocStringSeparator=function match_DocStringSeparator(token){return activeDocStringSeparator==null?_match_DocStringSeparator(token,'"""',true)||_match_DocStringSeparator(token,"```",true):_match_DocStringSeparator(token,activeDocStringSeparator,false)};function _match_DocStringSeparator(token,separator,isOpen){if(token.line.startsWith(separator)){var contentType=null;if(isOpen){contentType=token.line.getRestTrimmed(separator.length);activeDocStringSeparator=separator;indentToRemove=token.line.indent}else{activeDocStringSeparator=null;indentToRemove=0}setTokenMatched(token,"DocStringSeparator",contentType);return true}return false}this.match_EOF=function match_EOF(token){if(token.isEof){setTokenMatched(token,"EOF");return true}return false};this.match_StepLine=function match_StepLine(token){var keywords=[].concat(dialect.given).concat(dialect.when).concat(dialect.then).concat(dialect.and).concat(dialect.but);var length=keywords.length;for(var i=0,keyword;i0&&lines[lines.length-1].trim()==""){lines.pop()}var lineNumber=0;this.read=function(){var line=lines[lineNumber++];var location={line:lineNumber,column:0};return line==null?new Token(null,location):new Token(new GherkinLine(line,lineNumber),location)}}},{"./gherkin_line":9,"./token":12}]},{},[1]); diff --git a/gherkin/javascript/lib/gherkin/pickles/compiler.js b/gherkin/javascript/lib/gherkin/pickles/compiler.js index 2cd7bdb6854..baccb53ddf6 100644 --- a/gherkin/javascript/lib/gherkin/pickles/compiler.js +++ b/gherkin/javascript/lib/gherkin/pickles/compiler.js @@ -100,8 +100,11 @@ function Compiler() { } else if (argument.type === 'DocString') { var docString = { location: pickleLocation(argument.location), - content: interpolate(argument.content, variableCells, valueCells) + content: interpolate(argument.content, variableCells, valueCells), }; + if(argument.contentType) { + docString.contentType = interpolate(argument.contentType, variableCells, valueCells); + } result.push(docString); } else { throw Error('Internal error'); diff --git a/gherkin/javascript/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/javascript/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/javascript/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/javascript/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/javascript/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/objective-c/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/objective-c/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/objective-c/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/objective-c/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/objective-c/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/perl/lib/Gherkin/Pickles/Compiler.pm b/gherkin/perl/lib/Gherkin/Pickles/Compiler.pm index fe9673193bb..c1e0dbec7c1 100644 --- a/gherkin/perl/lib/Gherkin/Pickles/Compiler.pm +++ b/gherkin/perl/lib/Gherkin/Pickles/Compiler.pm @@ -163,16 +163,16 @@ sub _create_pickle_arguments { } push( @$result, $table ); } elsif ( $argument->{'type'} eq 'DocString' ) { + my $docstring = { + location => $class->_pickle_location( $argument->{'location'} ), + content => $class->_interpolate($argument->{'content'}, $variables, $values), + }; + if(defined $argument->{'contentType'}){ + $docstring->{'contentType'} = $class->_interpolate($argument->{'contentType'}, $variables, $values) + } push( @$result, - { - location => - $class->_pickle_location( $argument->{'location'} ), - content => $class->_interpolate( - $argument->{'content'}, - $variables, $values - ), - } + $docstring ); } else { die "Internal error"; diff --git a/gherkin/perl/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/perl/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/perl/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/perl/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/perl/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/python/gherkin/pickles/compiler.py b/gherkin/python/gherkin/pickles/compiler.py index dca01820b80..617fcfa048a 100644 --- a/gherkin/python/gherkin/pickles/compiler.py +++ b/gherkin/python/gherkin/pickles/compiler.py @@ -114,6 +114,8 @@ def _create_pickle_arguments(argument, variables, values): 'location': _pickle_location(argument['location']), 'content': _interpolate(argument['content'], variables, values) } + if 'contentType' in argument: + docstring['contentType'] = _interpolate(argument['contentType'], variables, values) result.append(docstring) else: diff --git a/gherkin/python/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/python/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/python/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/python/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/python/testdata/good/scenario_outline_with_docstring.feature b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/python/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/ruby/lib/gherkin/pickles/compiler.rb b/gherkin/ruby/lib/gherkin/pickles/compiler.rb index 6be31fef7e4..07d358e032b 100644 --- a/gherkin/ruby/lib/gherkin/pickles/compiler.rb +++ b/gherkin/ruby/lib/gherkin/pickles/compiler.rb @@ -102,6 +102,9 @@ def create_pickle_arguments(argument, variable_cells, value_cells) location: pickle_location(argument[:location]), content: interpolate(argument[:content], variable_cells, value_cells) } + if argument.key?(:contentType) + doc_string[:contentType] = interpolate(argument[:contentType], variable_cells, value_cells) + end result.push(doc_string) else raise 'Internal error' diff --git a/gherkin/ruby/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/ruby/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/ruby/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/ruby/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/ruby/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF diff --git a/gherkin/testdata/good/docstrings.feature.pickles.ndjson b/gherkin/testdata/good/docstrings.feature.pickles.ndjson index f7962837201..4fbf0c46565 100644 --- a/gherkin/testdata/good/docstrings.feature.pickles.ndjson +++ b/gherkin/testdata/good/docstrings.feature.pickles.ndjson @@ -1 +1 @@ -{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":3}],"name":"minimalistic","steps":[{"arguments":[{"content":"first line (no indent)\n second line (indented with two spaces)\n\nthird line was empty","location":{"column":7,"line":5}}],"locations":[{"column":11,"line":4}],"text":"a simple DocString"},{"arguments":[{"content":"\n \n","contentType":"xml","location":{"column":7,"line":12}}],"locations":[{"column":11,"line":11}],"text":"a DocString with content type"},{"arguments":[{"content":"wrongly indented line","location":{"column":7,"line":18}}],"locations":[{"column":9,"line":17}],"text":"a DocString with wrong indentation"},{"arguments":[{"content":"first line\nsecond line","location":{"column":7,"line":22}}],"locations":[{"column":9,"line":21}],"text":"a DocString with alternative separator"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":27}}],"locations":[{"column":9,"line":26}],"text":"a DocString with normal separator inside"},{"arguments":[{"content":"first line\n```\nthird line","location":{"column":7,"line":33}}],"locations":[{"column":9,"line":32}],"text":"a DocString with alternative separator inside"},{"arguments":[{"content":"first line\n\"\"\"\nthird line","location":{"column":7,"line":39}}],"locations":[{"column":9,"line":38}],"text":"a DocString with escaped separator inside"}],"tags":[]},"type":"pickle","uri":"testdata/good/docstrings.feature"} diff --git a/gherkin/testdata/good/scenario_outline_with_docstring.feature b/gherkin/testdata/good/scenario_outline_with_docstring.feature new file mode 100644 index 00000000000..cfa9eef0a1e --- /dev/null +++ b/gherkin/testdata/good/scenario_outline_with_docstring.feature @@ -0,0 +1,12 @@ +Feature: Scenario Outline with a docstring + +Scenario Outline: Greetings come in many forms + Given this file: + """ + Greeting: + """ + +Examples: + | type | content | + | en | Hello | + | fr | Bonjour | diff --git a/gherkin/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson b/gherkin/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson new file mode 100644 index 00000000000..014a9750702 --- /dev/null +++ b/gherkin/testdata/good/scenario_outline_with_docstring.feature.ast.ndjson @@ -0,0 +1 @@ +{"document":{"comments":[],"feature":{"children":[{"examples":[{"keyword":"Examples","location":{"column":1,"line":9},"name":"","tableBody":[{"cells":[{"location":{"column":5,"line":11},"type":"TableCell","value":"en"},{"location":{"column":13,"line":11},"type":"TableCell","value":"Hello"}],"location":{"column":3,"line":11},"type":"TableRow"},{"cells":[{"location":{"column":5,"line":12},"type":"TableCell","value":"fr"},{"location":{"column":13,"line":12},"type":"TableCell","value":"Bonjour"}],"location":{"column":3,"line":12},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":5,"line":10},"type":"TableCell","value":"type"},{"location":{"column":13,"line":10},"type":"TableCell","value":"content"}],"location":{"column":3,"line":10},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":1,"line":3},"name":"Greetings come in many forms","steps":[{"argument":{"content":"Greeting:","contentType":"","location":{"column":5,"line":5},"type":"DocString"},"keyword":"Given ","location":{"column":5,"line":4},"text":"this file:","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Scenario Outline with a docstring","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson b/gherkin/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson new file mode 100644 index 00000000000..934b2fb563f --- /dev/null +++ b/gherkin/testdata/good/scenario_outline_with_docstring.feature.pickles.ndjson @@ -0,0 +1,2 @@ +{"pickle":{"language":"en","locations":[{"column":3,"line":11},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Hello","contentType":"en","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":11},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} +{"pickle":{"language":"en","locations":[{"column":3,"line":12},{"column":1,"line":3}],"name":"Greetings come in many forms","steps":[{"arguments":[{"content":"Greeting:Bonjour","contentType":"fr","location":{"column":5,"line":5}}],"locations":[{"column":3,"line":12},{"column":11,"line":4}],"text":"this file:"}],"tags":[]},"type":"pickle","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/testdata/good/scenario_outline_with_docstring.feature.source.ndjson b/gherkin/testdata/good/scenario_outline_with_docstring.feature.source.ndjson new file mode 100644 index 00000000000..17fadf24dd5 --- /dev/null +++ b/gherkin/testdata/good/scenario_outline_with_docstring.feature.source.ndjson @@ -0,0 +1 @@ +{"data":"Feature: Scenario Outline with a docstring\n\nScenario Outline: Greetings come in many forms\n Given this file:\n \"\"\"\n Greeting:\n \"\"\"\n\nExamples:\n | type | content |\n | en | Hello |\n | fr | Bonjour |\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/scenario_outline_with_docstring.feature"} diff --git a/gherkin/testdata/good/scenario_outline_with_docstring.feature.tokens b/gherkin/testdata/good/scenario_outline_with_docstring.feature.tokens new file mode 100644 index 00000000000..5b91732f813 --- /dev/null +++ b/gherkin/testdata/good/scenario_outline_with_docstring.feature.tokens @@ -0,0 +1,13 @@ +(1:1)FeatureLine:Feature/Scenario Outline with a docstring/ +(2:1)Empty:// +(3:1)ScenarioOutlineLine:Scenario Outline/Greetings come in many forms/ +(4:5)StepLine:Given /this file:/ +(5:5)DocStringSeparator:// +(6:1)Other:/Greeting:/ +(7:5)DocStringSeparator:// +(8:1)Empty:// +(9:1)ExamplesLine:Examples// +(10:3)TableRow://5:type,13:content +(11:3)TableRow://5:en,13:Hello +(12:3)TableRow://5:fr,13:Bonjour +EOF