From 230276c8a3e45a0079232739976e117db2d26b00 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 11 Sep 2022 20:37:31 +0100 Subject: More folding --- src/Micro/Compiler.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Micro') diff --git a/src/Micro/Compiler.hs b/src/Micro/Compiler.hs index 3899ead..6d2a35d 100644 --- a/src/Micro/Compiler.hs +++ b/src/Micro/Compiler.hs @@ -188,6 +188,9 @@ foldConstant x = if newOp /= x then foldConstant newOp else newOp (A.Func ident params ret body priv anon pos) -> A.Func ident params ret (map foldConstant body) priv anon pos + (A.Call ident args pos) -> + A.Call (foldConstant ident) (map foldConstant args) pos + (A.Var ident typ val priv pos) -> A.Var ident typ (foldConstant val) priv pos (A.Return value pos) -> A.Return (fmap foldConstant value) pos _ -> x -- cgit v1.2.3