Commit Graph

25 Commits

Author SHA1 Message Date
Maxwell Swadling
02808373d8 [stdlib] Fixed bugs with string views
Fixes rdar://problem/18435682
Fixes rdar://problem/19238102

Swift SVN r24117
2014-12-23 20:02:38 +00:00
Dave Abrahams
7d50db0cec [stdlib] String index mapping: finish tests
Doc comments are next.

Swift SVN r24070
2014-12-22 15:30:57 +00:00
Dave Abrahams
a9d7577b5f [stdlib] conversions to String.UnicodeScalarIndex
Also expanded testing to include checking translation of end indices
between views.

Swift SVN r24067
2014-12-22 01:13:46 +00:00
Dave Abrahams
2cd5290005 [stdlib] Add some missing doc comments
Swift SVN r24038
2014-12-19 19:48:37 +00:00
Dave Abrahams
43ea3db04e [stdlib] conversions to UTF16View.Index
Swift SVN r24013
2014-12-18 20:47:38 +00:00
Dave Abrahams
3c9c3fa457 [stdlib] conversions to String.UTF8Index
Swift SVN r24011
2014-12-18 20:47:35 +00:00
Dave Abrahams
27983cf144 [stdlib] typealiases for String Indexes
Just a convenience

Swift SVN r24010
2014-12-18 20:47:34 +00:00
Dave Abrahams
e85a03663f [stdlib] String.UTF16View.Index speedups
Even though it doesn't conform to RandomAccessIndexType without
Foundation loaded, we can implement these internal operations to happen
in O(1), which, e.g., should speed up count(s.utf16) among others.

Swift SVN r24009
2014-12-18 20:47:33 +00:00
Dave Abrahams
ada079bb4d [stdlib] UTF16View: unavailable subscript with Int
There had been some discussion of making this available iff Foundation
is loaded, but it turns out that there are almost no Foundation APIs
that return NSUInteger indices into NSStrings without first packaging
them into NSRanges, and when <rdar://problem/19255291> is addressed,
these NSRanges will become Swift Range's, which have a different
interface.  So there's no seamless API transition to be had here, for
any substantial subset of code written against Cocoa.

Swift SVN r23949
2014-12-15 22:24:31 +00:00
Dmitri Hrybenko
b169a102f7 stdlib: coding style: use "SPI(module)" annotation
Swift SVN r23931
2014-12-15 03:36:02 +00:00
Dave Abrahams
9550c02956 [stdlib] String.UTF16View.Index is bidirectional
Rather than expose random access on String.UTF16View to all Swift users,
expose it only when Foundation is loaded.  This effectively decouples
String from a UTF16 representation on non-Mac platforms.

Swift SVN r23929
2014-12-14 17:11:04 +00:00
Dave Abrahams
67ebc83674 [stdlib] String.UTF16View.Index is no longer Int
We don't want to be locked into a UTF-16 representation on all
platforms, and when we implement String index conversion we really don't
want to extend the interface of Int.

Swift SVN r23928
2014-12-14 17:11:03 +00:00
Dave Abrahams
a7f3e4222e [stdlib] finish public non-protocol docs
The 58 undocumented public non-operator APIs still present in core are
all on non-exposed (underscored) APIs.

Swift SVN r22263
2014-09-24 12:31:45 +00:00
Dave Abrahams
dbde275230 [stdlib] Propagate Reflectable docs
230 undocumented public non-operator APIs remain in core

Swift SVN r22236
2014-09-23 23:08:43 +00:00
Dave Abrahams
f4a7812065 [stdlib] Propagate SequenceType docs to models
235 undocumented public APIs remain in core

Swift SVN r22210
2014-09-23 10:40:37 +00:00
Dave Abrahams
1dd7272fe9 [stdlib] Propagate CollectionType docs to models
266 undocumented public APIs remain in core

Swift SVN r22206
2014-09-23 08:19:23 +00:00
Dmitri Hrybenko
766c9816de stdlib: underscore-prefix String.core
Swift SVN r20411
2014-07-23 16:28:57 +00:00
Dave Abrahams
6d1095f44e Protocol names end in "Type," "ible," or "able"
Mechanically add "Type" to the end of any protocol names that don't end
in "Type," "ible," or "able."  Also, drop "Type" from the end of any
associated type names, except for those of the *LiteralConvertible
protocols.

There are obvious improvements to make in some of these names, which can
be handled with separate commits.

Fixes <rdar://problem/17165920> Protocols `Integer` etc should get
uglier names.

Swift SVN r19883
2014-07-12 17:29:57 +00:00
Jordan Rose
da29f099f0 Update stdlib for accessibility modifiers becoming context-sensitive keywords.
Swift SVN r19672
2014-07-08 02:17:46 +00:00
Enrico Granata
64bb537f55 Implement Mirrors for the UTF8/16 view on Swift Strings
Swift SVN r19651
2014-07-07 23:36:00 +00:00
Jordan Rose
cdd8532f33 Remove @private from the stdlib.
@private can't safely be used with inlineable code at this time, which
unfortunately covers the entire standard library.

Swift SVN r19550
2014-07-04 01:53:52 +00:00
Dmitri Hrybenko
6b2c727850 stdlib/String: change UTF-16/UTF-16 transcoder in UTF16View to replace
ill-formed code unit sequences with U+FFFD

rdar://17451259


Swift SVN r19187
2014-06-25 22:28:33 +00:00
Jordan Rose
cca27d02a0 Tag everything in the standard library with accessibility attributes.
Keep calm: remember that the standard library has many more public exports
than the average target, and that this contains ALL of them at once.
I also deliberately tried to tag nearly every top-level decl, even if that
was just to explicitly mark things @internal, to make sure I didn't miss
something.

This does export more than we might want to, mostly for protocol conformance
reasons, along with our simple-but-limiting typealias rule. I tried to also
mark things private where possible, but it's really going to be up to the
standard library owners to get this right. This is also only validated
against top-level access control; I haven't fully tested against member-level
access control yet, and none of our semantic restrictions are in place.

Along the way I also noticed bits of stdlib cruft; to keep this patch
understandable, I didn't change any of them.

Swift SVN r19145
2014-06-24 21:32:18 +00:00
Argyrios Kyrtzidis
95bd9e1d28 [AST/IDE] Centralize the logic to determine if a symbols is a 'private' stdlib one and hide them more extensively.
-Hide vars that have a private type.
-Hide functions that have a parameter with private type or a parameter name with leading underscore.
-Minor change in StringUTF16.swift to avoid printing "func generate() -> IndexingGenerator<_StringCore>".

rdar://17027294

Swift SVN r18623
2014-05-25 03:49:02 +00:00
Dave Abrahams
23f98db278 [stdlib] A .utf16 property for String
Also, test the .utf8 property

Swift SVN r17488
2014-05-05 21:23:48 +00:00