Skip to content

[fix] Appropriately \# in single-quoted strings - #950

Open
reese wants to merge 2 commits into
trunkfrom
reese-918
Open

[fix] Appropriately \# in single-quoted strings#950
reese wants to merge 2 commits into
trunkfrom
reese-918

Conversation

@reese

@reese reese commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Closes #918

Backlashes before # in a single-quoted string are not signaling an escape character, so in the string conversion machinery, we should not skip the # character and let it decide whether the # separately needs to be escaped (for '#@foo' etc.).

fn single_quoted_literal_backslash_hash_dollar_not_interpolated() {
assert_eq!(
single_to_double_quoted(b"\\#$g", b"'", b"'").as_ref(),
b"\\\\\\#$g"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot of backslashes.

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.

Behavior Change: \# Not Handled Properly

2 participants