From: pimjager Date: Thu, 19 May 2016 15:18:07 +0000 (+0200) Subject: Fixed annote X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=5dd2ffe89b478a4cb1cd060b1196aa3d326dbd77;p=cc1516.git Fixed annote --- 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]