From f0b63670508b9e9069e5e7873f90da758a0290d0 Mon Sep 17 00:00:00 2001 From: panne Date: Sat, 13 Apr 2002 14:59:06 +0000 Subject: [PATCH] [project @ 2002-04-13 14:59:06 by panne] Ugly hack to make `lex' H98-compliant again: lex "" should return [("","")], not []. This should probably be fixed elsewhere... --- GHC/Read.lhs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GHC/Read.lhs b/GHC/Read.lhs index a8240c6..6a23d61 100644 --- a/GHC/Read.lhs +++ b/GHC/Read.lhs @@ -1,5 +1,5 @@ % ------------------------------------------------------------------------------ -% $Id: Read.lhs,v 1.5 2002/04/13 05:08:55 sof Exp $ +% $Id: Read.lhs,v 1.6 2002/04/13 14:59:06 panne Exp $ % % (c) The University of Glasgow, 1994-2000 % @@ -168,8 +168,9 @@ read s = either error id (readEither s) -- H98 compatibility lex :: ReadS String -- As defined by H98 -lex = readP_to_S (do { lexeme <- L.lex ; - return (show lexeme) }) +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 ; -- 1.7.10.4