56 Commits

Author SHA1 Message Date
Jeremy Schonfeld
63ee09c520
rdar://107321451 (Predicate should support Collection subscripts for Index and Range<Index>) (#49) 2023-04-24 13:30:06 -07:00
Tony Parker
701c89647a
Fix fast-path for [Int] inserting a trailing comma (rdar://108386573) (#51)
* Add some links to known issues to TODOs

* Fix fast-path for [Int] inserting a trailing comma (rdar://108386573)
2023-04-23 11:32:07 -07:00
Jeremy Schonfeld
74559afbea
rdar://104093459 (Adopt the new Reflection Package to AttributedString) (#48) 2023-04-19 11:21:17 -07:00
Tony Parker
d1cc2ea0a2
Add some links to known issues to TODOs (#47) 2023-04-18 14:53:06 -07:00
Charles Hu
0ac5999256
rdar://107847458 (Fix FoundationPreview CalendarTests on Linux) (#36) 2023-04-18 13:59:56 -07:00
Jeremy Schonfeld
ce38824e5a
(108066094) Make PredicateBindings.init variadic (#31) 2023-04-18 11:03:57 -07:00
Charles Hu
9e0cf5c070
JSON Performance Improvements (#35)
* (rdar://106881898) JSONEncoder should only use references for JSON encoding tree

* (rdar://107967520) Initial opportunities for JSONEncoder performance optimization

---------

Co-authored-by: Kevin Perry <kperry@apple.com>
2023-04-18 11:03:30 -07:00
Charles Hu
61d6ca6021
rdar://107729601 (Move Error to FoundationPreview) (#1153) (#28)
* rdar://107729601 (Move Error to FoundationPreview)

* rdar://107729601 -- Use stub URL and regular String Encoding

* rdar://107729601 -- Take out RawRepresentable conformance, because changing it was an ABI break

* rdar://107729601 -- Rename Error.swift to CocoaError.swift

Co-authored-by: Tony Parker <anthony.parker@apple.com>
2023-04-17 18:24:36 -07:00
Charles Hu
c01e9dadee
rdar://107955097 (FoundationPreview: Batch move string API (continued)) (#34)
* rdar://107955097 (FoundationPreview: Batch move string API (continued))

- Move localized uppercase and lowercase to FoundationLocalization
- if-def out of CharacterSet from FoundationPreview. It's not implemented at all there, and having a no-op stub is misleading

* rdar://107955097 (FoundationPreview: Batch move string API (continued))

- Move components separated by string and range of string functions

* rdar://107955097 (FoundationPreview: Batch move string API (continued))

Enable snake case options for JSON encoder and decoder. We haven't been able to enable this option because it needed `CharacterSet`, which hasn't been properly implemented for FoundationPreview. Now that we have `BuiltInUnicodeScalarSet`, which mirrors `CharacterSet`, we can switch to that and enable the options.

* rdar://107955097 (FoundationPreview: Batch move string API (continued))

- Move `StringProtocol.lineRange(for:)` and `paragraphRange(for:)` to FoundationEssentials
- Rename String+Regex.swift to RegexPatternCache.swift
- Consolidate extensions on various String family members and remove one redundant swift file

---------

Co-authored-by: I-Ting Tina Liu <iting_liu@apple.com>
2023-04-17 18:23:51 -07:00
Guillaume Lessard
ecd52ceb38
rdar://108073576 (Don't expose BufferView's baseAddress property) (#32)
* Clarify use of unsafe code and call to memcmp

* Do not expose a BufferView’s `baseAddress`
2023-04-17 16:37:12 -07:00
Guillaume Lessard
450cf1c600
Improve deallocation of copied buffer (#26) 2023-04-14 17:50:37 -07:00
Guillaume Lessard
4b8a234a5b
Rename the docStart parameter to fullSource 2023-04-11 15:07:33 -07:00
Guillaume Lessard
bf0990beea
rename cursor to index in 2 more places
# Conflicts:
#	Sources/FoundationEssentials/JSON/JSON5Scanner.swift
2023-04-11 14:43:07 -07:00
Guillaume Lessard
fb332a8b28
pass buffer as context reference
- this prevents what is effectively as an address escape, and allows better control of index bounds.
2023-04-11 14:14:43 -07:00
Guillaume Lessard
47e4910fc0
update two-byte hex decoding
Use the same decoding method for two-byte hex sequences as for four-byte hex sequences.
2023-04-11 10:59:48 -07:00
Guillaume Lessard
aaa9d2cfbd
split out slow path of stringValue() 2023-04-11 10:59:48 -07:00
Guillaume Lessard
5d6ab4a2ab
add helpful labels to more return tuples 2023-04-11 10:59:47 -07:00
Guillaume Lessard
5091f252c2
Rename DocumentReader’s index properties 2023-04-11 10:59:47 -07:00
Guillaume Lessard
679fab1ff2
label a return tuple 2023-04-11 10:59:47 -07:00
Guillaume Lessard
4f7af4851a
update a conditionally-compiled section 2023-04-11 10:59:47 -07:00
Guillaume Lessard
1ab3832106
layer json decoding over bufferview 2023-04-11 10:59:47 -07:00
Guillaume Lessard
bd712abbc3
change sourceLocation to use UnsafeRawPointer 2023-04-11 10:57:45 -07:00
Guillaume Lessard
6a4eeceb41
Merge pull request #24 from glessard/bufferview
Adjust code formatting
2023-04-11 10:45:51 -07:00
Guillaume Lessard
9fe8623124
adjust code formatting
- also incorporates some performance annotations added for the JSON decoder.
2023-04-11 10:26:37 -07:00
Charles Hu
2095f3cf69 rdar://107533913 (Move FormatStyles to FoundationPreview) 2023-04-10 17:18:23 -07:00
Jeremy Schonfeld
818b7daea1
Merge pull request #19 from jmschonfeld/sendable-attrstr
rdar://100474708 (Make AttributedString Sendable)
2023-04-10 12:47:04 -07:00
Guillaume Lessard
1b27c1cba7
make initializers from BufferPointer failable 2023-04-05 12:57:06 -07:00
Guillaume Lessard
49cf29f735
remove unnecessary public keywords 2023-04-04 17:20:50 -07:00
Guillaume Lessard
fe89db476a
remove dependsOn parameter
- it is not useful without compiler support.
2023-04-04 17:02:31 -07:00
Guillaume Lessard
c4a08fc971
remove commented-out code 2023-04-03 19:26:30 -07:00
Guillaume Lessard
8095d73d8a
add the copyright notice 2023-04-03 12:48:35 -07:00
Guillaume Lessard
b6d610d626
add internal BufferView prototype 2023-04-03 12:16:27 -07:00
Jeremy Schonfeld
82baceef48 rdar://100474708 (Make AttributedString Sendable) 2023-04-03 10:41:22 -07:00
Charles Hu
c1f0bfe065 Enabled more tests 2023-03-29 09:56:30 -07:00
Charles Hu
e2c177e867 Rebased on top of the new String APIs 2023-03-29 09:56:22 -07:00
Tina Liu
2f2ae679f6 rdar://107156343 (Rebased JSONEncoder on top of new String changes) 2023-03-29 09:56:15 -07:00
Charles Hu
34c45c169c rdar://107156343 (Move JSONEncoder to FoundationPreview) 2023-03-29 09:56:00 -07:00
Tony Parker
4400b9dd52 rdar://106792309 (Fix regression) 2023-03-28 19:38:21 -07:00
Jeremy Schonfeld
b5d51f44ba rdar://106320664 (Added debug description to UUID) 2023-03-28 19:38:04 -07:00
Tony Parker
04c1dcc17e rdar://102214045: Override supportsSecureCoding in Swift subclass 2023-03-28 19:36:09 -07:00
Tony Parker
0106af2723 rdar://105186248 (Fix more warnings in Swift) 2023-03-28 19:35:50 -07:00
Tony Parker
8de92d1bdf rdar://102214045 -- Use NSString instead of NSObject 2023-03-28 19:35:18 -07:00
Tony Parker
71dfec2bc4 rdar://102214045 (Re-core NSUUID on Swift UUID struct) 2023-03-28 19:35:10 -07:00
Charles Hu
421eff1f5a
Merge pull request #11 from jmschonfeld/attributedstring
rdar://106775060 (Move AttributedString to FoundationPreview)
2023-03-27 17:26:59 -07:00
I-Ting Tina Liu
6e4c75c143 Work towards: rdar://107140336 (FoundationPreview: Batch move string API)
Move case mapping API to FoundationEssentials and FoundationInternationalization:
- Essentials: Unlocalized caplitalized
- Internationalization: Localized caplitalized, lowercased, uppercased

Note that in the tests, we test the internal implementation instead of the public function. This is because these functions are declared as public function of
`extension StringProtocol`, so there are two declarations on Darwin: once in FoundationPreview and once in system SDK. There is currently no way to specify which one is intended when building the package on Darwin.
2023-03-23 17:10:40 -07:00
I-Ting Tina Liu
cde55ba8e1 rdar://106965817 (FoundationEssentials: Internal character set)
Add a Swift-native character set that mirrors CF/NSCharacterSet to support FoundationEssentials. We will use this type to back `CharacterSet`, which is currently NS-bridged, when we get to re-core it when the time comes.

Currently it's only used for String capitalization.
2023-03-23 17:10:40 -07:00
Jeremy Schonfeld
99a3c9f4ad
(106775060) Add TODO notes around disabled tests and functionality 2023-03-23 13:26:07 -07:00
Jeremy Schonfeld
8ce51672b6
(106775060) Update AttributedString sources for compatibility with FoundationPreview 2023-03-23 13:26:07 -07:00
Jeremy Schonfeld
b03b3032d2
(106775060) Move AttributedString sources to FoundationPreview 2023-03-23 13:26:00 -07:00
Charles Hu
e2e38a0bc0 rdar://106051615 (Move Calendar, Locale, and TimeZone to FoundationPreview) 2023-03-03 18:32:33 -08:00