Added a work-around for generating infinity and NaN in the C backend
This commit is contained in:
parent
86bbdc8b8e
commit
733293745e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user