summaryrefslogtreecommitdiff
path: root/src/Compile.hs
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2025-04-21 21:56:34 +0200
committerTom Smeding <t.j.smeding@uu.nl>2025-04-21 21:56:34 +0200
commitc586e7d2343fa735a9b27e0b1a201dd2cb2bc68e (patch)
tree9315228980b2c5983c785889b815aaab46534052 /src/Compile.hs
parent0dc5c31b023ee7d569bbc0df7615b2bf55ba01f5 (diff)
Add integer modulo operator
Diffstat (limited to 'src/Compile.hs')
-rw-r--r--src/Compile.hs2
1 files changed, 2 insertions, 0 deletions
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