Skip to content

Commit f0d294b

Browse files
committed
Merge pull request swiftlang#884 from practicalswift/apostrophes
[gardening] Replace left/right quotation marks
2 parents 1915b06 + 4d43f4a commit f0d294b

14 files changed

+36
-36
lines changed

docs/ARCOptimization.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ lower directly to is_unique instructions in SIL.
137137
The is_unique instruction takes the address of a reference, and
138138
although it does not actually change the reference, the reference must
139139
appear mutable to the optimizer. This forces the optimizer to preserve
140-
a retain distinct from whats required to maintain lifetime for any of
140+
a retain distinct from what's required to maintain lifetime for any of
141141
the reference's source-level copies, because the called function is
142142
allowed to replace the reference, thereby releasing the
143143
referent. Consider the following sequence of rules:
@@ -225,7 +225,7 @@ these cases:
225225
- isUniqueOrPinned_native : <T> (inout T[?]) -> Int1
226226

227227
These builtins perform an implicit cast to NativeObject before
228-
checking uniqueness. Theres no way at SIL level to cast the address
228+
checking uniqueness. There's no way at SIL level to cast the address
229229
of a reference, so we need to encapsulate this operation as part of
230230
the builtin.
231231

docs/ErrorHandlingRationale.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1359,15 +1359,15 @@ declaration or type::
13591359
return try stream.readInt()
13601360
}
13611361
1362-
// throws is written before the arrow to give a sensible and
1362+
// 'throws' is written before the arrow to give a sensible and
13631363
// consistent grammar for function types and implicit () result types.
13641364
func baz() throws {
13651365
if let byte = try stream.getOOB() where byte == PROTO_RESET {
13661366
reset()
13671367
}
13681368
}
13691369
1370-
// throws appears in a consistent position in function types.
1370+
// 'throws' appears in a consistent position in function types.
13711371
func fred(callback: (UInt8) throws -> ()) throws {
13721372
while true {
13731373
let code = try stream.readByte()
@@ -1380,7 +1380,7 @@ declaration or type::
13801380
// this function has type:
13811381
// (Int) -> (Int) throws -> Int
13821382
func jerry(i: Int)(j: Int) throws -> Int {
1383-
// Its not an error to use throws on a function that cant throw.
1383+
// It's not an error to use 'throws' on a function that can't throw.
13841384
return i + j
13851385
}
13861386

docs/GitWorkflows.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ transition to Git this document helps to address questions about how common SVN
1111
workflows we use today translate to their Git counterparts as well as to discuss
1212
Git workflow practices we plan on having — at least initially — after the Git
1313
transition. Notably we will follow a model where commits to trunk — which is
14-
the master branch in Git — has commits land (in the common case) via rebasing
14+
the 'master' branch in Git — has commits land (in the common case) via rebasing
1515
instead of merging. This model is open to evolution later, but this mimics the
1616
workflow we have today with SVN.
1717

docs/MutationModel.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Consider::
4040
w.title += " (parenthesized remark)"
4141

4242
What do we do with this? Since ``+=`` has an ``inout`` first
43-
argument, we detect this situation statically (hopefully one day well
43+
argument, we detect this situation statically (hopefully one day we'll
4444
have a better error message):
4545

4646
::
@@ -53,7 +53,7 @@ Great. Now what about this? [#append]_ ::
5353

5454
w.title.append(" (fool the compiler)")
5555

56-
Today, we allow it, but since theres no way to implement the
56+
Today, we allow it, but since there's no way to implement the
5757
write-back onto ``w.title``, the changes are silently dropped.
5858

5959
Unsatisfying Approaches

docs/OptimizationTips.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ do not have any overriding declarations in the same file:
157157
func usingE(e: E) {
158158
e.doSomething() // There is no sub class in the file that declares this class.
159159
// The compiler can remove virtual calls to doSomething()
160-
// and directly call As doSomething method.
160+
// and directly call A's doSomething method.
161161
}
162162

163163
func usingF(f: F) -> Int {

docs/OptimizerDesign.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ This is an example of the *@_semantics* attribute as used by Swift Array:
180180

181181
Notice that as soon as we inline functions that have the @_semantics attribute
182182
the attribute is lost and the optimizer can't analyze the content of the
183-
function. For example, the optimizer can identify the array count' method (that
183+
function. For example, the optimizer can identify the array 'count' method (that
184184
returns the size of the array) and can hoist this method out of loops. However,
185185
as soon as this method is inlined, the code looks to the optimizer like a memory
186186
read from an undetermined memory location, and the optimizer can't optimize the

docs/proposals/CompressedMangledNames.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ compiler and make an effort to optimize and shrink the generated binaries. One
77
of the problems that we have today is that swift symbols are mangled into
88
extremely long strings. This is especially a problem for libraries, and almost
99
half of the size of libswiftCore.dylib (the swift runtime library on x86_64 OSX)
10-
is string tables. On MacOSX you can use the command size -m file.dylib to read
10+
is string tables. On MacOSX you can use the command "size -m file.dylib" to read
1111
the size of the string table. C++ also suffers from the problem of long names,
1212
but since we control the Swift ABI we can do better than C++.
1313

@@ -99,15 +99,15 @@ the top 63 frequent substrings in our dictionary using two characters (escape +
9999
The second escape character encodes a two-character reference that can access 63 x 63 entries in the table.
100100
Less common substrings can be encoded using this three character sequence (escape + index0 + index1).
101101

102-
One interesting bit of information is that the character ‘Y’ is only used 4
102+
One interesting bit of information is that the character "Y" is only used 4
103103
times in the entire standard library! The letter J, and a few other letters are
104104
also not used very frequently. We use Y and J as escape characters.
105105

106106
The dictionary-based encoding uses the following rules:
107107

108108
1. We use two escape characters that are not frequently used in names (Y and Z).
109109
These characters are escape character and cannot be used as part of the text
110-
without escaping. ‘Y’ is encoded as ‘YY’, and ‘Z’ would be encoded as ‘YZ’.
110+
without escaping. "Y" is encoded as "YY", and "Z" would be encoded as "YZ".
111111

112112
2. The most commonly used sub-strings (calculated as length of substring times
113113
number of occurrences) is encoded with a single escape character and a
@@ -216,7 +216,7 @@ Error handling
216216
The compression routines only handle characters that are in the list of valid
217217
characters. It is possible to compress every string that uses the valid
218218
character set. However, now all incoming strings are legal. For example the
219-
string "Y" is illegal because 'Y' is an escape character and the decoded expects
219+
string "Y" is illegal because "Y" is an escape character and the decoded expects
220220
another character to follow the escape character.
221221

222222
There are a few users that will use the compression routines: The

docs/proposals/InitializerInheritance.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ We can also distinguish two ways to originally invoke an initializer:
5050
Either kind of dispatched initialization poses a soundness problem
5151
because there may not be a sound initializer with any given signature
5252
in the most-derived class. In ObjC, initializers are normal instance
53-
methods and are therefore inherited like normal, but this isnt really
53+
methods and are therefore inherited like normal, but this isn't really
5454
quite right; initialization is different from a normal method in that
55-
its not inherently sensible to require subclasses to provide
55+
it's not inherently sensible to require subclasses to provide
5656
initializers at all the signatures that their superclasses provide.
5757

5858
Subobject initializers
5959
~~~~~~~~~~~~~~~~~~~~~~
6060
The defining class of a subobject initializer is central to its
6161
behavior. It can be soundly inherited by a class C only if is trivial
62-
to initialize the ivars of C, but its convenient to ignore that and
62+
to initialize the ivars of C, but it's convenient to ignore that and
6363
assume that subobjects will always trivially wrap and delegate to
6464
superclass subobject initializers.
6565

@@ -75,7 +75,7 @@ initializer of a class C if and only if it is defined by C.
7575

7676
Complete object initializers
7777
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78-
The defining class of a complete object initializer doesnt really
78+
The defining class of a complete object initializer doesn't really
7979
matter. In principle, complete object initializers could just as well
8080
be freestanding functions to which a metatype is passed. It can make
8181
sense to inherit a complete object initializer.
@@ -90,11 +90,11 @@ A complete object initializer soundly acts like a complete object
9090
initializer of a class C if and only if it delegates to an initializer
9191
which soundly acts like a complete object initializer of C.
9292

93-
These rules are not obvious to check statically because theyre
93+
These rules are not obvious to check statically because they're
9494
dependent on the dynamic value of the most-derived class C. Therefore
9595
any ability to check them depends on restricting C somehow relative to
9696
the defining class of the initializer. Since, statically, we only
97-
know the defining class of the initializer, we cant establish
97+
know the defining class of the initializer, we can't establish
9898
soundness solely at the definition site; instead we have to prevent
9999
unsound initializers from being called.
100100

@@ -116,7 +116,7 @@ Virtual initializers
116116
The above condition is not sufficient to make indirect initialization
117117
sound, because it relies on the ability to simply not use an
118118
initializer in cases where its delegation behavior isn't known to be
119-
sound, and we cant do that to arbitrary code. For that, we would
119+
sound, and we can't do that to arbitrary code. For that, we would
120120
need true virtual initializers.
121121

122122
A virtual initializer is a contract much more like that of a standard

docs/proposals/ValueSemantics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pseudo-random number generator). It needs to make one copy and do
175175
in-place mutation of the state, rather than wholesale value
176176
replacement via assignment, which might be expensive.
177177

178-
Heres a version of cycle_length that works when state is a mutable
178+
Here's a version of cycle_length that works when state is a mutable
179179
value type::
180180

181181
func cycle_length<State>(

include/swift/AST/Builtins.def

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ BUILTIN_SIL_OPERATION(FixLifetime, "fixLifetime", Special)
261261
///
262262
/// This builtin takes an inout object reference and returns a boolean. Passing
263263
/// the reference inout forces the optimizer to preserve a retain distinct from
264-
/// whats required to maintain lifetime for any of the reference's source-level
264+
/// what's required to maintain lifetime for any of the reference's source-level
265265
/// copies, because the called function is allowed to replace the reference,
266266
/// thereby releasing the referent.
267267
///

stdlib/public/SDK/Foundation/NSStringAPI.swift

+10-10
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ extension String {
134134
// + (const NSStringEncoding *)availableStringEncodings
135135

136136
/// Returns an Array of the encodings string objects support
137-
/// in the applications environment.
137+
/// in the application's environment.
138138
@warn_unused_result
139139
public static func availableStringEncodings() -> [NSStringEncoding] {
140140
var result = [NSStringEncoding]()
@@ -302,7 +302,7 @@ extension String {
302302

303303
/// Returns a string containing characters the `String` and a
304304
/// given string have in common, starting from the beginning of each
305-
/// up to the first characters that arent equivalent.
305+
/// up to the first characters that aren't equivalent.
306306
@warn_unused_result
307307
public func commonPrefixWithString(
308308
aString: String, options: NSStringCompareOptions) -> String {
@@ -452,15 +452,15 @@ extension String {
452452

453453
// @property NSString* decomposedStringWithCanonicalMapping;
454454

455-
/// Returns a string made by normalizing the `String`s
455+
/// Returns a string made by normalizing the `String`'s
456456
/// contents using Form D.
457457
public var decomposedStringWithCanonicalMapping: String {
458458
return _ns.decomposedStringWithCanonicalMapping
459459
}
460460

461461
// @property NSString* decomposedStringWithCompatibilityMapping;
462462

463-
/// Returns a string made by normalizing the `String`s
463+
/// Returns a string made by normalizing the `String`'s
464464
/// contents using Form KD.
465465
public var decomposedStringWithCompatibilityMapping: String {
466466
return _ns.decomposedStringWithCompatibilityMapping
@@ -605,7 +605,7 @@ extension String {
605605
/// - Parameter encoding: The encoding to use for the returned bytes.
606606
///
607607
/// - Parameter options: A mask to specify options to use for
608-
/// converting the receivers contents to `encoding` (if conversion
608+
/// converting the receiver's contents to `encoding` (if conversion
609609
/// is necessary).
610610
///
611611
/// - Parameter range: The range of characters in the receiver to get.
@@ -645,7 +645,7 @@ extension String {
645645
// maxLength:(NSUInteger)maxBufferCount
646646
// encoding:(NSStringEncoding)encoding
647647

648-
/// Converts the `String`s content to a given encoding and
648+
/// Converts the `String`'s content to a given encoding and
649649
/// stores them in a buffer.
650650
/// - Note: will store a maximum of `min(buffer.count, maxLength)` bytes.
651651
public func getCString(
@@ -923,7 +923,7 @@ extension String {
923923

924924
/// Returns a `String` object initialized by using a given
925925
/// format string as a template into which the remaining argument
926-
/// values are substituted according to the users default locale.
926+
/// values are substituted according to the user's default locale.
927927
public init(format: String, arguments: [CVarArgType]) {
928928
self = String(format: format, locale: nil, arguments: arguments)
929929
}
@@ -1120,23 +1120,23 @@ extension String {
11201120
// @property NSString* pathExtension;
11211121

11221122
/// Interprets the `String` as a path and returns the
1123-
/// `String`s extension, if any.
1123+
/// `String`'s extension, if any.
11241124
@available(*, unavailable, message="Use pathExtension on NSURL instead.")
11251125
public var pathExtension: String {
11261126
return _ns.pathExtension
11271127
}
11281128

11291129
// @property NSString* precomposedStringWithCanonicalMapping;
11301130

1131-
/// Returns a string made by normalizing the `String`s
1131+
/// Returns a string made by normalizing the `String`'s
11321132
/// contents using Form C.
11331133
public var precomposedStringWithCanonicalMapping: String {
11341134
return _ns.precomposedStringWithCanonicalMapping
11351135
}
11361136

11371137
// @property NSString * precomposedStringWithCompatibilityMapping;
11381138

1139-
/// Returns a string made by normalizing the `String`s
1139+
/// Returns a string made by normalizing the `String`'s
11401140
/// contents using Form KC.
11411141
public var precomposedStringWithCompatibilityMapping: String {
11421142
return _ns.precomposedStringWithCompatibilityMapping

stdlib/public/core/HashedCollections.swift.gyb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3398,7 +3398,7 @@ internal enum _Variant${Self}Storage<${TypeParametersDecl}> : _HashStorageType {
33983398
var nativeStorage = native
33993399

34003400
// FIXME(performance): if the storage is non-uniquely referenced, we
3401-
// shouldnt be copying the elements into new storage and then immediately
3401+
// shouldn't be copying the elements into new storage and then immediately
34023402
// deleting the elements. We should detect that the storage is not uniquely
34033403
// referenced and allocate new empty storage of appropriate capacity.
34043404

test/IDE/complete_lazy_initialized_var.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ func lazyInClass1(a: FooClass1) {
77
a.#^LAZY_IN_CLASS_1^#
88
}
99

10-
// This test checks that we dont include extra hidden declarations into code completion results. If you add more declarations to the type, update this test properly.
10+
// This test checks that we don't include extra hidden declarations into code completion results. If you add more declarations to the type, update this test properly.
1111
// LAZYVAR1: Begin completions, 1 items
1212
// LAZYVAR1-NEXT: Decl[InstanceVar]/CurrNominal: lazyVar1[#Int#]{{; name=.+$}}
1313
// LAZYVAR1-NEXT: End completions

utils/build-script-impl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ function cmark_c_flags() {
12271227
}
12281228

12291229
function swift_c_flags() {
1230-
# Dont pass common_cross_c_flags to Swift because CMake code in the Swift
1230+
# Don't pass common_cross_c_flags to Swift because CMake code in the Swift
12311231
# project is itself aware of cross-compilation for the host tools and
12321232
# standard library.
12331233
echo -n "${COMMON_C_FLAGS}"

0 commit comments

Comments
 (0)