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

Ensure that non-ASCII characters are escaped when emitting to KORE #3489

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

Scott-Guest
Copy link
Contributor

Part of #3344

Previously, any non-ASCII character present in a String or Bytes was erroneously emitted as-is to the KORE (*.kore files are presumed ASCII-only). This PR ensures that such characters are escaped instead.

That is, a string like "!µƩ🌍\\" used to be emitted as \dv{SortString{}}("!µƩ🌍\\")} but will now instead be emitted as \dv{SortString{}}("!\xb5\u01a9\U0001f30d\\")

@Scott-Guest Scott-Guest self-assigned this Jul 5, 2023
@Scott-Guest Scott-Guest requested a review from radumereuta July 5, 2023 13:48
@Scott-Guest Scott-Guest marked this pull request as ready for review July 5, 2023 13:48
Copy link
Contributor

@radumereuta radumereuta left a comment

Choose a reason for hiding this comment

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

What are the implications for the backends now? Do they even care?

@Scott-Guest
Copy link
Contributor Author

What are the implications for the backends now? Do they even care?

@radumereuta The backends and the KORE syntax specification already assume that all non-ASCII characters are given as escape sequences, so this is really just a bug fix in the frontend, and there're no further implications from this change alone.

(There is still a lot of work to be done re #3344 to actually get the semantics of these escape sequences handled correctly in the backends though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants