Ticket #5688: 5688-do-not-parse-exp-for-integers.patch

File 5688-do-not-parse-exp-for-integers.patch, 603 bytes (added by gracjan, 2 years ago)
  • Text/Read/Lex.hs

    diff --git a/Text/Read/Lex.hs b/Text/Read/Lex.hs
    index 310c715..92101ed 100644
    a b lexDecNumber = 
    345345  valueFracExp a Nothing Nothing 
    346346    = Int a                                             -- 43 
    347347  valueFracExp a Nothing (Just exp) 
    348     | exp >= 0  = Int (a * (10 ^ exp))                  -- 43e7 
     348    | exp >= 0  = Rat (a * (10 ^ exp) % 1)              -- 43e7 
    349349    | otherwise = Rat (a % (10 ^ (-exp)))               -- 43e-7 
    350350  valueFracExp a (Just fs) mExp                         -- 4.3[e2] 
    351351    = Rat (fracExp (fromMaybe 0 mExp) a fs)