diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-08-27 20:34:57 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-08-27 20:34:57 +0200 |
commit | c129641b18156b463cd12318ba956c85a9017e39 (patch) | |
tree | 1b17cfa6b009db854380c983b7ea9a00507b9513 /AST.hs | |
parent | aa049227c17f15ad22092f1fcab4410bbf3521ba (diff) |
Tenth
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 |