Skip to content

Commit f2828dd

Browse files
authored
Link to stdlib macros that replace special literals (#142)
Because the macros' names aren't exactly the same as how we referred to the special literals -- one has pound signs and the other gets trailing `(_:)` in some places -- and because the lists aren't that long, I made these as two parallel lists.
2 parents 2ba3fbc + ce123d3 commit f2828dd

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

TSPL.docc/ReferenceManual/Expressions.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,15 +596,22 @@ or a playground literal.
596596

597597
> Note:
598598
> Prior to Swift 5.9,
599-
> the following special literals were recognized,
600-
> which are now implemented as macros in the Swift standard library:
599+
> the following special literals were recognized:
601600
> `#column`,
602601
> `#dsohandle`,
603602
> `#fileID`,
604603
> `#filePath`,
605604
> `#file`,
606605
> `#function`,
607606
> and `#line`.
607+
> These are now implemented as macros in the Swift standard library:
608+
> [`column`](https://developer.apple.com/documentation/swift/column),
609+
> [`dsohandle`](https://developer.apple.com/documentation/swift/dsohandle),
610+
> [`fileID`](https://developer.apple.com/documentation/swift/fileID),
611+
> [`filePath`](https://developer.apple.com/documentation/swift/filePath),
612+
> [`file`](https://developer.apple.com/documentation/swift/file),
613+
> [`function`](https://developer.apple.com/documentation/swift/function),
614+
> and [`line`](https://developer.apple.com/documentation/swift/line).
608615
609616
<!--
610617
- test: `pound-file-flavors`

TSPL.docc/ReferenceManual/LexicalStructure.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ so they must be escaped with backticks in that context.
371371
`#elseif`,
372372
`#else`,
373373
`#endif`,
374+
`#fileLiteral`,
374375
`#if`,
375376
`#imageLiteral`,
376377
`#keyPath`,
@@ -379,18 +380,26 @@ so they must be escaped with backticks in that context.
379380

380381
> Note:
381382
> Prior to Swift 5.9,
382-
> the following keywords are reserved,
383-
> which are now implemented as macros in the Swift standard library:
383+
> the following keywords were reserved:
384384
> `#column`,
385385
> `#dsohandle`,
386386
> `#error`,
387387
> `#fileID`,
388-
> `#fileLiteral`,
389388
> `#filePath`,
390389
> `#file`,
391390
> `#function`,
392391
> `#line`,
393392
> and `#warning`.
393+
> These are now implemented as macros in the Swift standard library:
394+
> [`column`](https://developer.apple.com/documentation/swift/column),
395+
> [`dsohandle`](https://developer.apple.com/documentation/swift/dsohandle),
396+
> [`error(_:)`](https://developer.apple.com/documentation/swift/error(_:)),
397+
> [`fileID`](https://developer.apple.com/documentation/swift/fileID),
398+
> [`filePath`](https://developer.apple.com/documentation/swift/filePath),
399+
> [`file`](https://developer.apple.com/documentation/swift/file),
400+
> [`function`](https://developer.apple.com/documentation/swift/function),
401+
> [`line`](https://developer.apple.com/documentation/swift/line),
402+
> and [`warning(_:)`](https://developer.apple.com/documentation/swift/warning(_:)).
394403
395404
<!--
396405
Token.py includes #assert,

0 commit comments

Comments
 (0)