From 05d59cb0ccd872b920ab069d41e13b500ebec8d4 Mon Sep 17 00:00:00 2001 From: Debian Games Team Date: Thu, 22 Sep 2022 13:51:50 +0100 Subject: [PATCH] cd8d7748199 # HG changeset patch # User alfadur # Date 1663731365 -10800 # Node ID 9cd8d7748199d732cf7e5b0b245f1159bc86f0ea # Parent f550a79274fab200e07209edeb9291c06041af19 fix pred/succ conversion Gbp-Pq: Name 9cd8d7748199.patch --- tools/pas2c/Pas2C.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/pas2c/Pas2C.hs b/tools/pas2c/Pas2C.hs index c7a8c96..ddb8a21 100644 --- a/tools/pas2c/Pas2C.hs +++ b/tools/pas2c/Pas2C.hs @@ -711,8 +711,8 @@ initExpr2C' hi@(BuiltInFunction "high" [e@(InitReference e')]) = do a -> error $ "BuiltInFunction 'high' in initExpr: " ++ show a ++ ": " ++ show hi initExpr2C' (BuiltInFunction "succ" [BuiltInFunction "pred" [e]]) = initExpr2C' e initExpr2C' (BuiltInFunction "pred" [BuiltInFunction "succ" [e]]) = initExpr2C' e -initExpr2C' (BuiltInFunction "succ" [e]) = liftM (<> text " + 1") $ initExpr2C' e -initExpr2C' (BuiltInFunction "pred" [e]) = liftM (<> text " - 1") $ initExpr2C' e +initExpr2C' (BuiltInFunction "succ" [e]) = liftM (\e' -> text "(" <> e' <> text " + 1)") $ initExpr2C' e +initExpr2C' (BuiltInFunction "pred" [e]) = liftM (\e' -> text "(" <> e' <> text " - 1)") $ initExpr2C' e initExpr2C' b@(BuiltInFunction _ _) = error $ show b initExpr2C' (InitTypeCast t' i) = do e <- initExpr2C i -- 2.30.2