Skip to content

fix: handle backslash escapes in easyconfig comment stripping - #66

Merged
HaoZeke merged 1 commit into
mainfrom
fix/eb-parse-escaped-quotes
Nov 20, 2026
Merged

HaoZeke merged 1 commit into
mainfrom
fix/eb-parse-escaped-quotes

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

fix: handle backslash escapes in easyconfig comment stripping

strip_comments toggled quote state on every quote byte without
skipping backslash escapes. An escaped quote before # inside a string
closed the string early so the # truncated the line, leaving an
unterminated literal that swallowed later assignments such as
toolchain. Triple-quoted string scanning in both strip_comments and
Parser::parse_string likewise matched escaped quotes as a closing
delimiter, and a continuation line that closed a triple-quoted string
kept any trailing # comment.

Advance past backslash escape pairs while inside single-line or
triple-quoted strings in strip_comments, and skip backslash escapes
when scanning for the closing delimiter in Parser::parse_string.
Trim a trailing # comment on a continuation line when cut falls
after the closing triple quote.

`strip_comments` toggled quote state on every quote byte without
skipping backslash escapes. An escaped quote before `#` inside a string
closed the string early so the `#` truncated the line, leaving an
unterminated literal that swallowed later assignments such as
`toolchain`. Triple-quoted string scanning in both `strip_comments` and
`Parser::parse_string` likewise matched escaped quotes as a closing
delimiter, and a continuation line that closed a triple-quoted string
kept any trailing `#` comment.

Advance past backslash escape pairs while inside single-line or
triple-quoted strings in `strip_comments`, and skip backslash escapes
when scanning for the closing delimiter in `Parser::parse_string`.
Trim a trailing `#` comment on a continuation line when `cut` falls
after the closing triple quote.
@HaoZeke
HaoZeke merged commit 29e253d into main Nov 20, 2026
22 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.

1 participant