Skip to content

Commit

Permalink
Try some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mpkorstanje committed Apr 13, 2024
1 parent 40a1600 commit 5ec2551
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dotnet/Gherkin/GherkinLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ private IEnumerable<Tuple<string, int>> SplitCells(string row)
cell = "";
startPos = pos;
} else if (c == GherkinLanguageConstants.TABLE_CELL_ESCAPE_CHAR) {
rowEnum.MoveNext();
bool hasNext = rowEnum.MoveNext();
pos++;
c = rowEnum.Current;
c = hasNext ? rowEnum.Current : '';

Check failure on line 130 in dotnet/Gherkin/GherkinLine.cs

View workflow job for this annotation

GitHub Actions / test-dotnet

Empty character literal

Check failure on line 130 in dotnet/Gherkin/GherkinLine.cs

View workflow job for this annotation

GitHub Actions / test-dotnet

Empty character literal

Check failure on line 130 in dotnet/Gherkin/GherkinLine.cs

View workflow job for this annotation

GitHub Actions / test-dotnet

Empty character literal
if (c == GherkinLanguageConstants.TABLE_CELL_NEWLINE_ESCAPE) {
cell += "\n";
} else {
Expand Down
9 changes: 6 additions & 3 deletions perl/lib/Gherkin/Line.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ sub _split_table_cells_iterator {
return ( $cell, $start_col );
}
} elsif ( $char eq "\\" ) {
$row =~ s/^(.)// || die "Unpossible";
$col += 1;
$cell .= '\\' . $1;
if ($row =~ s/^(.)//) {
$col += 1;
$cell .= '\\' . $1;
} else {
$cell .= '\\';
}
} elsif ( defined $char ) {
$cell .= $char;
} else {
Expand Down

0 comments on commit 5ec2551

Please sign in to comment.