cvs commit: fptools/ghc/compiler/basicTypes MkId.lhs fptools/ghc/compiler/coreSyn CoreUtils.lhs MkExternalCore.lhs fptools/ghc/compiler/deSugar Desugar.lhs DsCCall.lhs DsExpr.lhs DsUtils.lhs fptools/ghc/compiler/hsSyn HsDecls.lhs HsExpr.lhs ...

Sven Panne Sven.Panne@informatik.uni-muenchen.de
Sun, 14 Apr 2002 12:24:40 +0200


Hmmm,

I fear this commit broke lexing in a basic way:

-- GHC.Text.Read.Lex -------------------------------------------------
...
data Lexeme
   = Char   Char
   | String String
   | Single Char
   | Symbol String
   | Ident  String
   | Number Number
  deriving (Eq)
...
-- GHC.Read ----------------------------------------------------------
...
lex :: ReadS String		-- As defined by H98
lex "" = [("","")] -- ugly hack
lex s  = readP_to_S (do { lexeme <- L.lex ;
		          return (show lexeme) }) s

lexLitChar :: ReadS String	-- As defined by H98
lexLitChar = readP_to_S (do { lexeme <- L.lexLitChar ;
			      return (show lexeme) })
...
----------------------------------------------------------------------

Converting a String to a Char/Number and back again to a String is *not* the
identity function, I'm afraid. Furthermore, GHC.Text.Read.Lex.lexNumberBase
doesn't even handle negative exponents correctly...   *sigh*
:-(

Cheers,
    S.