tools/pas2c.hs
changeset 7038 d853e4385241
parent 7037 7edce323558f
child 7039 e7dc6ddd1e29
--- a/tools/pas2c.hs	Thu May 10 11:29:18 2012 +0400
+++ b/tools/pas2c.hs	Thu May 10 13:16:31 2012 +0400
@@ -638,6 +638,7 @@
 phrase2C NOP = return $ text ";"
 
 phrase2C (BuiltInFunctionCall [] (SimpleReference (Identifier "exit" BTUnknown))) = return $ text "return" <> semi
+phrase2C (BuiltInFunctionCall [] (SimpleReference (Identifier "break" BTUnknown))) = return $ text "break" <> semi
 phrase2C (BuiltInFunctionCall [e] (SimpleReference (Identifier "exit" BTUnknown))) = liftM (\e -> text "return" <+> e <> semi) $ expr2C e
 phrase2C (BuiltInFunctionCall [e] (SimpleReference (Identifier "dec" BTUnknown))) = liftM (\e -> text "--" <> e <> semi) $ expr2C e
 phrase2C (BuiltInFunctionCall [e1, e2] (SimpleReference (Identifier "dec" BTUnknown))) = liftM2 (\a b -> a <> text " -= " <> b <> semi) (expr2C e1) (expr2C e2)
@@ -802,7 +803,7 @@
         a -> do
             e <- expr2C expr
             t <- id2C IOLookup t'    
-            return $ parens t <> e
+            return . parens $ parens t <> e
 ref2C (RefExpression expr) = expr2C expr