Skip to content

Commit c6275c4

Browse files
frewsxcvsteveklabnik
authored andcommitted
Tokens
1 parent 94f3c1e commit c6275c4

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

src/doc/reference/src/tokens.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
Tokens are primitive productions in the grammar defined by regular
44
(non-recursive) languages. "Simple" tokens are given in [string table
5-
production](#string-table-productions) form, and occur in the rest of the
5+
production] form, and occur in the rest of the
66
grammar as double-quoted strings. Other tokens have exact rules given.
77

8+
[string table production]: string-table-productions.html
9+
810
## Literals
911

1012
A literal is an expression consisting of a single token, rather than a sequence
@@ -254,9 +256,11 @@ Examples of integer literals of various forms:
254256
```
255257

256258
Note that the Rust syntax considers `-1i8` as an application of the [unary minus
257-
operator](#unary-operator-expressions) to an integer literal `1i8`, rather than
259+
operator] to an integer literal `1i8`, rather than
258260
a single integer literal.
259261

262+
[unary minus operator]: expressions.html#unary-operator-expressions
263+
260264
#### Floating-point literals
261265

262266
A _floating-point literal_ has one of two forms:
@@ -298,19 +302,25 @@ syntax with a floating point literal ending in a period. `2.f64` would attempt
298302
to call a method named `f64` on `2`.
299303

300304
The representation semantics of floating-point numbers are described in
301-
["Machine Types"](#machine-types).
305+
["Machine Types"].
306+
307+
["Machine Types"]: types.html#machine-types
302308

303309
### Boolean literals
304310

305311
The two values of the boolean type are written `true` and `false`.
306312

307313
## Symbols
308314

309-
Symbols are a general class of printable [tokens](#tokens) that play structural
315+
Symbols are a general class of printable [tokens] that play structural
310316
roles in a variety of grammar productions. They are a
311317
set of remaining miscellaneous printable tokens that do not
312-
otherwise appear as [unary operators](#unary-operator-expressions), [binary
313-
operators](#binary-operator-expressions), or [keywords][keywords].
318+
otherwise appear as [unary operators], [binary
319+
operators], or [keywords].
314320
They are catalogued in [the Symbols section][symbols] of the Grammar document.
315321

316-
[symbols]: grammar.html#symbols
322+
[unary operators]: expressions.html#unary-operator-expressions
323+
[binary operators]: expressions.html#binary-operator-expressions
324+
[tokens]: #tokens
325+
[symbols]: ../grammar.html#symbols
326+
[keywords]: ../grammar.html#keywords

0 commit comments

Comments
 (0)