• Herbert Valerio Riedel's avatar
    Add -XBinaryLiterals language extension (re #9224) · 1c0b5fdc
    Herbert Valerio Riedel authored
    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's avatarHerbert Valerio Riedel <hvr@gnu.org>
    
    Differential Revision: https://phabricator.haskell.org/D22
    1c0b5fdc
.gitignore 42.7 KB