summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-07-10 17:07:09 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-07-10 17:07:09 -0400
commit1c0e87ce47c22512878edef083577aa573fd7876 (patch)
tree3ee51312c97771dea5773e762967b384b3a8dc8c /test.toc
parent2aea7ec331f80c72822dedfa2c9c0054a72975d1 (diff)
oops fixed setting stack-allocated arrs/structs
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc23
1 files changed, 21 insertions, 2 deletions
diff --git a/test.toc b/test.toc
index dfcbe51..86c3855 100644
--- a/test.toc
+++ b/test.toc
@@ -1,5 +1,24 @@
-#include "std/mem.toc";
+#include "std/io.toc", io;
+Point ::= struct {
+ x, y: int;
+}
main ::= fn(){
- a : []int = news(int, 5);
+ a, b: Point;
+ b.x = 15;
+ b.y = 12;
+ a = b;
+ a = a;
+ c, d: [5]int;
+ c[0] = 39;
+
+ d = c;
+ d = d;
+ c = d;
+ io.puti(a.x);
+ io.puti(a.y);
+ io.puti(b.x);
+ io.puti(b.y);
+ io.puti(c[0]);
+ io.puti(d[0]);
}
main();