summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-02-24 10:07:35 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-02-24 10:07:35 -0500
commit6f5a2bb7b7017bb574a32ff1c06449a1f9843214 (patch)
tree6bb960735a02a86f1bd53f62be9dd64c69856e96 /test.toc
parent055d5451bbad3ce530fa9f15b587ba8748fbf3de (diff)
a bit of cleanup
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc31
1 files changed, 5 insertions, 26 deletions
diff --git a/test.toc b/test.toc
index c9ef4b3..5eef11f 100644
--- a/test.toc
+++ b/test.toc
@@ -2,33 +2,12 @@ io ::= nms {
#include "std/io.toc";
};
-
-
-Thing ::= struct(t::=int, u::t=3) {
- it : t;
- that : [u]t;
-};
-
-f ::= fn(t,u::=,th : &Thing(t,u)) {
- x: t = 17 as t;
- th.it = x;
- for p, i := &th.that {
- *p = i as t;
- }
-};
-
-print_thing ::= fn(t, u::=, th: Thing(t, u)) {
- io.puti(th.it as int);
- for x := th.that {
- io.puti(x as int);
- }
+f ::= fn(a,b::=3) int {
+ a + b
};
main ::= fn() {
- a: Thing(u = 5, t = u8);
- f(&a);
- print_thing(a);
- b: Thing();
- f(&b);
- print_thing(b);
+ x ::= f();
+ io.puti(x);
+ io.puti(f());
}; \ No newline at end of file