2020-06-07 00:21:15 +02:00
|
|
|
---
|
|
|
|
type: scan
|
|
|
|
expect: BoltIntegerLiteral
|
|
|
|
split-lines: true
|
|
|
|
---
|
|
|
|
|
|
|
|
All decimal digits are valid integers.
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
```
|
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
|
|
|
6
|
|
|
|
7
|
|
|
|
8
|
|
|
|
9
|
|
|
|
0
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
Any combination of decimal digits are valid integers, including integers
|
|
|
|
prefixed with an abirary amount of zeroes.
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
```
|
|
|
|
12345
|
|
|
|
99
|
|
|
|
10
|
|
|
|
01
|
|
|
|
000
|
|
|
|
0010
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
In binary mode, integers are read in base-2.
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
```
|
|
|
|
0b0
|
|
|
|
0b1
|
|
|
|
0b10010
|
|
|
|
0b00100
|
|
|
|
0b00000
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
This means the following expressions are invalid in binary mode:
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
```
|
|
|
|
0b20001
|
|
|
|
0b12345
|
|
|
|
0b00003
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
In octal mode, integers are read in base-8.
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
```
|
|
|
|
0o0
|
|
|
|
0o00000
|
|
|
|
0o007
|
|
|
|
0o706
|
|
|
|
0o12345
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
This means the following expressions are invalid in octal mode:
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
```
|
|
|
|
0o8
|
|
|
|
0o9
|
|
|
|
0o123456789
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|