summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc29
1 files changed, 24 insertions, 5 deletions
diff --git a/test.toc b/test.toc
index e2e5a57..10043da 100644
--- a/test.toc
+++ b/test.toc
@@ -1,11 +1,30 @@
+#include "std/io.toc";
+/*
-Point ::= struct {
- a ::= 3;
+sum ::= fn(n::=, t::=, a: [n]t) t {
+ total : t = 0;
+ for x := a {
+ total += x;
+ }
+ total
}
-
main ::= fn() {
- use p: Point;
- a;
+ t ::= int;
+ numbers : [1000]t;
+ for x, i : (&t, t) = &numbers {
+ *x = i;
+ }
+ puti(sum(numbers) as int);
+
+}
+*/
+ll ::= struct (t::Type) {
+ head: t;
+ next: &ll(t);
+}
+
+main ::= fn() {
+ x: ll(int);
}