Skip to content

Commit de04442

Browse files
authored
Merge pull request #2113 from ehuss/unwrap-lexical
Unwrap all of the lexical chapters
2 parents 7fdd2e9 + 36f8667 commit de04442

File tree

6 files changed

+69
-203
lines changed

6 files changed

+69
-203
lines changed

src/comments.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ OUTER_BLOCK_DOC ->
3939
r[comments.normal]
4040
## Non-doc comments
4141

42-
Comments follow the general C++ style of line (`//`) and
43-
block (`/* ... */`) comment forms. Nested block comments are supported.
42+
Comments follow the general C++ style of line (`//`) and block (`/* ... */`) comment forms. Nested block comments are supported.
4443

4544
r[comments.normal.tokenization]
4645
Non-doc comments are interpreted as a form of whitespace.
@@ -49,25 +48,16 @@ r[comments.doc]
4948
## Doc comments
5049

5150
r[comments.doc.syntax]
52-
Line doc comments beginning with exactly _three_ slashes (`///`), and block
53-
doc comments (`/** ... */`), both outer doc comments, are interpreted as a
54-
special syntax for [`doc` attributes].
51+
Line doc comments beginning with exactly _three_ slashes (`///`), and block doc comments (`/** ... */`), both outer doc comments, are interpreted as a special syntax for [`doc` attributes].
5552

5653
r[comments.doc.attributes]
57-
That is, they are equivalent to writing
58-
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
59-
`#[doc="Foo"]` and `/** Bar */` turns into `#[doc="Bar"]`. They must therefore
60-
appear before something that accepts an outer attribute.
54+
That is, they are equivalent to writing `#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into `#[doc="Foo"]` and `/** Bar */` turns into `#[doc="Bar"]`. They must therefore appear before something that accepts an outer attribute.
6155

6256
r[comments.doc.inner-syntax]
63-
Line comments beginning with `//!` and block comments `/*! ... */` are
64-
doc comments that apply to the parent of the comment, rather than the item
65-
that follows.
57+
Line comments beginning with `//!` and block comments `/*! ... */` are doc comments that apply to the parent of the comment, rather than the item that follows.
6658

6759
r[comments.doc.inner-attributes]
68-
That is, they are equivalent to writing `#![doc="..."]` around
69-
the body of the comment. `//!` comments are usually used to document
70-
modules that occupy a source file.
60+
That is, they are equivalent to writing `#![doc="..."]` around the body of the comment. `//!` comments are usually used to document modules that occupy a source file.
7161

7262
r[comments.doc.bare-crs]
7363
The character `U+000D` (CR) is not allowed in doc comments.

src/identifiers.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ r[ident.raw]
6464
## Raw identifiers
6565

6666
r[ident.raw.intro]
67-
A raw identifier is like a normal identifier, but prefixed by `r#`. (Note that
68-
the `r#` prefix is not included as part of the actual identifier.)
67+
A raw identifier is like a normal identifier, but prefixed by `r#`. (Note that the `r#` prefix is not included as part of the actual identifier.)
6968

7069
r[ident.raw.allowed]
71-
Unlike a normal identifier, a raw identifier may be any strict or reserved
72-
keyword except the ones listed above for `RAW_IDENTIFIER`.
70+
Unlike a normal identifier, a raw identifier may be any strict or reserved keyword except the ones listed above for `RAW_IDENTIFIER`.
7371

7472
r[ident.raw.reserved]
7573
It is an error to use the [RESERVED_RAW_IDENTIFIER] token.

src/input-format.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ If the first character in the sequence is `U+FEFF` ([BYTE ORDER MARK]), it is re
3030
r[input.crlf]
3131
## CRLF normalization
3232

33-
Each pair of characters `U+000D` (CR) immediately followed by `U+000A` (LF) is replaced by a single `U+000A` (LF).
34-
This happens once, not repeatedly, so after the normalization, there can still exist `U+000D` (CR) immediately followed by `U+000A` (LF) in the input (e.g. if the raw input contained "CR CR LF LF").
33+
Each pair of characters `U+000D` (CR) immediately followed by `U+000A` (LF) is replaced by a single `U+000A` (LF). This happens once, not repeatedly, so after the normalization, there can still exist `U+000D` (CR) immediately followed by `U+000A` (LF) in the input (e.g. if the raw input contained "CR CR LF LF").
3534

3635
Other occurrences of the character `U+000D` (CR) are left in place (they are treated as [whitespace]).
3736

@@ -53,8 +52,7 @@ fn main() {
5352
```
5453

5554
r[input.shebang.inner-attribute]
56-
As an exception, if the `#!` characters are followed (ignoring intervening [comments] or [whitespace]) by a `[` token, nothing is removed.
57-
This prevents an [inner attribute] at the start of a source file being removed.
55+
As an exception, if the `#!` characters are followed (ignoring intervening [comments] or [whitespace]) by a `[` token, nothing is removed. This prevents an [inner attribute] at the start of a source file being removed.
5856

5957
> [!NOTE]
6058
> The standard library [`include!`] macro applies byte order mark removal, CRLF normalization, and shebang removal to the file it reads. The [`include_str!`] and [`include_bytes!`] macros do not.

src/keywords.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ r[lex.keywords.strict]
1111
## Strict keywords
1212

1313
r[lex.keywords.strict.intro]
14-
These keywords can only be used in their correct contexts. They cannot
15-
be used as the names of:
14+
These keywords can only be used in their correct contexts. They cannot be used as the names of:
1615

1716
* [Items]
1817
* [Variables] and function parameters
@@ -78,10 +77,7 @@ r[lex.keywords.reserved]
7877
## Reserved keywords
7978

8079
r[lex.keywords.reserved.intro]
81-
These keywords aren't used yet, but they are reserved for future use. They have
82-
the same restrictions as strict keywords. The reasoning behind this is to make
83-
current programs forward compatible with future versions of Rust by forbidding
84-
them to use these keywords.
80+
These keywords aren't used yet, but they are reserved for future use. They have the same restrictions as strict keywords. The reasoning behind this is to make current programs forward compatible with future versions of Rust by forbidding them to use these keywords.
8581

8682
r[lex.keywords.reserved.list]
8783
- `abstract`
@@ -111,8 +107,7 @@ r[lex.keywords.weak]
111107
## Weak keywords
112108

113109
r[lex.keywords.weak.intro]
114-
These keywords have special meaning only in certain contexts. For example, it
115-
is possible to declare a variable or method with the name `union`.
110+
These keywords have special meaning only in certain contexts. For example, it is possible to declare a variable or method with the name `union`.
116111

117112
- `'static`
118113
- `macro_rules`
@@ -124,12 +119,10 @@ r[lex.keywords.weak.macro_rules]
124119
* `macro_rules` is used to create custom [macros].
125120

126121
r[lex.keywords.weak.union]
127-
* `union` is used to declare a [union] and is only a keyword when used in a
128-
union declaration.
122+
* `union` is used to declare a [union] and is only a keyword when used in a union declaration.
129123

130124
r[lex.keywords.weak.lifetime-static]
131-
* `'static` is used for the static lifetime and cannot be used as a [generic
132-
lifetime parameter] or [loop label]
125+
* `'static` is used for the static lifetime and cannot be used as a [generic lifetime parameter] or [loop label]
133126

134127
```compile_fail
135128
// error[E0262]: invalid lifetime parameter name: `'static`

0 commit comments

Comments
 (0)