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

Add \xHH Unicode escape code to basic strings #796

Merged
merged 4 commits into from
Jul 30, 2022

Conversation

eksortso
Copy link
Contributor

Per a conversation in #622, this PR adds a two-character \x escape code sequence for the first 256 Unicode code points. This provides a short explicit sequence for, among other code points: ASCII characters, certain control characters, and whitespace characters such as tab (\x09) and space (\x20) that need visible representation without resorting to longer \u and \U codes. Such sequences are commonly found in languages that also support the \u and \U codes for Unicode.

This PR replaces #709 and is intended for a post-v1.0.0 version of the TOML standard.

@marzer
Copy link
Contributor

marzer commented Nov 5, 2021

@pradyunsg Where did we land with this? It seems like a friction-free addition to the language (and one that would bring TOML in line with many other languages which also support \x). It's also practically free for implementers since the code paths that would already be handling \u and \U can be trivially extended to support \x.

@pradyunsg
Copy link
Member

Yea, let's do this.

@marzer
Copy link
Contributor

marzer commented Nov 16, 2021

@eksortso Do you have time to update this PR against the current master? If not I'm happy to fork your changes and look after it.

@eksortso
Copy link
Contributor Author

I'll update it later this evening.

@marzer
Copy link
Contributor

marzer commented Nov 17, 2021

Awesome, thanks @eksortso

@eksortso
Copy link
Contributor Author

@marzer I think that's got it.

@eksortso
Copy link
Contributor Author

The second change to CHANGELOG.md dresses up the bare URL for toml.io, just to appease the linter. I'll undo it if necessary.

@eksortso
Copy link
Contributor Author

eksortso commented May 3, 2022

For some reason I'd thought this had already been taken care of. It's up to date again.

@marzer @pradyunsg Care to take look at it?

Copy link
Contributor

@ChristianSi ChristianSi left a comment

Choose a reason for hiding this comment

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

Looks good otherwise!

CHANGELOG.md Outdated Show resolved Hide resolved
@eksortso
Copy link
Contributor Author

eksortso commented Jun 6, 2022

@pradyunsg Any updates on this? Is the issue with pre-commit.ci impeding merges? Or are you planning a larger roadmap for the next release of TOML?

@pradyunsg pradyunsg merged commit 61ad52a into toml-lang:main Jul 30, 2022
@eksortso eksortso deleted the unicode_escapes branch July 30, 2022 15:42
@pradyunsg
Copy link
Member

Thanks @eksortso! ^>^

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.

None yet

5 participants