Skip to content

Add Grapheme Breaking and Normalization #146

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
Feb 14, 2022
Merged

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented Feb 3, 2022

This adds the Unicode data needed and the stdlib implementations of grapheme breaking and normalization for use in _StringProcessing.

@Azoy Azoy requested a review from milseman February 3, 2022 20:05
.target(
name: "_StringProcessing",
dependencies: ["_MatchingEngine"],
dependencies: ["_MatchingEngine", "_CUnicode"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I don't think we can add arbitrary dependencies for _MatchingEngine or _StringProcessing until we 1) set up cmake on the compiler side to produce the _CUnicode module and 2) coordinate with @edymtt for internal builds.

Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to avoid _CUnicode?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can build the C files as part of _StringProcessing via CMake? But I’m not sure how you can do that using SwiftPM.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any reason why the two build systems have to work the same way. If we need to include these directly in the CMake build for now, let's do that.

@@ -33,13 +33,13 @@

enum UnsafeAssumingValidUTF8 {
@inlinable @inline(__always)
public func decode(_ x: UInt8) -> Unicode.Scalar {
public static func decode(_ x: UInt8) -> Unicode.Scalar {
Copy link
Member

Choose a reason for hiding this comment

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

Part of moving these into the _StringProcessing module should be dropping all public keywords, since _StringProcessing will be supplying API as well.

@Azoy Azoy force-pushed the we-have-the-data branch 2 times, most recently from 6a0be4c to 3590876 Compare February 14, 2022 06:55
Add Grapheme Breaking and Normalization

make it compatible with how the compiler will build it
@Azoy
Copy link
Contributor Author

Azoy commented Feb 14, 2022

@swift-ci please test Linux

@Azoy Azoy merged commit 806df91 into swiftlang:main Feb 14, 2022
@Azoy Azoy deleted the we-have-the-data branch February 14, 2022 21:50
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.

4 participants