repositories
/
cc1516.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fixed annote
[cc1516.git]
/
examples
/
codeGen.spl
diff --git
a/examples/codeGen.spl
b/examples/codeGen.spl
index
658ea6e
..
34474a7
100644
(file)
--- a/
examples/codeGen.spl
+++ b/
examples/codeGen.spl
@@
-1,7
+1,18
@@
-f() {
- return 2;
+f(x, y) {
+ var ret = 0;
+ if (x < y) {
+ ret = x;
+ }
+ else {
+ ret = y;
+ }
+ return ret;
}
+
main() {
- var x = 3;
- return 1 + 2 + x + f();
+ Int x1 = 1;
+ var x2 = 4;
+ var x3 = f(x1, x2);
+ x1 = 5;
+ return x3 + x1;
}