[project @ 1997-07-27 09:14:11 by sof]
authorsof <unknown>
Sun, 27 Jul 1997 09:14:11 +0000 (09:14 +0000)
committersof <unknown>
Sun, 27 Jul 1997 09:14:11 +0000 (09:14 +0000)
Use readRational__ rather than readRational (it copes with leading -)

ghc/compiler/reader/ReadPrefix.lhs

index 18ec5b6..d16dc74 100644 (file)
@@ -512,8 +512,11 @@ wlkLiteral ulit
     as_integer s  = readInteger (_UNPK_ s)
 #if __GLASGOW_HASKELL__ == 201
     as_rational s = GHCbase.readRational__ (_UNPK_ s) -- non-std
-#elif __GLASGOW_HASKELL__ >= 202
-    as_rational s = case readRational (_UNPK_ s) of { [(a,_)] -> a } -- ToDo, use non-std readRational__
+#elif __GLASGOW_HASKELL__ == 202
+    as_rational s = case readRational (_UNPK_ s) of { [(a,_)] -> a }
+#elif __GLASGOW_HASKELL__ >= 203
+    as_rational s = readRational__ (_UNPK_ s) -- use non-std readRational__ 
+                                             -- to handle rationals with leading '-'
 #else
     as_rational s = _readRational (_UNPK_ s) -- non-std
 #endif