Added a work-around for generating infinity and NaN in the C backend

This commit is contained in:
Neil Brown 2009-03-26 18:39:23 +00:00
parent 86bbdc8b8e
commit 733293745e

View File

@ -531,7 +531,10 @@ cgenListAssign v e
tell [";"]
cgenLiteralRepr :: A.LiteralRepr -> A.Type -> CGen ()
cgenLiteralRepr (A.RealLiteral m s) t = tell [s] >> genLitSuffix t
cgenLiteralRepr (A.RealLiteral m s) t
| "Infinity" `isPrefixOf` s = tell ["INFINITY"]
| "NaN" `isPrefixOf` s = tell ["NAN"]
| otherwise = tell [s] >> genLitSuffix t
cgenLiteralRepr (A.IntLiteral m s) t
= do genDecimal s
genLitSuffix t