Skip to content

Commit 877ef4c

Browse files
committed
Final touches
1 parent 8918a5a commit 877ef4c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/_spec/01-lexical-syntax.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,10 @@ Literal ::= [‘-’] integerLiteral
332332
### Integer Literals
333333

334334
```ebnf
335-
integerLiteral ::= (decimalNumeral | hexNumeral) [‘L’ | ‘l’]
335+
integerLiteral ::= (decimalNumeral | hexNumeral | binaryNumeral) [‘L’ | ‘l’]
336336
decimalNumeral ::= ‘0’ | digit [{digit | ‘_’} digit]
337337
hexNumeral ::= ‘0’ (‘x’ | ‘X’) hexDigit [{hexDigit | ‘_’} hexDigit]
338+
binaryNumeral ::= ‘0’ (‘b’ | ‘B’) binaryDigit [{binaryDigit | ‘_’} binaryDigit]
338339
```
339340

340341
Values of type `Int` are all integer numbers between $-2\^{31}$ and $2\^{31}-1$, inclusive.
@@ -357,7 +358,7 @@ The numeric ranges given by these types are:
357358
The digits of a numeric literal may be separated by arbitrarily many underscores for purposes of legibility.
358359

359360
> ```scala
360-
> 0 21_000 0x7F -42L 0xFFFF_FFFF
361+
> 0 21_000 0x7F -42L 0xFFFF_FFFF 0b0100_0010
361362
> ```
362363
363364
### Floating Point Literals

project/resources/referenceReplacements/sidebar.yml

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ subsection:
7777
- page: reference/other-new-features/safe-initialization.md
7878
- page: reference/other-new-features/type-test.md
7979
- page: reference/other-new-features/experimental-defs.md
80+
- page: reference/other-new-features/binary-literals.md
8081
- title: Other Changed Features
8182
directory: changed-features
8283
index: reference/changed-features/changed-features.md

0 commit comments

Comments
 (0)