diff options
Diffstat (limited to 'AST.hs')
-rw-r--r-- | AST.hs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 |