on master help sign in
Make pretty printing code nicer
c61d87fEvan Czaplicki
src/AST/Literal.hs+10−5
@@ -18,12 +18,17 @@ data Literal
18
18
19instance P.Pretty Literal where
19instance P.Pretty Literal where
20 pretty _ _ literal =
20 pretty _ _ literal =
21+ P.text (toString literal)
22+
23+
24+toString :: Literal -> String
25+toString literal =
21 case literal of
26 case literal of
22− IntNum n -> P.int n
27+ IntNum n -> show n
23− FloatNum n -> P.double n
28+ FloatNum n -> show n
24− Chr c -> P.text . show $ c
29+ Chr c -> show c
25− Str s -> P.text . show $ s
30+ Str s -> show s
26− Boolean bool -> P.text (show bool)
31+ Boolean bool -> show bool
27
32
28
33
29data GLTipe
34data GLTipe