Skip to content

Commit 1b663f7

Browse files
authored
Fix invalid HTML comments (#334)
The line "---" indicated to the pre-DocC build system's code testing infrastructure that the code listing contains a blank line at that point. However, two hyphens in a row is invalid inside of an HTML <!-- --> style comment. Fixes: rdar://136551557
2 parents 4f161b0 + 1d0e452 commit 1b663f7

32 files changed

+288
-288
lines changed

TSPL.docc/GuidedTour/GuidedTour.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ occupations["Jayne"] = "Public Relations"
255255
```swifttest
256256
-> var fruits = ["strawberries", "limes", "tangerines"]
257257
-> fruits[1] = "grapes"
258-
---
258+
259259
-> var occupations = [
260260
"Malcolm": "Captain",
261261
"Kaylee": "Mechanic",
@@ -317,7 +317,7 @@ let emptyDictionary: [String: Float] = [:]
317317
```swifttest
318318
-> let emptyArray: [String] = []
319319
-> let emptyDictionary: [String: Float] = [:]
320-
---
320+
321321
-> let anotherEmptyArray = [String]()
322322
-> let emptyDictionary = [String: Float]()
323323
```
@@ -432,7 +432,7 @@ if let name = optionalName {
432432
-> var optionalString: String? = "Hello"
433433
-> print(optionalString == nil)
434434
<- false
435-
---
435+
436436
-> var optionalName: String? = "John Appleseed"
437437
-> var greeting = "Hello!"
438438
-> if let name = optionalName {
@@ -658,7 +658,7 @@ print(m)
658658
}
659659
-> print(n)
660660
<- 128
661-
---
661+
662662
-> var m = 2
663663
-> repeat {
664664
m *= 2
@@ -1132,11 +1132,11 @@ class NamedShape {
11321132
-> class NamedShape {
11331133
var numberOfSides: Int = 0
11341134
var name: String
1135-
---
1135+
11361136
init(name: String) {
11371137
self.name = name
11381138
}
1139-
---
1139+
11401140
func simpleDescription() -> String {
11411141
return "A shape with \(numberOfSides) sides."
11421142
}
@@ -1202,17 +1202,17 @@ test.simpleDescription()
12021202
```swifttest
12031203
-> class Square: NamedShape {
12041204
var sideLength: Double
1205-
---
1205+
12061206
init(sideLength: Double, name: String) {
12071207
self.sideLength = sideLength
12081208
super.init(name: name)
12091209
numberOfSides = 4
12101210
}
1211-
---
1211+
12121212
func area() -> Double {
12131213
return sideLength * sideLength
12141214
}
1215-
---
1215+
12161216
override func simpleDescription() -> String {
12171217
return "A square with sides of length \(sideLength)."
12181218
}
@@ -1276,13 +1276,13 @@ print(triangle.sideLength)
12761276
```swifttest
12771277
-> class EquilateralTriangle: NamedShape {
12781278
var sideLength: Double = 0.0
1279-
---
1279+
12801280
init(sideLength: Double, name: String) {
12811281
self.sideLength = sideLength
12821282
super.init(name: name)
12831283
numberOfSides = 3
12841284
}
1285-
---
1285+
12861286
var perimeter: Double {
12871287
get {
12881288
return 3.0 * sideLength
@@ -1291,7 +1291,7 @@ print(triangle.sideLength)
12911291
sideLength = newValue / 3.0
12921292
}
12931293
}
1294-
---
1294+
12951295
override func simpleDescription() -> String {
12961296
return "An equilateral triangle with sides of length \(sideLength)."
12971297
}
@@ -1471,7 +1471,7 @@ let aceRawValue = ace.rawValue
14711471
case ace = 1
14721472
case two, three, four, five, six, seven, eight, nine, ten
14731473
case jack, queen, king
1474-
---
1474+
14751475
func simpleDescription() -> String {
14761476
switch self {
14771477
case .ace:
@@ -1562,7 +1562,7 @@ let heartsDescription = hearts.simpleDescription()
15621562
```swifttest
15631563
-> enum Suit {
15641564
case spades, hearts, diamonds, clubs
1565-
---
1565+
15661566
func simpleDescription() -> String {
15671567
switch self {
15681568
case .spades:
@@ -1679,10 +1679,10 @@ case let .failure(message):
16791679
case result(String, String)
16801680
case failure(String)
16811681
}
1682-
---
1682+
16831683
-> let success = ServerResponse.result("6:00 am", "8:09 pm")
16841684
-> let failure = ServerResponse.failure("Out of cheese.")
1685-
---
1685+
16861686
-> switch success {
16871687
case let .result(sunrise, sunset):
16881688
print("Sunrise is at \(sunrise) and sunset is at \(sunset).")
@@ -1982,7 +1982,7 @@ let bDescription = b.simpleDescription
19821982
-> let aDescription = a.simpleDescription
19831983
>> print(aDescription)
19841984
<< A very simple class. Now 100% adjusted.
1985-
---
1985+
19861986
-> struct SimpleStructure: ExampleProtocol {
19871987
var simpleDescription: String = "A simple structure"
19881988
mutating func adjust() {
@@ -2309,13 +2309,13 @@ print(fridgeIsOpen)
23092309
```swifttest
23102310
-> var fridgeIsOpen = false
23112311
-> let fridgeContent = ["milk", "eggs", "leftovers"]
2312-
---
2312+
23132313
-> func fridgeContains(_ food: String) -> Bool {
23142314
fridgeIsOpen = true
23152315
defer {
23162316
fridgeIsOpen = false
23172317
}
2318-
---
2318+
23192319
let result = fridgeContent.contains(food)
23202320
return result
23212321
}

TSPL.docc/LanguageGuide/AccessControl.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private func somePrivateFunction() {}
195195
-> internal class SomeInternalClass {}
196196
-> fileprivate class SomeFilePrivateClass {}
197197
-> private class SomePrivateClass {}
198-
---
198+
199199
-> open var someOpenVariable = 0
200200
-> public var somePublicVariable = 0
201201
-> internal let someInternalConstant = 0
@@ -284,18 +284,18 @@ private class SomePrivateClass { // explicitly private class
284284
fileprivate func someFilePrivateMethod() {} // explicitly file-private class member
285285
private func somePrivateMethod() {} // explicitly private class member
286286
}
287-
---
287+
288288
-> class SomeInternalClass { // implicitly internal class
289289
var someInternalProperty = 0 // implicitly internal class member
290290
fileprivate func someFilePrivateMethod() {} // explicitly file-private class member
291291
private func somePrivateMethod() {} // explicitly private class member
292292
}
293-
---
293+
294294
-> fileprivate class SomeFilePrivateClass { // explicitly file-private class
295295
func someFilePrivateMethod() {} // implicitly file-private class member
296296
private func somePrivateMethod() {} // explicitly private class member
297297
}
298-
---
298+
299299
-> private class SomePrivateClass { // explicitly private class
300300
func somePrivateMethod() {} // implicitly private class member
301301
}
@@ -557,7 +557,7 @@ you must explicitly declare the nested type as public.
557557
-> let publicNestedInsidePublic = PublicStruct.PublicEnumInsidePublicStruct.a
558558
-> let internalNestedInsidePublic = PublicStruct.InternalEnumInsidePublicStruct.a
559559
-> let automaticNestedInsidePublic = PublicStruct.AutomaticEnumInsidePublicStruct.a
560-
---
560+
561561
-> let internalNestedInsideInternal = InternalStruct.InternalEnumInsideInternalStruct.a
562562
-> let automaticNestedInsideInternal = InternalStruct.AutomaticEnumInsideInternalStruct.a
563563
```
@@ -569,12 +569,12 @@ you must explicitly declare the nested type as public.
569569
```swifttest
570570
// these are all expected to fail, because they're private to the other file
571571
-> let privateNestedInsidePublic = PublicStruct.PrivateEnumInsidePublicStruct.a
572-
---
572+
573573
-> let privateNestedInsideInternal = InternalStruct.PrivateEnumInsideInternalStruct.a
574-
---
574+
575575
-> let privateNestedInsidePrivate = PrivateStruct.PrivateEnumInsidePrivateStruct.a
576576
-> let automaticNestedInsidePrivate = PrivateStruct.AutomaticEnumInsidePrivateStruct.a
577-
---
577+
578578
!$ error: 'PrivateEnumInsidePublicStruct' is inaccessible due to 'private' protection level
579579
!! let privateNestedInsidePublic = PublicStruct.PrivateEnumInsidePublicStruct.a
580580
!! ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -615,14 +615,14 @@ you must explicitly declare the nested type as public.
615615
-> let internalNestedInsidePublic = PublicStruct.InternalEnumInsidePublicStruct.a
616616
-> let automaticNestedInsidePublic = PublicStruct.AutomaticEnumInsidePublicStruct.a
617617
-> let privateNestedInsidePublic = PublicStruct.PrivateEnumInsidePublicStruct.a
618-
---
618+
619619
-> let internalNestedInsideInternal = InternalStruct.InternalEnumInsideInternalStruct.a
620620
-> let automaticNestedInsideInternal = InternalStruct.AutomaticEnumInsideInternalStruct.a
621621
-> let privateNestedInsideInternal = InternalStruct.PrivateEnumInsideInternalStruct.a
622-
---
622+
623623
-> let privateNestedInsidePrivate = PrivateStruct.PrivateEnumInsidePrivateStruct.a
624624
-> let automaticNestedInsidePrivate = PrivateStruct.AutomaticEnumInsidePrivateStruct.a
625-
---
625+
626626
!$ error: 'InternalEnumInsidePublicStruct' is inaccessible due to 'internal' protection level
627627
!! let internalNestedInsidePublic = PublicStruct.InternalEnumInsidePublicStruct.a
628628
!! ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -701,7 +701,7 @@ internal class B: A {
701701
-> public class A {
702702
fileprivate func someMethod() {}
703703
}
704-
---
704+
705705
-> internal class B: A {
706706
override internal func someMethod() {}
707707
}
@@ -734,7 +734,7 @@ internal class B: A {
734734
-> public class A {
735735
fileprivate func someMethod() {}
736736
}
737-
---
737+
738738
-> internal class B: A {
739739
override internal func someMethod() {
740740
super.someMethod()
@@ -1162,7 +1162,7 @@ on any type that adopts the protocol.
11621162
var publicProperty = 0
11631163
func publicMethod() {}
11641164
}
1165-
---
1165+
11661166
-> public class PublicClassConformingToInternalProtocol: InternalProtocol {
11671167
var internalProperty = 0
11681168
func internalMethod() {}
@@ -1190,7 +1190,7 @@ on any type that adopts the protocol.
11901190
!$ error: cannot find type 'FilePrivateProtocol' in scope
11911191
!! public class PublicClassConformingToFilePrivateProtocol: FilePrivateProtocol {
11921192
!! ^~~~~~~~~~~~~~~~~~~
1193-
---
1193+
11941194
// these will fail, because PrivateProtocol isn't visible outside of its file
11951195
-> public class PublicClassConformingToPrivateProtocol: PrivateProtocol {
11961196
var privateProperty = 0
@@ -1440,7 +1440,7 @@ extension SomeStruct: SomeProtocol {
14401440
-> struct SomeStruct {
14411441
private var privateVariable = 12
14421442
}
1443-
---
1443+
14441444
-> extension SomeStruct: SomeProtocol {
14451445
func doSomething() {
14461446
print(privateVariable)
@@ -1474,19 +1474,19 @@ but a public type alias can't alias an internal, file-private, or private type.
14741474
-> public struct PublicStruct {}
14751475
-> internal struct InternalStruct {}
14761476
-> private struct PrivateStruct {}
1477-
---
1477+
14781478
-> public typealias PublicAliasOfPublicType = PublicStruct
14791479
-> internal typealias InternalAliasOfPublicType = PublicStruct
14801480
-> private typealias PrivateAliasOfPublicType = PublicStruct
1481-
---
1481+
14821482
-> public typealias PublicAliasOfInternalType = InternalStruct // not allowed
14831483
-> internal typealias InternalAliasOfInternalType = InternalStruct
14841484
-> private typealias PrivateAliasOfInternalType = InternalStruct
1485-
---
1485+
14861486
-> public typealias PublicAliasOfPrivateType = PrivateStruct // not allowed
14871487
-> internal typealias InternalAliasOfPrivateType = PrivateStruct // not allowed
14881488
-> private typealias PrivateAliasOfPrivateType = PrivateStruct
1489-
---
1489+
14901490
!$ error: type alias cannot be declared public because its underlying type uses an internal type
14911491
!! public typealias PublicAliasOfInternalType = InternalStruct // not allowed
14921492
!! ^ ~~~~~~~~~~~~~~

TSPL.docc/LanguageGuide/AdvancedOperators.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ extension Vector2D {
701701
-> struct Vector2D {
702702
var x = 0.0, y = 0.0
703703
}
704-
---
704+
705705
-> extension Vector2D {
706706
static func + (left: Vector2D, right: Vector2D) -> Vector2D {
707707
return Vector2D(x: left.x + right.x, y: left.y + right.y)
@@ -1028,7 +1028,7 @@ let afterDoubling = +++toBeDoubled
10281028
return vector
10291029
}
10301030
}
1031-
---
1031+
10321032
-> var toBeDoubled = Vector2D(x: 1.0, y: 4.0)
10331033
-> let afterDoubling = +++toBeDoubled
10341034
/> toBeDoubled now has values of (\(toBeDoubled.x), \(toBeDoubled.y))
@@ -1349,7 +1349,7 @@ print(personalGreeting.draw())
13491349
-> func caps(@DrawingBuilder content: () -> Drawable) -> Drawable {
13501350
return AllCaps(content: content())
13511351
}
1352-
---
1352+
13531353
-> func makeGreeting(for name: String? = nil) -> Drawable {
13541354
let greeting = draw {
13551355
Stars(length: 3)
@@ -1369,7 +1369,7 @@ print(personalGreeting.draw())
13691369
-> let genericGreeting = makeGreeting()
13701370
-> print(genericGreeting.draw())
13711371
<- ***Hello WORLD!**
1372-
---
1372+
13731373
-> let personalGreeting = makeGreeting(for: "Ravi Patel")
13741374
-> print(personalGreeting.draw())
13751375
<- ***Hello RAVI PATEL!**
@@ -1539,7 +1539,7 @@ see <doc:Attributes#resultBuilder>.
15391539
// static func * (scale: Double, vector: Self) -> Self
15401540
static func *** (scale: Double, vector: Vector2D) -> Vector2D
15411541
}
1542-
---
1542+
15431543
-> extension Double {
15441544
static func *** (scale: Double, vector: Vector2D) -> Vector2D {
15451545
return Vector2D(x: scale * vector.x, y: scale * vector.y)

0 commit comments

Comments
 (0)