Skip to content

Commit

Permalink
Revert "Implement SIP-42 - Support for binary integer literals" (#19694)
Browse files Browse the repository at this point in the history
Reverts #19405 as it was marked as needing minor release.
  • Loading branch information
Kordyjan authored Feb 15, 2024
2 parents e96cb18 + 465bf65 commit de4c4ed
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 105 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Scanners.scala
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ object Scanners {
nextChar()
ch match {
case 'x' | 'X' => base = 16 ; nextChar()
case 'b' | 'B' => base = 2 ; nextChar()
//case 'b' | 'B' => base = 2 ; nextChar()
case _ => base = 10 ; putChar('0')
}
if (base != 10 && !isNumberSeparator(ch) && digit2int(ch, base) < 0)
Expand Down
19 changes: 0 additions & 19 deletions docs/_docs/reference/other-new-features/binary-literals.md

This file was deleted.

5 changes: 2 additions & 3 deletions docs/_spec/01-lexical-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,9 @@ Literal ::= [‘-’] integerLiteral
### Integer Literals

```ebnf
integerLiteral ::= (decimalNumeral | hexNumeral | binaryNumeral) [‘L’ | ‘l’]
integerLiteral ::= (decimalNumeral | hexNumeral) [‘L’ | ‘l’]
decimalNumeral ::= ‘0’ | digit [{digit | ‘_’} digit]
hexNumeral ::= ‘0’ (‘x’ | ‘X’) hexDigit [{hexDigit | ‘_’} hexDigit]
binaryNumeral ::= ‘0’ (‘b’ | ‘B’) binaryDigit [{binaryDigit | ‘_’} binaryDigit]
```

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

> ```scala
> 0 21_000 0x7F -42L 0xFFFF_FFFF 0b0100_0010
> 0 21_000 0x7F -42L 0xFFFF_FFFF
> ```
### Floating Point Literals
Expand Down
1 change: 0 additions & 1 deletion docs/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ subsection:
- page: reference/other-new-features/safe-initialization.md
- page: reference/other-new-features/type-test.md
- page: reference/other-new-features/experimental-defs.md
- page: reference/other-new-features/binary-literals.md
- title: Other Changed Features
directory: changed-features
index: reference/changed-features/changed-features.md
Expand Down
1 change: 0 additions & 1 deletion project/resources/referenceReplacements/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ subsection:
- page: reference/other-new-features/safe-initialization.md
- page: reference/other-new-features/type-test.md
- page: reference/other-new-features/experimental-defs.md
- page: reference/other-new-features/binary-literals.md
- title: Other Changed Features
directory: changed-features
index: reference/changed-features/changed-features.md
Expand Down
8 changes: 0 additions & 8 deletions tests/neg/binaryLiterals.scala

This file was deleted.

72 changes: 0 additions & 72 deletions tests/run/binaryLiterals.scala

This file was deleted.

0 comments on commit de4c4ed

Please sign in to comment.