Skip to content

Commit 2e4f677

Browse files
committed
Specify code listing language as Swift
1 parent 8f7c1b7 commit 2e4f677

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

TSPL.docc/LanguageGuide/Concurrency.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ For a task group that returns a result,
630630
you add code that accumulates its result
631631
inside the closure you pass to `withTaskGroup(of:returning:body:)`.
632632

633-
```
633+
```swift
634634
let photos = await withTaskGroup(of: Data.self) { group in
635635
let photoNames = await listPhotos(inGallery: "Summer Vacation")
636636
for name in photoNames {
@@ -708,7 +708,7 @@ like closing network connections and deleting temporary files.
708708
[`Task.checkCancellation()`]: https://developer.apple.com/documentation/swift/task/3814826-checkcancellation
709709
[`Task.isCancelled` type]: https://developer.apple.com/documentation/swift/task/iscancelled-swift.type.property
710710

711-
```
711+
```swift
712712
let photos = await withTaskGroup(of: Optional<Data>.self) { group in
713713
let photoNames = await listPhotos(inGallery: "Summer Vacation")
714714
for name in photoNames {

TSPL.docc/LanguageGuide/Macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ to add conformance to the `OptionSet` protocol.
240240
For a freestanding macro,
241241
you write the `@freestanding` attribute to specify its role:
242242

243-
```
243+
```swift
244244
@freestanding(expression)
245245
public macro line<T: ExpressibleByIntegerLiteral>() -> T =
246246
/* ... location of the macro implementation... */
@@ -317,7 +317,7 @@ Specifically, Swift expands macros in the following way:
317317

318318
To go through the specific steps, consider the following:
319319

320-
```
320+
```swift
321321
let magicNumber = #fourCharacterCode("ABCD")
322322
```
323323

@@ -413,7 +413,7 @@ That produces a final AST that can be compiled as usual:
413413

414414
This AST corresponds to Swift code like this:
415415

416-
```
416+
```swift
417417
let magicNumber = 1145258561 as UInt32
418418
```
419419

TSPL.docc/ReferenceManual/Expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ However, when a default value is a larger expression
15281528
that contains a macro in addition to other code,
15291529
those macros are evaluated where they appear in the function definition.
15301530

1531-
```
1531+
```swift
15321532
func f(a: Int = #line, b: Int = (#line), c: Int = 100 + #line) {
15331533
print(a, b, c)
15341534
}

0 commit comments

Comments
 (0)