summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc22
1 files changed, 9 insertions, 13 deletions
diff --git a/test.toc b/test.toc
index ed66392..011b5a3 100644
--- a/test.toc
+++ b/test.toc
@@ -1,18 +1,14 @@
#include "std/io.toc";
-
-foo ::= fn() int {
- puts("Hello");
- 3
-}
-
-bar ::= fn() (int, int) {
- foo(), foo()
+c_add ::= fn(x:int, y:int) int {
+ #C("x+y")
}
main ::= fn() {
- _ := 5;
- _ := 6+_;
- _ := foo();
- _,_ := bar();
- _,_ := bar();
+ xs : [5]int;
+ for x, i := &xs {
+ *x = c_add(i*i, i*i*i);
+ }
+ for x := xs {
+ puti(x);
+ }
}