Commit 2eddcd9b authored by thomie's avatar thomie

Lexer: delete dead code for binary character literals

The Haskell 2010 report chapter 2.6 (Characters and String Literals)

  "Numeric escapes such as \137 are used to designate the character with
  decimal representation 137; octal (e.g. \o137) and hexadecimal (e.g.
  \x37) representations are also allowed."

Commit 1c0b5fdc added syntax for writing
character literals using binary notation (e.g. '\b100100'). But this
code can never be reached, because '\b' already represents "backspace".

Turn on -fwarn-overlapping-patterns to catch such bugs in the future.

Reviewed by: hvr

Differential Revision:
parent 78053f44
......@@ -50,7 +50,6 @@
{-# OPTIONS_GHC -fno-warn-tabs #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
module Lexer (
......@@ -1495,7 +1494,6 @@ lex_escape = do
'x' -> readNum is_hexdigit 16 hexDigit
'o' -> readNum is_octdigit 8 octDecDigit
'b' -> readNum is_bindigit 2 octDecDigit
x | is_decdigit x -> readNum2 is_decdigit 10 octDecDigit (octDecDigit x)
c1 -> do
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment