`Calendar.RecurrenceRule.End` is de-facto an enum, but has been implemented as a
struct so we can more easily extend it in the future without breaking ABI. Sadly
the current API only provides a way to construct the struct, and does not let us
introspect the associated values. This change adds a couple read-only properties
to the struct to address this.
While at it, we also make the struct conform to `CustomStringConvertible`, so it
doesn't leak implementation details when it's printed in the debugger.
* Enable wasi-libc emulation features
Those features require explicit macro definitions to be enabled, so add
them to the package definition. Only affects WASI builds.
* Prefer `TARGET_OS_WASI` over `__wasi__`
And explain why we need definition checks for `signal.h` and `sys/mman.h`
SPM does not permit building macro tests on Windows due to mishandling
of build types, resulting in multiply defined `main` which is a strong
error on Windows. As a workaround, remove the macro tests for the time
being.
* rdar://108152217 Start using Rope for attribute run storage
- Replace `Array<_InternalRun>` with `Rope<_InternalRun>`.
- Fix semantics of AttributeRunBoundaries.character. It no longer pretends that attributes can be tied to grapheme clusters — that never actually worked properly, and it cannot be supported without breaking the intended use case.
- Remove cache of latest run position; log(n) might be fast enough that we don’t need to worry about that.
- Switch AttributedString.Guts members to take/return BigString.Index values, not AttributedString indices. This cuts down on constant back-and-forth conversions.
- Discard unused Guts members; update remaining mutation methods to follow Swift naming conventions.
- Stop using the `public extension` language misfeature.
* rdar://108152217 Apply notes from code review
AttributedString.CharacterView and AttributedString.UnicodeScalarView
did not use the right semantics in the case when the underlying text
was not touched. It’s okay in that case to not mutate text storage,
but we still want to override the attributes within the subrange as if
the client actually did replace text — as in, we want to use precisely
the same attribute storage for the range on both paths.
Also, make sure we correctly enforce attribute constraints in the
`!hasStringChanges` case, in both views.
* rdar://108152217 Fix logic error in AttributedString.Runs.subscript
(Discovered during code review.)
* rdar://108152217 Clean up CharacterView/UnicodeScalarView mutations & update failing test
* rdar://108152217 Apply review notes
This adds a conditional handling of `FoundationInternationalization`
tests if the `RegexBuilder` module is available. This currently is
unavailable on Windows, which prevents building a complete set of
targets. Adjust the build to accommodate this configuration and
automatically enable the tests when the module is available.
We need to define this macro to avoid warnings due to the use of
non-bounded buffer operations. Without this, we end up with an
overwhelming number of warnings.
* Revert "Create FoundationInternals, an internal module to host shared files used by FoundationInternationalization and FoundationEssentials (#101)"
This reverts commit 8f08a649db1f3eb31593cdae7a30c5e95cb614a7.
* Reapply fb718cd3fb9f058a5fd6d736cec9c2b99d6f7dc6 fix to the other restored LockedState
* Create FoundationInternals, an internal module to host shared files used by FoundationInternationalization and FoundationEssentials
- Modules will access FoundationInternals types with `package import FoundationInternals`. This is currently an experimental feature of `AccessLevelOnImport`.
- Move `LockedState` to FoundationInternals and publicize functions needed by other modules.
* rdar://107778676 Stop vendoring the Collections package
* rdar://107778676 Fix test expectation
AttributedString.CharacterView needs to round all indices down to the
nearest Character boundary to avoid semantic issues with its
Collection conformance. This means that CharacterView slices can never
start or end in between Character boundaries.
* Remove a stray print statement