[project @ 2003-04-01 16:32:04 by simonpj]
authorsimonpj <unknown>
Tue, 1 Apr 2003 16:32:04 +0000 (16:32 +0000)
committersimonpj <unknown>
Tue, 1 Apr 2003 16:32:04 +0000 (16:32 +0000)
Fix bogus implementation of readLitChar, lexLitChar

GHC/Read.lhs

index 17a9d81..5f15a0f 100644 (file)
@@ -158,13 +158,13 @@ lex :: ReadS String               -- As defined by H98
 lex s  = readP_to_S L.hsLex s
 
 lexLitChar :: ReadS String     -- As defined by H98
-lexLitChar = readP_to_S (do { P.skipSpaces ;
-                             (s, L.Char _) <- P.gather L.lex ;
+lexLitChar = readP_to_S (do { (s, _) <- P.gather L.lexChar ;
                              return s })
+       -- There was a skipSpaces before the P.gather L.lexChar,
+       -- but that seems inconsistent with readLitChar
 
 readLitChar :: ReadS Char      -- As defined by H98
-readLitChar = readP_to_S (do { L.Char c <- L.lex ;
-                              return c })
+readLitChar = readP_to_S L.lexChar
 
 lexDigits :: ReadS String
 lexDigits = readP_to_S (P.munch1 isDigit)