Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix markup for backtick in code voice #76

Merged
merged 3 commits into from
Dec 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions Sources/TSPL/TSPL.docc/ReferenceManual/LexicalStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,17 @@ are reserved for the Swift compiler and standard library.
To use a reserved word as an identifier,
put a backtick (\`) before and after it.
For example, `class` isn't a valid identifier,
but \``class`\` is valid.
but `` `class` `` is valid.
The backticks aren't considered part of the identifier;
\``x`\` and `x` have the same meaning.
`` `x` `` and `x` have the same meaning.

<!--
The paragraph above produces a link-resolution warning
because of a known issue with ` in code voice.

https://github.com/apple/swift-book/issues/71
https://github.com/apple/swift-markdown/issues/93
-->

Inside a closure with no explicit parameter names,
the parameters are implicitly named `$0`, `$1`, `$2`, and so on.
Expand All @@ -143,6 +151,15 @@ of the <doc:Attributes> chapter.
the section name isn't title case so it doesn't necessarily look like a title.
-->

<!--
The formal grammar below for 'identifier'
produces a link-resolution warning
because of a known issue with ` in code voice.

https://github.com/apple/swift-book/issues/71
https://github.com/apple/swift-markdown/issues/93
-->

> Grammar of an identifier:
>
> *identifier* → *identifier-head* *identifier-characters*_?_
Expand Down Expand Up @@ -430,7 +447,7 @@ The following tokens are reserved as punctuation
and can't be used as custom operators:
`(`, `)`, `{`, `}`, `[`, `]`,
`.`, `,`, `:`, `;`, `=`, `@`, `#`,
`&` (as a prefix operator), `->`, `\\``,
`&` (as a prefix operator), `->`, `` ` ``,
`?`, and `!` (as a postfix operator).

## Literals
Expand Down