Commit Graph

119 Commits

Author SHA1 Message Date
Dmitri Gribenko
bcb5a363d1 Merge pull request #3287 from PatrickPijnappel/utf-refactor
[stdlib] Significant UTF8/16 decode speed-ups for iterator nil-guarantee
2016-07-08 14:07:15 -07:00
Patrick Pijnappel
d4470aa6ee [stdlib] Refactor UTF16 decode to use UInt16 locals 2016-07-08 12:38:39 +10:00
Patrick Pijnappel
34b82bf82c Resolve conflicts with master 2016-07-01 22:32:27 +10:00
Rintaro Ishizaki
6ef62f3c73 [stdlib] Better diagnosis for unavailable APIs
Added tests for expected-error and fix-its.

- Add arguments signature regardless that is the same as before.
  Because the error message looks more natural.
  e.g. "makeIterator" => "makeIterator()",
  "replaceSubrange" => "replaceSubrange(_:with:)"
- Any${ExistentialCollection}.underestimateCount() was a method, not
  computed property.
- 'LazySequenceType' has been renamed to 'LazySequenceProtocol', but not
  'LazyCollectionProtocol'
- Streamable.writeTo(_:) had no argument label.
- Fixed typo in print() debugPrint() error message (not working for now)
- Repeated.init(): changed `renamed` to `message` because the arugment
  order has changed.
- Marked `public` for some unavailable method on `Sequence`
- Sequence.split(_:maxSplit:allowEmptySlices) was replaced with
  split(separator:maxSplits:omittingEmptySubsequences:),
  not split(separator:omittingEmptySubsequences:isSeparator:)
- Sequence.split(_:allowEmptySlices:isSeparator) was replaced with
  split(maxSplits:omittingEmptySubsequences:isSeparator:),
  not split(_:omittingEmptySubsequences:isSeparator:)
- Sequence.startsWith(_:isEquivalent:) or startsWith(_:) had no label on
  the first argument.
- transcode(_:_:_:_:stopOnError), not transcode(_:_:_:_:stoppingOnError)
- Removed mutating methods from UnsafePointer.
  alloc(_:), dealloc(_:), setter:memory, initialize(_:), destroy(),
  and destroy(_:)
2016-07-01 14:52:09 +09:00
practicalswift
8df3859ce7 [gardening] Fix recently introduced typos. 2016-06-05 11:11:44 +02:00
Rintaro Ishizaki
668b9dbc64 [stdlib] Apply tail style "where" clause to stdlib/public/core 2016-06-02 12:00:55 +09:00
Maxim Moiseev
38f7ec2a32 [stdlib] Fix the String.decodeCString for UTF16 and UTF32 (#2681)
[stdlib] Fix the `String.decodeCString` for UTF16 and UTF32

Resolves [SR-1578](https://bugs.swift.org/browse/SR-1578]
Essentially the problem was that `strlen` is not the right way of
obtaining a length of anything but null-terminated UTF-8 sequence of
characters. Other encodings require alternative mechanisms.
2016-05-25 15:51:10 -07:00
Patrick Pijnappel
a512ddf28b Refactor UTF32.decode for consistency with UTF8/UTF16 2016-05-25 21:56:26 +02:00
Patrick Pijnappel
bbcec6c507 Refactor UTF8.decode for iterator nil guarantee 2016-05-25 21:56:09 +02:00
Patrick Pijnappel
4799994ec6 Refactor UTF16.decode for iterator nil guarantee 2016-05-25 21:34:06 +02:00
Nate Cook
44b2d56a7f [stdlib] Revise documentation for string-related types
This documentation revision covers a large number of types & protocols:
String, its views and their indices, the Unicode codec types and protocol,
as well as Character, UnicodeScalar, and StaticString, among others.

This also includes a few small changes across the standard library for
consistency.
2016-05-22 03:04:22 -05:00
Dmitri Gribenko
d591f9cf7a stdlib: remove most uses of @warn_unused_result, which does nothing now
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
Mark Lacey
e03d334b68 Use Builtin.unreachable() in unavailable functions.
Saves a bit of code size in the standard library by eliminating some
static strings and function calls.

rdar://problem/25767016
2016-05-02 21:30:25 -07:00
Dave Abrahams
9bee5d182f [stdlib] location/formLocation => index/formIndex 2016-04-26 17:46:16 -07:00
Dave Abrahams
47a870cc50 [stdlib] Use location/formLocation for all index movement 2016-04-21 17:13:41 -07:00
Dmitri Gribenko
2b35fea059 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-16 00:30:12 -07:00
Chris Lattner
4fd8418ba7 move the stdlib to put noescape and autoclosure on the type, instead of
the parameter.  Progress towards SE-0049.
2016-04-14 23:13:43 -07:00
Dmitri Gribenko
10697f939f Merge commit '510f29abf77e202780c11d5f6c7449313c819030' into swift-3-indexing-model 2016-04-14 13:45:27 -07:00
Dmitri Gribenko
d52cbab5c2 Merge commit '0ff3239b962218267d37307e53906b31315a1cfc' into swift-3-indexing-model
This commit is the parent of the commit that implemented SE-0046
Establish consistent label behavior across all parameters including
first labels
2016-04-09 16:18:33 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dmitri Gribenko
6985b958fd Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-04 11:42:17 -07:00
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
Slava Pestov
7b91cbd551 stdlib: Add @_versioned attributes needed for resilient build 2016-04-01 13:07:18 -07:00
Dave Abrahams
8e4f85277b Merge remote-tracking branch 'refs/remotes/origin/master' into merge 2016-03-29 09:19:34 -07:00
Dave Abrahams
01127b32d5 index(n, stepsFrom: i)
M-x findr-query-replace

\<advance(\([^:]+?\),\([
]+\)by: *\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,\(?:[
]+\)limit: *\(?:[^()]*\|[^()]+([^()]*)[^()]*\)\)?)

index(\3,\2stepsFrom: \1\4)
2016-03-25 17:54:39 -07:00
practicalswift
d00a5ef814 [gardening] Weekly gardening: typos, duplicate includes, header formatting, etc. 2016-03-24 22:41:10 +01:00
Patrick Pijnappel
ffe864687a [stdlib] Clarify buffer comments in UTF8._decodeOne() 2016-03-22 22:33:13 +11:00
Patrick Pijnappel
771a81594f [stdlib] Fix indentation in Unicode.swift 2016-03-17 06:41:59 +11:00
Patrick Pijnappel
7e0945e7ac [stdlib] Use explicit internal in Unicode.swift 2016-03-17 06:23:19 +11:00
Patrick Pijnappel
4d3d7234aa [stdlib] Replace usages of generator with iterator 2016-03-17 05:50:05 +11:00
Patrick Pijnappel
43bca074cd [stdlib] Fix doc comment for UnicodeScalar.encode() 2016-03-14 12:07:09 +11:00
Patrick Pijnappel
549f7e298e [stdlib] Fix incorrect merge 4d05dc69 2016-03-14 09:23:02 +11:00
Patrick Pijnappel
2ec57104ac [stdlib] Format and clarify documentation in Unicode.swift 2016-03-13 20:53:02 +11:00
Patrick Pijnappel
4d05dc69a1 [stdlib] Resolve merge conflict in Unicode.swift 2016-03-13 14:08:23 +11:00
Dmitri Gribenko
3cde854287 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-12 01:11:32 -08:00
Daniel Duan
276370b599 [stdlib] apply SE-0040 to stdlib 2016-03-11 16:01:41 -08:00
Rintaro Ishizaki
8891eb638b [stdlib] Add @noescape to output parameter of UnicodeCodecType.encode
Conformance:
 - UTF8.encode
 - UTF16.encode
 - UTF32.encode

Related functions:
 - transcode
 - String._encode
 - _StringCore.encode
2016-03-09 22:10:04 -08:00
Dmitri Gribenko
886d5a707c Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-09 20:51:38 -08:00
Max Moiseev
02006f20bc Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-09 16:05:03 -08:00
Max Moiseev
1fae0d1325 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-08 12:48:48 -08:00
Rintaro Ishizaki
4f1a4ecd62 [stdlib] Add @noescape to output parameter of UnicodeCodecType.encode
Conformance:
 - UTF8.encode
 - UTF16.encode
 - UTF32.encode

Related functions:
 - transcode
 - String._encode
 - _StringCore.encode
2016-03-08 17:34:15 +09:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
Rintaro Ishizaki
1b54593362 [stdlib] Simplify transcode implementation 2016-03-08 02:04:32 +09:00
Ted Kremenek
90ce8daf0b Merge pull request #1552 from hughbe/stdlib-newlines
[gardening] Remove double new lines from stdlib files
2016-03-05 14:40:04 -08:00
Hugh Bellamy
c1b25bb32f [gardening] Remove double new lines from stdlib files 2016-03-05 15:44:54 +00:00
Patrick Pijnappel
636423c4ec [stdlib] Minor refactor for clarity in UTF8.decode() 2016-03-05 11:01:54 +11:00
Patrick Pijnappel
c109bb2a19 [stdlib] Copy warning to docs of all UnicodeCodecTypes 2016-03-05 09:49:44 +11:00
Patrick Pijnappel
500dc9d7bc [stdlib] Fix bitshift operand mask in UTF8.decode() 2016-03-05 09:48:03 +11:00
Shawn Erickson
fe42606062 [stdlib] - WIP moved aspects of ForwardIndex and BidirectionalIndex into their Collection equivalents 2016-03-04 07:40:59 -08:00
Patrick Pijnappel
17124c886f [stdlib] Clarify variable name in UTF8
_atEnd was confusing because it did not mean 'at the end of the sequence', because of buffering.
2016-03-04 10:31:36 +11:00