From 5dd2ffe89b478a4cb1cd060b1196aa3d326dbd77 Mon Sep 17 00:00:00 2001 From: pimjager Date: Thu, 19 May 2016 17:18:07 +0200 Subject: [PATCH] Fixed annote --- examples/codeGen.spl | 14 +++++++++++--- gen.icl | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/codeGen.spl b/examples/codeGen.spl index 9f45dfc..34474a7 100644 --- a/examples/codeGen.spl +++ b/examples/codeGen.spl @@ -1,10 +1,18 @@ f(x, y) { - return x; + var ret = 0; + if (x < y) { + ret = x; + } + else { + ret = y; + } + return ret; } main() { Int x1 = 1; - var x2 = f(x1, 2); + var x2 = 4; + var x3 = f(x1, x2); x1 = 5; - return x2; + return x3 + x1; } diff --git a/gen.icl b/gen.icl index 9c43c75..89af77c 100644 --- a/gen.icl +++ b/gen.icl @@ -189,9 +189,9 @@ instance g FunDecl where mapM_ g stms >>| updateAdressbook (const oldMap) >>| pure () -annote :: Int -> String -> Gen () +annote :: Int String -> Gen () annote pos key = - tell [Instr "annote" [Raw "MP", Lit pos, Lit pos, Raw "orange", Raw key] ""] + tell [Instr "annote" [Raw "MP", Lit pos, Lit pos, Raw "green", Raw key] ""] class print a :: a -> [String] -- 2.20.1