diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-06-21 11:38:17 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-06-27 20:46:32 +0200 |
commit | 1c0b5fdc9f2b6ea8166cc565383d4cd20432343c (patch) | |
tree | 52a6c1679d03672ff4e03c22642ad0b876d5ed51 /testsuite/tests/parser/should_fail/all.T | |
parent | f4766c4b4ad10ef7c58bc6b443ec244a07c68bf5 (diff) | |
download | haskell-1c0b5fdc9f2b6ea8166cc565383d4cd20432343c.tar.gz |
Add -XBinaryLiterals language extension (re #9224)
Haskell2010 supports
- base-10 (prefix-less),
- base-8 (via `0[oO]`-prefix), and
- base-16 (via `0[xX]`-prefix) integer literals.
This commit adds syntax support for base-2 integer literals via the new `0[bB]`
prefix. The use of a `0b` prefix for indicating binary literals is known
from popular programming languages such as C++14, Perl, Python, Ruby, and Java.
This syntax extension is disabled by default and can be enabled via the
new `{-# LANGUAGE BinaryLiterals #-}` pragma and/or the new `-XBinaryLiterals`
This new extensions requires to upgrade the `ExtsBitmap` type from
`Word` to `Word64` as this adds a 33th flag which is not guaranteed to
fit into a `Word`.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Differential Revision: https://phabricator.haskell.org/D22
Diffstat (limited to 'testsuite/tests/parser/should_fail/all.T')
-rw-r--r-- | testsuite/tests/parser/should_fail/all.T | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 45c471e2c6..7e286cf3f2 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -75,6 +75,9 @@ test('readFailTraditionalRecords3', normal, compile_fail, ['']) test('ParserNoForallUnicode', normal, compile_fail, ['']) test('ParserNoLambdaCase', when(compiler_lt('ghc', '7.5'), skip), compile_fail, ['']) test('ParserNoMultiWayIf', when(compiler_lt('ghc', '7.5'), skip), compile_fail, ['']) +test('ParserNoBinaryLiterals1', normal, compile_fail, ['']) +test('ParserNoBinaryLiterals2', normal, compile_fail, ['']) +test('ParserNoBinaryLiterals3', normal, compile_fail, ['']) test('T5425', normal, compile_fail, ['']) test('T984', normal, compile_fail, ['']) |