Michael Ilseman
75463e30f3
[stdlib] Rename _StringCore to _LegacyStringCore. NFC.
...
In grand LLVM tradition, the first step to redesigning _StringCore is
to first rename it to _LegacyStringCore. Subsequent commits will
introduce the replacement, and eventually all uses of the old one will
be moved to the new one.
NFC.
2018-01-21 12:28:56 -08:00
Ben Cohen
dcab9493ae
Removed some warnings ( #12753 )
2017-11-30 15:12:56 -08:00
Nate Cook
0b62b0608d
[stdlib] Doc revisions
...
- Add missing docs & parameter lists
- Remove deprecated `characters` usage in examples
- Revise documentation for Mirror and CVarArg
- Revise documentation for swap(_:_:)
- Various typo and grammar fixes
2017-11-07 11:11:23 -06:00
Valentin Pertuisot
4b9d5d54db
Improve lowercased comments documentation ( #12579 )
...
Differentiate better between a full string character lowercased and a first character only lowercased
2017-10-24 13:11:00 -05:00
Doug Gregor
772352e524
Add requirement StringProtocol.SubSequence : StringProtocol
2017-10-01 15:08:23 -07:00
Max Moiseev
53b8419279
[stdlib] Make all the stdlib APIs @_inlineable
...
This change in theory should allow us to remove a special stdlib-only
sil-serialize-all compilation mode.
<rdar://problem/34138683>
2017-09-29 11:26:56 -07:00
swift-ci
79a3f9c415
Merge pull request #11670 from natecook1000/nc-rev-77-2
2017-09-19 10:15:59 -07:00
Nate Cook
050268d876
[stdlib] Documentation revisions
...
- Update NSRange -> Range guidance
- Fix example in Optional
- Improve RangeExpression docs
- Fix issue in UnsafeRawBufferPointer.initializeMemory
- Code point -> scalar value most places
- Reposition the dot above the scripty `i'
- Fix ExpressibleByArrayLiteral code sample
2017-08-29 09:41:55 -05:00
Maxim Moiseev
ee5fb33656
[stdlib] Remove the Grand Renaming artifacts of Swift 3 era
2017-08-28 15:54:11 -07:00
Nate Cook
a51e32ad37
[stdlib] String API revisions
...
- Clarify StringProtocol conformance
- Deprecate ExpressibleByStringInterpolation
- String index conversions docs
- Describe shared string indices
2017-07-31 10:56:54 -05:00
Nate Cook
a7ce287a53
Merge branch 'master' into integers-revised
2017-07-28 12:23:48 -05:00
Maxim Moiseev
2ba6cc9bd6
Merge pull request #11157 from airspeedswift/stringprotocolify
...
[stdlib] Switch Int/Float inits + join to be on StringProtocol
2017-07-27 14:22:25 -07:00
Maxim Moiseev
a5ff35cd41
[stdlib] extendingOrTruncating: => truncatingIfNeeded:
2017-07-26 11:09:36 -07:00
Michael Ilseman
2f0dafbac3
Merge pull request #11191 from milseman/very_persistent
...
[stdlib] Fix bug in Substring's _persistentContent
2017-07-26 08:57:53 -07:00
Omar Sharif Fathi
888fe8df3d
Update String.swift
2017-07-26 02:40:45 +02:00
Ben Cohen
92bc5b7829
Switch Int/Float inits + join to be on StringProtocol
2017-07-25 08:28:22 -07:00
Michael Ilseman
b37417bdb5
[String] Delete dead code; NFC
2017-07-24 16:09:54 -07:00
Max Moiseev
5f1c3f7021
[overlay] Generalize Foundation StringProtocol extensions
2017-07-07 15:34:56 -07:00
Max Moiseev
1a1c1a0d21
[stdlib] StringProtocol no longer refines RangeReplaceableCollection
...
https://bugs.swift.org/browse/SR-5379
2017-07-06 09:40:10 -07:00
Maxim Moiseev
a31e2bde14
Merge pull request #10097 from apple/stringprotocol-reform
...
[stdlib] Eliminate over-constraint on StringProtocol
2017-06-14 15:13:56 -07:00
Nate Cook
825e9d077d
[stdlib] More documentation revisions / consistency fixes.
2017-06-13 14:08:00 -05:00
Nate Cook
b7af9bfe83
[stdlib] Remove SeeAlso tags
2017-06-13 11:23:51 -05:00
Dave Abrahams
eb04df45f4
[stdlib] Eliminate over-constraint on StringProtocol
2017-06-03 17:18:20 -07:00
Roman Levenstein
ecff16cba3
Reduce code size of the stdlib
...
This should reduce the code size of the stdlib by 1.5%.
2017-06-03 14:22:12 -07:00
Ben Cohen
d0c0043f93
[stdlib] Use ephemeral string for substring comparison ( #10009 )
...
* Use _ephemeralString for substring comparison
Add back != for String/Substring comparison
* OK fine, Linux, if you're going to be difficult
* Different forms of comparison, tests
2017-06-03 11:20:01 -07:00
Roman Levenstein
00d663d172
[sil-generic-specializer] Add @_semantics("optimize.sil.specialize.generic.partial.never") to disable partial specialization on functions
...
This new @_semantics is used to annotate some very big functions in the standard library. It reduced the code size of the stdlib by 2%.
2017-06-01 16:33:18 -07:00
Dave Abrahams
4f5e14845b
[stdlib] Eliminate optionals from specialization code
...
Apparently this makes the optimizer happier. Still waiting on #9792 for truly
efficient specialization.
https://github.com/apple/swift/pull/9792
2017-05-22 15:59:43 -07:00
Dave Abrahams
d6fee05375
[stdlib] Enable interchange among StringProtocol models
2017-05-17 17:21:43 -07:00
Maxim Moiseev
8876655f6b
[stdlib] Reverting the String.init?(_: String) behavior ( #9659 )
2017-05-17 13:56:15 -07:00
Nate Cook
817a1efa3b
[stdlib] Documentation revisions
...
- remove additional 'characters' references from String docs
- improved language around escaping pointer arguments
- key path type abstracts
- codable type abstract revisions
- a few more NSString API fixes
2017-05-17 11:58:08 -05:00
practicalswift
aae419ad30
[gardening] Fix word processing artefacts
2017-05-15 11:30:25 +02:00
Ben Cohen
ea2f64cad2
[stdlib] Add Sequence.Element, change ExpressibleByArrayLiteral.Element to ArrayLiteralElement ( #8990 )
...
* Give Sequence a top-level Element, constrain Iterator to match
* Remove many instances of Iterator.
* Fixed various hard-coded tests
* XFAIL a few tests that need further investigation
* Change assoc type for arrayLiteralConvertible
* Mop up remaining "better expressed as a where clause" warnings
* Fix UnicodeDecoders prototype test
* Fix UIntBuffer
* Fix hard-coded Element identifier in CSDiag
* Fix up more tests
* Account for flatMap changes
2017-05-14 06:33:25 -07:00
Max Moiseev
12f8b390c1
[stdlib] Mark String.init?(_: String) obsoleted in Swift 4
...
It is still possible to get the same behavior by providing an explicit
type context, or in a generic code, but otherwise, `String("")!` will
not compile.
2017-05-13 11:45:26 -07:00
Nate Cook
f650e0a7da
[stdlib] String and range expressions
...
* finish string documentation revisions
* revise examples throughout to use range expressions instead of e.g.
prefix(upTo: _)
2017-05-13 10:06:12 -05:00
Nate Cook
7fa74f590d
[stdlib] Documentation revisions for string + ranges
...
* removing .characters from examples
* beginning new String doc revisions
* improvements to the String Foundation overlay docs
* minor revisions elsewhere
2017-05-13 10:06:05 -05:00
Max Moiseev
f8bb0d88d7
Revert "[stdlib] Removing a String.init?(_: String), non-failable is enough"
...
This reverts commit 46415e7dbd .
2017-05-12 20:47:34 -07:00
Max Moiseev
46415e7dbd
[stdlib] Removing a String.init?(_: String), non-failable is enough
2017-05-12 14:48:30 -07:00
Dave Abrahams
41c244a065
[stdlib] Unicode[Encoding|Parser] => Unicode.[Encoding|Parser]
2017-05-11 17:21:39 -07:00
Dave Abrahams
ddf7ad517f
UnicodeScalar => Unicode.Scalar
2017-05-11 15:23:25 -07:00
Dave Abrahams
97f875ad84
[stdlib] De-underscore Unicode "namespace"
2017-05-11 15:23:25 -07:00
Max Moiseev
109c213358
[stdlib] Prioritizing non-failing String.init_:String)
2017-05-10 15:58:00 -07:00
Max Moiseev
cce957ba98
[stdlib] Removing the StringProtocol.init<T: StringProtocol>
2017-05-10 15:58:00 -07:00
Dave Abrahams
c64534a873
[stdlib] API adjustments in preparation for proposal update
2017-05-09 11:19:24 -07:00
Dave Abrahams
e7b32f9dc9
[stdlib] UnicodeEncoding: hide/internalize APIs we're not sure about
...
The best high-level APIs for decoding/transcoding are still under active
investigation. It's likely we want more views. Therefore, leave
de-underscored/public only the lowest-level APIs for now.
2017-05-09 10:20:29 -07:00
Dave Abrahams
fd8cfea3ac
[stdlib] String initialization with encoding and CString interop
2017-05-08 19:50:38 -07:00
Dave Abrahams
c5d6880053
[stdlib] Add ASCII UnicodeEncoding, drop uses of legacy codecs
...
Preparation for new C-string interop.
2017-05-07 20:43:44 -07:00
Dave Abrahams
f155d499c0
[stdlib] Drop redundant constraint
2017-05-02 16:54:27 -07:00
Max Moiseev
bfb1824f44
[stdlib] Adding the StringProtocol
2017-05-01 16:41:26 -07:00
Max Moiseev
288eee0b1b
[stdlib] New overload for joined()
...
Now that `String` conforms to the `BidirectionalCollection` protocol, in
the expression `let x = [""].joined()` the best matching overload for
`joined` is no longer the one returning `String`.
Fixes: <rdar://problem/31899440>
2017-05-01 12:41:57 -07:00
Andrew Bennett
ca31338e49
Simplifying implementation of ExpressibleByStringLiteral ( #7125 )
...
* Simplify conforming to ExpressibleByStringLiteral with default implementations
* attributes on default implementations
* ExpressibleByUnicodeScalarLiteral validation test
* more generic default implementations
* clean up test
* remove unneeded implementations
* remove test verification
* indent
* revert @effects and affected methods
* fix test generics with _ protocols
* Add semantic tests
* clean up tests
* Fix redundant conformance requirements
2017-04-21 20:45:28 -07:00