From a911caa0e1470866aa0bd1f785c577a7e7b18707 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 13 Apr 2024 17:30:38 +0200 Subject: [PATCH] Fix compile --- dotnet/Gherkin/GherkinLine.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dotnet/Gherkin/GherkinLine.cs b/dotnet/Gherkin/GherkinLine.cs index ac2239327..5c92bad1c 100644 --- a/dotnet/Gherkin/GherkinLine.cs +++ b/dotnet/Gherkin/GherkinLine.cs @@ -126,15 +126,19 @@ private IEnumerable> SplitCells(string row) startPos = pos; } else if (c == GherkinLanguageConstants.TABLE_CELL_ESCAPE_CHAR) { bool hasNext = rowEnum.MoveNext(); - pos++; - c = hasNext ? rowEnum.Current : ""; - if (c == GherkinLanguageConstants.TABLE_CELL_NEWLINE_ESCAPE) { - cell += "\n"; - } else { - if (c.ToString() != GherkinLanguageConstants.TABLE_CELL_SEPARATOR && c != GherkinLanguageConstants.TABLE_CELL_ESCAPE_CHAR) { - cell += GherkinLanguageConstants.TABLE_CELL_ESCAPE_CHAR; + if(hasNext) { + pos++; + c = rowEnum.Current; + if (c == GherkinLanguageConstants.TABLE_CELL_NEWLINE_ESCAPE) { + cell += "\n"; + } else { + if (c.ToString() != GherkinLanguageConstants.TABLE_CELL_SEPARATOR && c != GherkinLanguageConstants.TABLE_CELL_ESCAPE_CHAR) { + cell += GherkinLanguageConstants.TABLE_CELL_ESCAPE_CHAR; + } + cell += c; } - cell += c; + } else { + cell += GherkinLanguageConstants.TABLE_CELL_ESCAPE_CHAR; } } else { cell += c;