Skip to content

Commit d39a3e1

Browse files
authored
Merge pull request #338 from bstrie/patch-5
Fixups for token ref
2 parents 25e2c77 + 2dc3f36 commit d39a3e1

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/tokens.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ evaluated (primarily) at compile time.
2020
#### Characters and strings
2121

2222
| | Example | `#` sets | Characters | Escapes |
23-
|----------------------------------------------|-----------------|------------|-------------|---------------------|
24-
| [Character](#character-literals) | `'H'` | `N/A` | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
25-
| [String](#string-literals) | `"hello"` | `N/A` | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
26-
| [Raw](#raw-string-literals) | `r#"hello"#` | `0...` | All Unicode | `N/A` |
27-
| [Byte](#byte-literals) | `b'H'` | `N/A` | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) |
28-
| [Byte string](#byte-string-literals) | `b"hello"` | `N/A` | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) |
29-
| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | `0...` | All ASCII | `N/A` |
23+
|----------------------------------------------|-----------------|-------------|-------------|---------------------|
24+
| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
25+
| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
26+
| [Raw](#raw-string-literals) | `r#"hello"#` | 0 or more\* | All Unicode | `N/A` |
27+
| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) |
28+
| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) |
29+
| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | 0 or more\* | All ASCII | `N/A` |
30+
31+
\* The number of `#`s on each side of the same literal must be equivalent
3032

3133
#### ASCII escapes
3234

@@ -79,7 +81,7 @@ evaluated (primarily) at compile time.
7981

8082
| Integer | Floating-point |
8183
|---------|----------------|
82-
| `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `u64`, `i64`, `isize`, `usize` | `f32`, `f64` |
84+
| `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `u64`, `i64`, `u128`, `i128`, `isize`, `usize` | `f32`, `f64` |
8385

8486
### Character and string literals
8587

@@ -142,7 +144,7 @@ Some additional _escapes_ are available in either character or non-raw string
142144
literals. An escape starts with a `U+005C` (`\`) and continues with one of the
143145
following forms:
144146

145-
* An _8-bit code point escape_ starts with `U+0078` (`x`) and is
147+
* A _7-bit code point escape_ starts with `U+0078` (`x`) and is
146148
followed by exactly two _hex digits_ with value up to `0x7F`. It denotes the
147149
ASCII character with value equal to the provided hex value. Higher values are
148150
not permitted because it is ambiguous whether they mean Unicode code points or
@@ -202,7 +204,7 @@ r##"foo #"# bar"##; // foo #"# bar
202204
>    `b'` ( ASCII_FOR_CHAR | BYTE_ESCAPE ) `'`
203205
>
204206
> ASCII_FOR_CHAR :
205-
>    _any ASCII (i.e. 0x00 to 0x7F), except_ `'`, `/`, \\n, \\r or \\t
207+
>    _any ASCII (i.e. 0x00 to 0x7F), except_ `'`, `\`, \\n, \\r or \\t
206208
>
207209
> BYTE_ESCAPE :
208210
>       `\x` HEX_DIGIT HEX_DIGIT
@@ -222,7 +224,7 @@ _number literal_.
222224
> &nbsp;&nbsp; `b"` ( ASCII_FOR_STRING | BYTE_ESCAPE | STRING_CONTINUE )<sup>\*</sup> `"`
223225
>
224226
> ASCII_FOR_STRING :
225-
> &nbsp;&nbsp; _any ASCII (i.e 0x00 to 0x7F), except_ `"`, `/` _and IsolatedCR_
227+
> &nbsp;&nbsp; _any ASCII (i.e 0x00 to 0x7F), except_ `"`, `\` _and IsolatedCR_
226228
227229
A non-raw _byte string literal_ is a sequence of ASCII characters and _escapes_,
228230
preceded by the characters `U+0062` (`b`) and `U+0022` (double-quote), and
@@ -324,10 +326,8 @@ literal_. The grammar for recognizing the two kinds of literals is mixed.
324326
> HEX_DIGIT : [`0`-`9` `a`-`f` `A`-`F`]
325327
>
326328
> INTEGER_SUFFIX :
327-
> &nbsp;&nbsp; &nbsp;&nbsp; `u8` | `u16` | `u32` | `u64` | `usize`
328-
> &nbsp;&nbsp; | `i8` | `i16` | `i32` | `i64` | `isize`
329-
330-
<!-- FIXME: u128 and i128 -->
329+
> &nbsp;&nbsp; &nbsp;&nbsp; `u8` | `u16` | `u32` | `u64` | `u128` | `usize`
330+
> &nbsp;&nbsp; | `i8` | `i16` | `i32` | `i64` | `i128` | `isize`
331331
332332
An _integer literal_ has one of four forms:
333333

@@ -350,7 +350,7 @@ Like any literal, an integer literal may be followed (immediately,
350350
without any spaces) by an _integer suffix_, which forcibly sets the
351351
type of the literal. The integer suffix must be the name of one of the
352352
integral types: `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `u64`, `i64`,
353-
`isize`, or `usize`.
353+
`u128`, `i128`, `isize`, or `usize`.
354354

355355
The type of an _unsuffixed_ integer literal is determined by type inference:
356356

0 commit comments

Comments
 (0)