tools/pas2c.hs
changeset 7056 2884c7be6691
parent 7055 4c495c8f02da
child 7057 c3eba84d1a98
equal deleted inserted replaced
7055:4c495c8f02da 7056:2884c7be6691
   679         ("&", BTBool, _) -> return $ parens e1 <+> text "&&" <+> parens e2
   679         ("&", BTBool, _) -> return $ parens e1 <+> text "&&" <+> parens e2
   680         ("|", BTBool, _) -> return $ parens e1 <+> text "||" <+> parens e2
   680         ("|", BTBool, _) -> return $ parens e1 <+> text "||" <+> parens e2
   681         (_, BTRecord t1 _, BTRecord t2 _) -> do
   681         (_, BTRecord t1 _, BTRecord t2 _) -> do
   682             i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier t2 undefined)]
   682             i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier t2 undefined)]
   683             ref2C $ FunCall [expr1, expr2] (SimpleReference i)
   683             ref2C $ FunCall [expr1, expr2] (SimpleReference i)
       
   684         (_, BTRecord t1 _, BTInt) -> do
       
   685             -- aw, "LongInt" here is hwengine-specific hack
       
   686             i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier "LongInt" undefined)]
       
   687             ref2C $ FunCall [expr1, expr2] (SimpleReference i)
   684         (o, _, _) | o `elem` boolOps -> do
   688         (o, _, _) | o `elem` boolOps -> do
   685                         modify(\s -> s{lastType = BTBool})
   689                         modify(\s -> s{lastType = BTBool})
   686                         return $ parens e1 <+> text o <+> parens e2
   690                         return $ parens e1 <+> text o <+> parens e2
   687                   | otherwise -> return $ parens e1 <+> text o <+> parens e2
   691                   | otherwise -> return $ parens e1 <+> text o <+> parens e2
   688     where
   692     where