Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix quote handling at end of block string descriptions (#355)
* test: add test demonstrating quotes at end of description bug When a block string description ends with quotes immediately followed by triple quotes, the parser fails with an "Unexpected <Invalid>" error. This test demonstrates the issue by comparing a working case (with space between the quote and closing triple quotes) and the failing case. * fix: properly handle quote characters at end of block string descriptions The lexer was incorrectly handling the case where a quote character (") appeared immediately before the closing triple quotes ("""). The fix changes how the lexer identifies closing triple quotes: - When a quote character is encountered, we now count consecutive quotes - If there are 3 or more quotes in a row, we treat the last 3 as the closing triple quote - Any extra quotes (beyond the closing 3) are added to the string content This handles cases like: - """This is a "test"""" (quote followed by closing triple quotes) - """This is a ""test""""" (multiple quotes followed by closing triple quotes)
- Loading branch information