From c129641b18156b463cd12318ba956c85a9017e39 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 27 Aug 2017 20:34:57 +0200 Subject: Tenth --- AST.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'AST.hs') diff --git a/AST.hs b/AST.hs index 197edf9..dae2631 100644 --- a/AST.hs +++ b/AST.hs @@ -63,6 +63,7 @@ data Literal | LChar Char | LVar Name | LCall Name [Expression] + | LStr String deriving (Show, Eq) @@ -74,8 +75,8 @@ sizeof (TArr _ _) = 8 instance Pretty Program where prettyI i (Program vars funcs) = - concatMap (++ ("\n" ++ indent i)) $ - map (prettyI i) vars ++ map (prettyI i) funcs + intercalate ("\n" ++ indent i) (map (prettyI i) vars ++ map (prettyI i) funcs) + ++ "\n" where indent n = replicate (2*n) ' ' @@ -182,3 +183,4 @@ instance Pretty Literal where prettyI _ (LVar n) = n prettyI i (LCall n al) = n ++ "(" ++ intercalate ", " (map (prettyI i) al) ++ ")" + prettyI _ (LStr s) = show s -- cgit v1.2.3-54-g00ecf