X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=gen.icl;h=d0ec62810e16a294b040fad76749dcbd6978728e;hb=5b98614f91d22a47f6e089329336acd727d56fb5;hp=06d2b1306adfa7d3dfe84e289599426899741f60;hpb=a704ddfa169139f2d8595dd7023011e49843faa9;p=cc1516.git diff --git a/gen.icl b/gen.icl index 06d2b13..d0ec628 100644 --- a/gen.icl +++ b/gen.icl @@ -65,6 +65,11 @@ instance g Expr where g (BoolExpr _ True) = loadP (LDC TRUE) >>= \instr-> tell [instr] g (BoolExpr _ False) = loadP (LDC FALSE) >>= \instr-> tell [instr] g (Op2Expr _ e1 op e2) = g e1 >>| g e2 >>| tell [Instr (op2ins op) [] ""] + g (Op1Expr _ UnNegation e) = g e >>| tell [Instr "not" [] ""] + g (Op1Expr _ UnMinus e) = g e >>| tell [Instr "neg" [] ""] + g (EmptyListExpr _) = abort "Shit, empty list expr" + g (TupleExpr p (e1,e2)) = abort "How to deal with tuples?" + g (FunExpr _ k es fs) = mapM g es >>| jump "bra" k >>= \instr-> tell [instr] op2ins :: Op2 -> String op2ins op = case op of