Recognize (hwFloat op int) expressions
authorunc0rr
Fri, 11 May 2012 22:17:39 +0400
changeset 7056 2884c7be6691
parent 7055 4c495c8f02da
child 7057 c3eba84d1a98
Recognize (hwFloat op int) expressions
tools/pas2c.hs
--- a/tools/pas2c.hs	Fri May 11 22:09:34 2012 +0400
+++ b/tools/pas2c.hs	Fri May 11 22:17:39 2012 +0400
@@ -681,6 +681,10 @@
         (_, BTRecord t1 _, BTRecord t2 _) -> do
             i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier t2 undefined)]
             ref2C $ FunCall [expr1, expr2] (SimpleReference i)
+        (_, BTRecord t1 _, BTInt) -> do
+            -- aw, "LongInt" here is hwengine-specific hack
+            i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier "LongInt" undefined)]
+            ref2C $ FunCall [expr1, expr2] (SimpleReference i)
         (o, _, _) | o `elem` boolOps -> do
                         modify(\s -> s{lastType = BTBool})
                         return $ parens e1 <+> text o <+> parens e2