From c586e7d2343fa735a9b27e0b1a201dd2cb2bc68e Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 21 Apr 2025 21:56:34 +0200 Subject: Add integer modulo operator --- src/Compile.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Compile.hs') diff --git a/src/Compile.hs b/src/Compile.hs index 2a184f7..6466065 100644 --- a/src/Compile.hs +++ b/src/Compile.hs @@ -1271,6 +1271,7 @@ compileOpGeneral op e1 = do OLog STF32 -> unary "logf" OLog STF64 -> unary "log" OIDiv _ -> binary "/" + OMod _ -> binary "%" compileOpPair :: SOp a b -> CExpr -> CExpr -> CompM CExpr compileOpPair op e1 e2 = do @@ -1284,6 +1285,7 @@ compileOpPair op e1 e2 = do OAnd -> binary "&&" OOr -> binary "||" OIDiv _ -> binary "/" + OMod _ -> binary "%" _ -> error "compileOpPair: got unary operator" -- | Bool: whether to ensure that the literal itself already has the appropriate type -- cgit v1.2.3-70-g09d2