[project @ 2004-11-10 04:17:50 by wolfgang]
[ghc-hetmet.git] / ghc / compiler / parser / LexCore.hs
index 51d6e8e..1a545a3 100644 (file)
@@ -66,7 +66,7 @@ lexNum cont cs =
  where f sgn cs = 
          case span isDigit cs of
           (digits,'.':c:rest) 
-               | isDigit c -> cont (TKrational r) rest'
+               | isDigit c -> cont (TKrational (fromInteger sgn * r)) rest'
                where ((r,rest'):_) = readFloat (digits ++ ('.':c:rest))
                -- When reading a floating-point number, which is
                -- a bit complicated, use the Haskell 98 library function
@@ -127,4 +127,4 @@ lexDigits :: ReadS String
 lexDigits s =  case span isDigit s of
                 (cs,s') | not (null cs) -> [(cs,s')]
                 otherwise               -> []
-#endif
\ No newline at end of file
+#endif