summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc34
1 files changed, 2 insertions, 32 deletions
diff --git a/test.toc b/test.toc
index 566aed9..ffac0c2 100644
--- a/test.toc
+++ b/test.toc
@@ -1,32 +1,2 @@
-puti ::= fn(x: int) {
- #C("printf(\"%ld\\n\", (long)x);
-");
-};
-putf ::= fn(x: float) {
- #C("printf(\"%f\\n\", (double)x);
-");
-};
-
-SuperArray ::= fn(n :: int, t :: Type) Type {
- struct {
- data: [n]t;
- field : t;
- }
-};
-
-checksum ::= fn(t ::=, n ::=, x:SuperArray(n,t)) t {
- total := 0 as t;
- each i := 0..n-1 {
- total += x.data[i];
- }
- total + x.field
-};
-
-Super ::= SuperArray(3, int);
-
-main ::= fn() {
-x: Super;
-x.data[0] = 3;
-x.field = 1932;
-puti(checksum(x));
-};
+#export
+asdf ::= 5; \ No newline at end of file