Skip to content
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

[Backport 1.16] fix: Double quotes in string literal are escaped #785

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

saig0
Copy link
Member

@saig0 saig0 commented Dec 20, 2023

Description

Backport of #780 to 1.16.

relates to #778

Add a test case to verify that double quotes are properly escaped in a string literal.

(cherry picked from commit f717199)
We should handle escaped double quotes in string literals properly (e.g. `"hello \"FEEL\"!"`). Currently, the quotes are doubled escaped (`"hello \\\"FEEL\\\"!"` but should be `"hello \"FEEL\"!"`).

Move the translation of the escape characters to the parsing of the string literal because only string literal can contain these characters. Translating the whole expression would break the parsing.

(cherry picked from commit 630ce93)
@saig0 saig0 requested a review from nicpuppa December 20, 2023 10:19
@saig0
Copy link
Member Author

saig0 commented Dec 20, 2023

@nicpuppa manual backport of #780.

Copy link
Contributor

@nicpuppa nicpuppa left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@saig0 saig0 merged commit 568a920 into 1.16 Dec 20, 2023
2 checks passed
@saig0 saig0 deleted the 778-escape-double-quotes-1.16 branch December 20, 2023 13:18
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