specsolutions / deveroom-visualstudio

Visual Studio extension for SpecFlow

Home Page:https://www.specsolutions.eu/services/deveroom/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when backslash is included in DataTable

kstudnik opened this issue · comments

While writing steps, occurred that exception is thrown while parsing backslash in DataTable
While I was creating scenario with such table, I forgot to press Shift key to get |, getting backslash instead:
| TestColumn | TestColumn2\

Error: ParseAndCollectErrors: Exception during Gherkin parsing: System.InvalidOperationException: Enumeration already finished. at System.CharEnumerator.get_Current() at Gherkin.GherkinLine.<SplitCells>d__18.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Gherkin.GherkinLine.d__17.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Gherkin.TokenMatcher.Match_TableRow(Token token) at Gherkin.Parser1.<>c__DisplayClass29_0.<Match_TableRow>b__0()
at Gherkin.Parser1.HandleExternalError[T](ParserContext context, Func1 action, T defaultValue)
at Gherkin.Parser1.Match_TableRow(ParserContext context, Token token) at Gherkin.Parser1.MatchTokenAt_15(Token token, ParserContext context)
at Gherkin.Parser1.MatchToken(Int32 state, Token token, ParserContext context) at Deveroom.VisualStudio.Editor.Services.Parser.DeveroomGherkinParser.InternalParser.MatchToken(Int32 state, Token token, ParserContext context) at Gherkin.Parser1.Parse(ITokenScanner tokenScanner, ITokenMatcher tokenMatcher)
at Deveroom.VisualStudio.Editor.Services.Parser.DeveroomGherkinParser.Parse(TextReader featureFileReader, String sourceFilePath)
at Deveroom.VisualStudio.Editor.Services.Parser.DeveroomGherkinParser.ParseAndCollectErrors(String featureFileContent, IDeveroomLogger logger, DeveroomGherkinDocument& gherkinDocument, List1& parserErrors)

Note: With Gherkin 6 the stack trace is

Error: ParseAndCollectErrors: Exception during Gherkin parsing: System.InvalidOperationException: Enumeration already finished.
   at System.CharEnumerator.get_Current()
   at Gherkin.GherkinLine.<SplitCells>d__18.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Gherkin.GherkinLine.<GetTableCells>d__17.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Gherkin.TokenMatcher.Match_TableRow(Token token)
   at Gherkin.Parser`1.<>c__DisplayClass29_0.<Match_TableRow>b__0()
   at Gherkin.Parser`1.HandleExternalError[T](ParserContext context, Func`1 action, T defaultValue)
   at Gherkin.Parser`1.Match_TableRow(ParserContext context, Token token)
   at Gherkin.Parser`1.MatchTokenAt_16(Token token, ParserContext context)
   at Gherkin.Parser`1.MatchToken(Int32 state, Token token, ParserContext context)
   at Deveroom.VisualStudio.Editor.Services.Parser.DeveroomGherkinParser.InternalParser.MatchToken(Int32 state, Token token, ParserContext context)
   at Gherkin.Parser`1.Parse(ITokenScanner tokenScanner, ITokenMatcher tokenMatcher)
   at Deveroom.VisualStudio.Editor.Services.Parser.DeveroomGherkinParser.Parse(TextReader featureFileReader, String sourceFilePath)
   at Deveroom.VisualStudio.Editor.Services.Parser.DeveroomGherkinParser.ParseAndCollectErrors(String featureFileContent, IDeveroomLogger logger, DeveroomGherkinDocument& gherkinDocument, List`1& parserErrors)

Fixed. The fix will be released in a few days.

Released as v1.4.0