summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc42
1 files changed, 6 insertions, 36 deletions
diff --git a/test.toc b/test.toc
index d56944a..e115d6b 100644
--- a/test.toc
+++ b/test.toc
@@ -1,41 +1,11 @@
-io ::= nms {
-#include "std/io.toc";
-};
-
-LinkedList ::= struct(t::Type) {
- head : t;
- tail : &LinkedList(t);
-};
-
-arr_to_ll ::= fn(t::Type, data: []t) l : LinkedList(t) {
- if data.len == 1 {
- l.head = data[0];
- l.tail = 0 as &LinkedList(t);
- } else {
- l.head = data[0];
- l.tail = new(LinkedList(t));
- *l.tail = arr_to_ll(t, data[1:]);
- }
-};
-
-do_thing ::= fn() int {
+// io ::= nms {
+// #include "std/io.toc";
+// };
- a := new(int, 3);
- a[0] = 10;
- a[1] = 20;
- a[2] = 30;
- x := arr_to_ll(int, a);
- p := &x;
- i := 0;
- while p {
- io.puti(p.head);
- p = p.tail;
- i += 1;
- }
- i
+Thing ::= struct(t::Type=int) {
+ it : t;
};
main ::= fn() {
- x ::= do_thing();
- do_thing();
+ a: Thing();
}; \ No newline at end of file