repositories
/
cc1516.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7d26b7
)
Fixed annote
author
pimjager
<pim@pimjager.nl>
Thu, 19 May 2016 15:18:07 +0000
(17:18 +0200)
committer
pimjager
<pim@pimjager.nl>
Thu, 19 May 2016 15:18:07 +0000
(17:18 +0200)
examples/codeGen.spl
patch
|
blob
|
history
gen.icl
patch
|
blob
|
history
diff --git
a/examples/codeGen.spl
b/examples/codeGen.spl
index
9f45dfc
..
34474a7
100644
(file)
--- 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 x
2
;
+ return x
3 + x1
;
}
diff --git
a/gen.icl
b/gen.icl
index
9c43c75
..
89af77c
100644
(file)
--- 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]