tools/pas2c.hs
changeset 7060 861d6897917f
parent 7057 c3eba84d1a98
child 7062 7efe16575779
--- a/tools/pas2c.hs	Fri May 11 22:54:19 2012 +0400
+++ b/tools/pas2c.hs	Fri May 11 23:03:28 2012 +0400
@@ -664,7 +664,7 @@
 
 expr2C :: Expression -> State RenderState Doc
 expr2C (Expression s) = return $ text s
-expr2C (BinOp op expr1 expr2) = do
+expr2C b@(BinOp op expr1 expr2) = do
     e1 <- expr2C expr1
     t1 <- gets lastType
     e2 <- expr2C expr2
@@ -764,13 +764,17 @@
     i <- id2C IOLookup name
     t <- gets lastType
     case t of
-         BTFunction {} -> return $ i <> parens empty
+         BTFunction _ rt -> do
+             modify(\s -> s{lastType = rt})
+             return $ i <> parens empty
          _ -> return $ i
 ref2CF r@(RecordField (SimpleReference _) (SimpleReference _)) = do
     i <- ref2C r
     t <- gets lastType
     case t of
-         BTFunction {} -> return $ i <> parens empty
+         BTFunction _ rt -> do
+             modify(\s -> s{lastType = rt})
+             return $ i <> parens empty
          _ -> return $ i
 ref2CF r = ref2C r