Skip to content

Fix escape handling for emoji #️⃣ in string literals #1520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

kishikawakatsumi
Copy link
Contributor

This pull request addresses an issue with the escape handling when counting the number of # characters in string literals. Previously, the code didn't consider the emoji #️⃣ presence. This resulted in incorrect escape counts.

For example, the string literal generated from the string foo "#️⃣"bar would be ##"foo "#️⃣"bar "##, but the current implementation generates #"foo "#️⃣"bar "#. This literal will result in a compile error because the escape is incomplete.

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thanks. This looks good to me

@ahoppen
Copy link
Member

ahoppen commented Apr 12, 2023

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge April 12, 2023 19:17
@ahoppen ahoppen merged commit 5ebe104 into swiftlang:main Apr 12, 2023
@ahoppen
Copy link
Member

ahoppen commented Apr 12, 2023

Thanks for contributing to Swift @kishikawakatsumi!

@kishikawakatsumi kishikawakatsumi deleted the string-literal-escape branch April 12, 2023 22:59
ahoppen added a commit to ahoppen/swift-syntax that referenced this pull request Apr 18, 2023
…l-escape

Fix escape handling for emoji `#️⃣` in string literals
ahoppen added a commit to ahoppen/swift-syntax that referenced this pull request Apr 18, 2023
…l-escape

Fix escape handling for emoji `#️⃣` in string literals
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