Skip to content

Commit 2d88621

Browse files
committed
Docs: document E046, E047, E048
1 parent 277f712 commit 2d88621

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

docs/errors/E046.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# E046: unexpected characters in binary literal
2+
3+
Binary number literals start with `0b` and can only contain `0` or `1` digits
4+
(and optionally an `n` to signify a `BigInt`). It is an error to include other
5+
digits in binary number literals:
6+
7+
let minInt64 = 0b1000000000000000000000000000000000000000000000000000000000000000N;
8+
let mouse = [0xf09f, 0b196];
9+
10+
To fix this error, fix or remove the extra digits or letters:
11+
12+
let minInt64 = 0b1000000000000000000000000000000000000000000000000000000000000000n;
13+
14+
Alternatively, convert the binary number literal into a decimal, hexadecimal, or
15+
octal number literal:
16+
17+
let mouse = [0xf09f, 0xb196];

docs/errors/E047.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# E047: unexpected characters in octal literal
2+
3+
Octal number literals start with `0` or `0o` and can only contain digits `0`
4+
through `7` (and optionally an `n` to signify a `BigInt`). It is an error to
5+
include other digits in octal number literals:
6+
7+
let permissions = 0o755N;
8+
let bcdDigits = 0o0123456789;
9+
let million = 0o1e6;
10+
11+
To fix this error, fix or remove the extra digits or letters:
12+
13+
let permissions = 0o755n;
14+
15+
Alternatively, convert the octal number literal into a decimal or hexadecimal
16+
number literal:
17+
18+
let bcdDigits = 123456789;
19+
let million = 1e6;

docs/errors/E048.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# E048: unexpected characters in hex literal
2+
3+
Hexadecimal (hex) number literals start with `0x` and can only contain digits
4+
`0` through `9` and `a` through `f` (and optionally an `n` to signify a
5+
`BigInt`). It is an error to include other letters in hex number literals:
6+
7+
let hungry = 0xfeedme;
8+
9+
To fix this error, fix or remove the extra digits or letters:
10+
11+
let hungry = 0xfeedad00d;

0 commit comments

Comments
 (0)