-
Notifications
You must be signed in to change notification settings - Fork 10.5k
UTF8Span #78531
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
UTF8Span #78531
Conversation
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci Please Build Toolchain macOS Platform |
1 similar comment
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci Please Build Toolchain macOS Platform |
@swift-ci please test |
4 similar comments
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
Internal refactoring. Validation now produces a (discardable) reason validation failed (only checked on slow-path). _hasGraphemeBreakBetween has been refactored to represent its quick-check nature.
@swift-ci please test |
1 similar comment
@swift-ci please test |
wip: closer to proposal wip wip: more implementation wip: add back in comparison functions wip: more iterator testing Detangle grapheme breaking guts from string guts Further untangling wip wip: use internal grapheme breaking Call internal impl directly wip refactoring wip: might be broken wip: update to lifetime changes wip: wire up nfc quick check wip: validation error rename SQUASH ME: unsafe annotations, final API wip: fixup availability wip: re-arrange availability wip: x86 abi additions wip: fix availability wip: Windows build support wip: refine assertions
(As a note for the future, since bot history got removed, full CI testing passed.) |
@swift-ci please test |
@swift-ci please test |
Passing CI build: https://ci.swift.org/job/swift-PR-macos/21480/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build changes seem fine to me.
Runtimes/Core/core/CMakeLists.txt
Outdated
UTF8SpanFundamentals.swift | ||
UTF8SpanInternalHelpers.swift | ||
UTF8SpanIterators.swift | ||
UTF8EncodingError.swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this sorted properly? Should they be ordered around UTF8.swift
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through and put them in alphabetical order, thanks.
@inline(__always) func guaranteeIn(_ f: (UInt8) -> Bool) throws(UTF8ValidationError) { | ||
guard let cu = unsafe iter.next() else { throw UTF8ValidationError() } | ||
guard f(cu) else { throw UTF8ValidationError() } | ||
@inline(__always) func guarantee( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@inline(__always) func guarantee( | |
@inline(__always) | |
internal func guarantee( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nested function, so we can't attach internal
to it.
} | ||
@inline(__always) func guaranteeContinuation() throws(UTF8ValidationError) { | ||
try guaranteeIn(UTF8.isContinuation) | ||
@inline(__always) func guaranteeContinuation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@inline(__always) func guaranteeContinuation( | |
@inline(__always) | |
internal func guaranteeContinuation( |
Co-authored-by: Guillaume Lessard <[email protected]>
Co-authored-by: Guillaume Lessard <[email protected]>
@swift-ci please test |
@swift-ci please test linux platform |
@swift-ci please test windows platform |
@swift-ci please test linux platform |
@swift-ci please test |
Add support for UTF8Span Also, refactor validation and grapheme breaking
CI Toolchain status
Current toolchain: https://ci.swift.org/job/swift-PR-toolchain-macos/1865/artifact/branch-main/swift-PR-78531-1865-osx.tar.gz
Usage
Before unpacking the tar ball, clear attributes via
xattr -c swift-PR-78531-*.tar
Use
DYLD_LIBRARY_PATH
and the bundledswift
executable viaKnown issues
String.utf8Span
property is unavailable, pending [SE-0456] Span properties over utf8 views #80116.checkForNFC(quickCheck: true)
is unavailable, pending some more internal refactoringcanonicallyPrecedes
is still calledisCanonicallyLessThan