Skip to content

Commit dd1b9c3

Browse files
committed
Escape brackets so they don't appear like a broken link reference.
1 parent 46b66c8 commit dd1b9c3

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

src/comments.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22

33
> **<sup>Lexer</sup>**\
44
> LINE_COMMENT :\
5-
> &nbsp;&nbsp; &nbsp;&nbsp; `//` (~[`/` `!`] | `//`) ~`\n`<sup>\*</sup>\
5+
> &nbsp;&nbsp; &nbsp;&nbsp; `//` (~\[`/` `!`] | `//`) ~`\n`<sup>\*</sup>\
66
> &nbsp;&nbsp; | `//`
77
>
88
> BLOCK_COMMENT :\
9-
> &nbsp;&nbsp; &nbsp;&nbsp; `/*` (~[`*` `!`] | `**` | _BlockCommentOrDoc_)
9+
> &nbsp;&nbsp; &nbsp;&nbsp; `/*` (~\[`*` `!`] | `**` | _BlockCommentOrDoc_)
1010
> (_BlockCommentOrDoc_ | ~`*/`)<sup>\*</sup> `*/`\
1111
> &nbsp;&nbsp; | `/**/`\
1212
> &nbsp;&nbsp; | `/***/`
1313
>
1414
> INNER_LINE_DOC :\
15-
> &nbsp;&nbsp; `//!` ~[`\n` _IsolatedCR_]<sup>\*</sup>
15+
> &nbsp;&nbsp; `//!` ~\[`\n` _IsolatedCR_]<sup>\*</sup>
1616
>
1717
> INNER_BLOCK_DOC :\
18-
> &nbsp;&nbsp; `/*!` ( _BlockCommentOrDoc_ | ~[`*/` _IsolatedCR_] )<sup>\*</sup> `*/`
18+
> &nbsp;&nbsp; `/*!` ( _BlockCommentOrDoc_ | ~\[`*/` _IsolatedCR_] )<sup>\*</sup> `*/`
1919
>
2020
> OUTER_LINE_DOC :\
21-
> &nbsp;&nbsp; `///` (~`/` ~[`\n` _IsolatedCR_]<sup>\*</sup>)<sup>?</sup>
21+
> &nbsp;&nbsp; `///` (~`/` ~\[`\n` _IsolatedCR_]<sup>\*</sup>)<sup>?</sup>
2222
>
2323
> OUTER_BLOCK_DOC :\
2424
> &nbsp;&nbsp; `/**` (~`*` | _BlockCommentOrDoc_ )
25-
> (_BlockCommentOrDoc_ | ~[`*/` _IsolatedCR_])<sup>\*</sup> `*/`
25+
> (_BlockCommentOrDoc_ | ~\[`*/` _IsolatedCR_])<sup>\*</sup> `*/`
2626
>
2727
> _BlockCommentOrDoc_ :\
2828
> &nbsp;&nbsp; &nbsp;&nbsp; BLOCK_COMMENT\

src/identifiers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
> **<sup>Lexer:<sup>**\
44
> IDENTIFIER_OR_KEYWORD :\
5-
> &nbsp;&nbsp; &nbsp;&nbsp; [`a`-`z` `A`-`Z`]&nbsp;[`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>\*</sup>\
6-
> &nbsp;&nbsp; | `_` [`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>+</sup>
5+
> &nbsp;&nbsp; &nbsp;&nbsp; \[`a`-`z` `A`-`Z`]&nbsp;\[`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>\*</sup>\
6+
> &nbsp;&nbsp; | `_` \[`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>+</sup>
77
>
88
> RAW_IDENTIFIER : `r#` IDENTIFIER_OR_KEYWORD <sub>*Except `crate`, `self`, `super`, `Self`*</sub>
99
>

src/notation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ The following notations are used by the *Lexer* and *Syntax* grammar snippets:
1515
| x<sup>+</sup> | _MacroMatch_<sup>+</sup> | 1 or more of x |
1616
| x<sup>a..b</sup> | HEX_DIGIT<sup>1..6</sup> | a to b repetitions of x |
1717
| \| | `u8` \| `u16`, Block \| Item | Either one or another |
18-
| [ ] | [`b` `B`] | Any of the characters listed |
19-
| [ - ] | [`a`-`z`] | Any of the characters in the range |
20-
| ~[ ] | ~[`b` `B`] | Any characters, except those listed |
18+
| \[ ] | \[`b` `B`] | Any of the characters listed |
19+
| \[ - ] | \[`a`-`z`] | Any of the characters in the range |
20+
| ~\[ ] | ~\[`b` `B`] | Any characters, except those listed |
2121
| ~`string` | ~`\n`, ~`*/` | Any characters, except this sequence |
2222
| ( ) | (`,` _Parameter_)<sup>?</sup> | Groups items |
2323

src/tokens.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ and numeric literal tokens are accepted only with suffixes from the list below.
115115

116116
> **<sup>Lexer</sup>**\
117117
> CHAR_LITERAL :\
118-
> &nbsp;&nbsp; `'` ( ~[`'` `\` \\n \\r \\t] | QUOTE_ESCAPE | ASCII_ESCAPE | UNICODE_ESCAPE ) `'`
118+
> &nbsp;&nbsp; `'` ( ~\[`'` `\` \\n \\r \\t] | QUOTE_ESCAPE | ASCII_ESCAPE | UNICODE_ESCAPE ) `'`
119119
>
120120
> QUOTE_ESCAPE :\
121121
> &nbsp;&nbsp; `\'` | `\"`
@@ -136,7 +136,7 @@ which must be _escaped_ by a preceding `U+005C` character (`\`).
136136
> **<sup>Lexer</sup>**\
137137
> STRING_LITERAL :\
138138
> &nbsp;&nbsp; `"` (\
139-
> &nbsp;&nbsp; &nbsp;&nbsp; ~[`"` `\` _IsolatedCR_]\
139+
> &nbsp;&nbsp; &nbsp;&nbsp; ~\[`"` `\` _IsolatedCR_]\
140140
> &nbsp;&nbsp; &nbsp;&nbsp; | QUOTE_ESCAPE\
141141
> &nbsp;&nbsp; &nbsp;&nbsp; | ASCII_ESCAPE\
142142
> &nbsp;&nbsp; &nbsp;&nbsp; | UNICODE_ESCAPE\
@@ -338,13 +338,13 @@ literal_. The grammar for recognizing the two kinds of literals is mixed.
338338
> HEX_LITERAL :\
339339
> &nbsp;&nbsp; `0x` (HEX_DIGIT|`_`)<sup>\*</sup> HEX_DIGIT (HEX_DIGIT|`_`)<sup>\*</sup>
340340
>
341-
> BIN_DIGIT : [`0`-`1`]
341+
> BIN_DIGIT : \[`0`-`1`]
342342
>
343-
> OCT_DIGIT : [`0`-`7`]
343+
> OCT_DIGIT : \[`0`-`7`]
344344
>
345-
> DEC_DIGIT : [`0`-`9`]
345+
> DEC_DIGIT : \[`0`-`9`]
346346
>
347-
> HEX_DIGIT : [`0`-`9` `a`-`f` `A`-`F`]
347+
> HEX_DIGIT : \[`0`-`9` `a`-`f` `A`-`F`]
348348
>
349349
> INTEGER_SUFFIX :\
350350
> &nbsp;&nbsp; &nbsp;&nbsp; `u8` | `u16` | `u32` | `u64` | `u128` | `usize`\

src/type-layout.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ for interfacing with the C programming language.
177177
This representation can be applied to structs, unions, and enums. The exception
178178
is [zero-variant enums] for which the `C` representation is an error.
179179

180-
#### \#[repr(C)] Structs
180+
#### `#[repr(C)]` Structs
181181

182182
The alignment of the struct is the alignment of the most-aligned field in it.
183183

@@ -244,7 +244,7 @@ the sake of clarity. To perform memory layout computations in actual code, use
244244
> they are fields that have the `[[no_unique_address]]` attribute, in which
245245
> case they do not increase the overall size of the struct.
246246
247-
#### \#[repr(C)] Unions
247+
#### `#[repr(C)]` Unions
248248

249249
A union declared with `#[repr(C)]` will have the same size and alignment as an
250250
equivalent C union declaration in the C language for the target platform.
@@ -274,7 +274,7 @@ assert_eq!(std::mem::size_of::<SizeRoundedUp>(), 8); // Size of 6 from b,
274274
assert_eq!(std::mem::align_of::<SizeRoundedUp>(), 4); // From a
275275
```
276276

277-
#### \#[repr(C)] Field-less Enums
277+
#### `#[repr(C)]` Field-less Enums
278278

279279
For [field-less enums], the `C` representation has the size and alignment of
280280
the default `enum` size and alignment for the target platform's C ABI.
@@ -295,7 +295,7 @@ using a field-less enum in FFI to model a C `enum` is often wrong.
295295

296296
</div>
297297

298-
#### \#[repr(C)] Enums With Fields
298+
#### `#[repr(C)]` Enums With Fields
299299

300300
The representation of a `repr(C)` enum with fields is a `repr(C)` struct with
301301
two fields, also called a "tagged union" in C:
@@ -433,7 +433,7 @@ struct MyVariantD(MyEnumDiscriminant);
433433

434434
> Note: `union`s with non-`Copy` fields are unstable, see [55149].
435435
436-
#### Combining primitive representations of enums with fields and \#[repr(C)]
436+
#### Combining primitive representations of enums with fields and `#[repr(C)]`
437437

438438
For enums with fields, it is also possible to combine `repr(C)` and a
439439
primitive representation (e.g., `repr(C, u8)`). This modifies the [`repr(C)`] by

0 commit comments

Comments
 (0)