Whitespace either side of a table row is stripped.
The table row is passed to a function to strip and yields its cell values
Characters in each cell are iterated over to handle them appropriately, such as new columns (|), escape characters, etc.
As escape characters are typically followed by a special character (e.g. n, t), when an escape character is detected \\ an additional next call is made to grab the next character
As in step 1, whitespace after a trailing escape character (\\) would be stripped, there would not be a following character and a StopIteration error is raised.
By defaulting the iterator to an empty string, when there is a trailing escape character, the trailing escape character will not trigger a StopIteration error and subsequent code will appropriately raise an inconsistent cell count error message.
β‘οΈ What's your motivation?
Fixes #223
π·οΈ What kind of change is this?
:bug: Bug fix (non-breaking change which fixes a defect)
π€ What's changed?
With the Python implementation:
|
), escape characters, etc.n
,t
), when an escape character is detected\\
an additionalnext
call is made to grab the next character\\
) would be stripped, there would not be a following character and aStopIteration
error is raised.https://github.com/cucumber/gherkin/blob/b055261c59f5f905fe637b230017054250c6ebb5/python/gherkin/gherkin_line.py#L39-L62
By defaulting the iterator to an empty string, when there is a trailing escape character, the trailing escape character will not trigger a
StopIteration
error and subsequent code will appropriately raise aninconsistent cell count
error message.β‘οΈ What's your motivation?
π·οΈ What kind of change is this?
β»οΈ Anything particular you want feedback on?
π Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.