diff options
Diffstat (limited to 'test.toc')
-rw-r--r-- | test.toc | 34 |
1 files changed, 2 insertions, 32 deletions
@@ -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 |