summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc46
1 files changed, 29 insertions, 17 deletions
diff --git a/test.toc b/test.toc
index 08989ed..98c4b01 100644
--- a/test.toc
+++ b/test.toc
@@ -1,27 +1,39 @@
-
-
-
puti @= fn(x: int) {
#C("printf(\"%ld\\n\", (long)x);
");
};
-main @= fn() {
-puti(somesum());
-foo @= somesum();
-puti(foo);
+foo @= fn() int {
+ x:= new(int, 10).len;
+ x
};
-Point @= struct {
- x, y : int;
+
+bar @= fn() int {
+ x := new(int,10);
+ (&x).len
};
-sum @= fn(p: &Point) int {
- p.x + p.y
+
+baz @= fn() int {
+ x: [10]int;
+ x.len
};
-somesum @= fn() int {
- p : Point;
- p.x = 12389;
- p.y = 29404;
- total := sum(&p);
- total
+
+quux @= fn() int {
+ x: [10]int;
+ (&x).len
};
+main @= fn() {
+ puti(foo());
+ X @= foo();
+ puti(X);
+ puti(bar());
+ Y @= bar();
+ puti(Y);
+ puti(baz());
+ Z @= baz();
+ puti(Z);
+ puti(quux());
+ W @= quux();
+ puti(W);
+};