diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-07-10 17:07:09 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-07-10 17:07:09 -0400 |
commit | 1c0e87ce47c22512878edef083577aa573fd7876 (patch) | |
tree | 3ee51312c97771dea5773e762967b384b3a8dc8c /test.toc | |
parent | 2aea7ec331f80c72822dedfa2c9c0054a72975d1 (diff) |
oops fixed setting stack-allocated arrs/structs
Diffstat (limited to 'test.toc')
-rw-r--r-- | test.toc | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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(); |