Skip to content

Commit

Permalink
Merge pull request #1444 from Jules-Bertholet/patch-1
Browse files Browse the repository at this point in the history
Use proper footnote for number literals `_` separator note
  • Loading branch information
ehuss authored Dec 29, 2023
2 parents f9f5b5b + ad9a69c commit 3565c79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Literals are tokens used in [literal expressions].

#### Characters and strings

| | Example | `#` sets\* | Characters | Escapes |
| | Example | `#` sets[^nsets] | Characters | Escapes |
|----------------------------------------------|-----------------|------------|-------------|---------------------|
| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
Expand All @@ -35,7 +35,7 @@ Literals are tokens used in [literal expressions].
| [C string](#c-string-literals) | `c"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [Byte](#byte-escapes) & [Unicode](#unicode-escapes) |
| [Raw C string](#raw-c-string-literals) | `cr#"hello"#` | <256 | All Unicode | `N/A` |

\* The number of `#`s on each side of the same literal must be equivalent.
[^nsets]: The number of `#`s on each side of the same literal must be equivalent.

#### ASCII escapes

Expand Down Expand Up @@ -74,15 +74,15 @@ Literals are tokens used in [literal expressions].

#### Numbers

| [Number literals](#number-literals)`*` | Example | Exponentiation |
| [Number literals](#number-literals)[^nl] | Example | Exponentiation |
|----------------------------------------|---------|----------------|
| Decimal integer | `98_222` | `N/A` |
| Hex integer | `0xff` | `N/A` |
| Octal integer | `0o77` | `N/A` |
| Binary integer | `0b1111_0000` | `N/A` |
| Floating-point | `123.0E+77` | `Optional` |

`*` All number literals allow `_` as a visual separator: `1_234.0E+18f64`
[^nl]: All number literals allow `_` as a visual separator: `1_234.0E+18f64`

#### Suffixes

Expand Down

0 comments on commit 3565c79

Please sign in to comment.