Better 'else' part
authorunc0rr
Thu, 03 Nov 2011 23:16:26 +0300
changeset 6274 a3e1eb794249
parent 6273 13262c6e5027
child 6275 f1b4f37dba22
child 6276 1e2f8da1860a
Better 'else' part
tools/pas2c.hs
--- a/tools/pas2c.hs	Thu Nov 03 23:12:22 2011 +0300
+++ b/tools/pas2c.hs	Thu Nov 03 23:16:26 2011 +0300
@@ -32,7 +32,7 @@
 phrase2C :: Phrase -> Doc
 phrase2C (Phrases p) = braces . nest 4 . vcat . map phrase2C $ p
 phrase2C (ProcCall (Identifier name) params) = text name <> parens (hsep . punctuate (char ',') . map expr2C $ params) <> semi
-phrase2C (IfThenElse (expr) phrase1 mphrase2) = text "if" <> parens (expr2C expr) $$ (braces . nest 4 . phrase2C) phrase1 <+> elsePart
+phrase2C (IfThenElse (expr) phrase1 mphrase2) = text "if" <> parens (expr2C expr) $$ (braces . nest 4 . phrase2C) phrase1 $+$ elsePart
     where
     elsePart | isNothing mphrase2 = empty
              | otherwise = text "else" $$ (braces . nest 4 . phrase2C) (fromJust mphrase2)