Skip to content

Initial Unicode module #65

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 2 commits into from
Dec 13, 2021
Merged

Conversation

milseman
Copy link
Member

@milseman milseman commented Dec 10, 2021

This includes a port of UnicodeHelpers.swift from the standard library, and stubs for other stuff.

@milseman milseman requested a review from Azoy December 10, 2021 19:47
@atrick
Copy link

atrick commented Dec 10, 2021

I don't get why a public decode function would take anything other than a raw pointer. The type to decode is explicit in the signature. A typed pointer is never the right way to view a block of memory that's about to be decoded.

If this is about wanting to internally work with a Collection of CodeUnit, so subscripting does the scaling-by-stride for you, then I'd use a trivial UnicideCodeUnit wrapper over the raw pointer.

@karwa
Copy link

karwa commented Dec 10, 2021

We need Unicode functionality without allocating a String as an intermediary
...
We can't be bothered to consistently contribute to the stdlib because it's so painful

Preach it! 🙌

@milseman
Copy link
Member Author

@atrick good point, we should change that (or have both overloads). As you know, there is no contiguousRawStorageIfAvailable equivalent, so types may live on for a while.

We’d want to migrate to a move only safe view as soon as that’s available. If anything, this module could be a prime example of why that’s so vital.

@milseman
Copy link
Member Author

@swift-ci please test linux platform

@milseman
Copy link
Member Author

Merging to unblock some lexer work.

@milseman milseman merged commit a6a31b0 into swiftlang:main Dec 13, 2021
@milseman milseman deleted the ubiquitous_cipher branch December 13, 2021 21:28
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.

3 participants