Commit 484fb866 authored by Laszlo Domoszlai's avatar Laszlo Domoszlai

fix stringifying floating point numbers

parent b460c84b
......@@ -195,12 +195,15 @@ where
True = let (_, newbase, t) = read_token base inp in tokens_ newbase [t:ts]
= reverse ts
toStringR :: Real -> String
toStringR r = if (r - toReal(entier r) == 0.0) (toString r +++ ".0") (toString r)
instance toString Literal
where
toString (LString ustr) = "\"" +++ toJSLiteral ustr +++ "\""
toString (LChar uchr) = "'" +++ toJSLiteral uchr +++ "'"
toString (LInt int) = toString int
toString (LReal real) = toString real
toString (LReal real) = toStringR real
toString (LBool True) = "True"
toString (LBool False) = "False"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment