Skip to content

fix(lexer): 🩹 handle escaped quotes in single-quoted strings#51

Merged
erikmunkby merged 1 commit intoerikmunkby:mainfrom
olexanderos:fix/escaped-qootes-parsing
Jan 28, 2026
Merged

fix(lexer): 🩹 handle escaped quotes in single-quoted strings#51
erikmunkby merged 1 commit intoerikmunkby:mainfrom
olexanderos:fix/escaped-qootes-parsing

Conversation

@olexanderos
Copy link
Contributor

The lexer was incorrectly stopping at the first single quote encountered, without checking for YAML's escape sequence (two consecutive single quotes ''). This caused parsing errors for strings containing escaped quotes.

Updated _parse_quoted_scalar to detect and skip escaped single quotes by checking if a quote is followed by another quote of the same type. Added test case to verify proper parsing of complex single-quoted strings with multiple escaped quotes.

The lexer was incorrectly stopping at the first single quote encountered, without checking for YAML's escape sequence (two consecutive single quotes ''). This caused parsing errors for strings containing escaped quotes.

Updated _parse_quoted_scalar to detect and skip escaped single quotes by checking if a quote is followed by another quote of the same type. Added test case to verify proper parsing of complex single-quoted strings with multiple escaped quotes.
@erikmunkby erikmunkby merged commit d77198d into erikmunkby:main Jan 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants