28 Commits

Author SHA1 Message Date
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
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
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
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
9fe8623124
adjust code formatting
- also incorporates some performance annotations added for the JSON decoder.
2023-04-11 10:26:37 -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
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
Charles Hu
34c45c169c rdar://107156343 (Move JSONEncoder to FoundationPreview) 2023-03-29 09:56:00 -07:00