diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-04-04 23:23:59 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-04-04 23:23:59 -0400 |
commit | 943922ae04fa5194091606ad717ecea91ad2f646 (patch) | |
tree | 3c10758c2154770d0433a581da8253b29e4d094a /test.toc | |
parent | 98534503a8fdf8bcb5692c4e9c76adee4a70e5d3 (diff) |
added using structs and its mostly working but found a weird bug when an error happens beforehand
Diffstat (limited to 'test.toc')
-rw-r--r-- | test.toc | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -1,22 +1,19 @@ -#include "std/io.toc"; +//#include "std/io.toc"; - -n ::= nms { - x := 5; +Point ::= struct { + x, y: int; } -m ::= nms { - x := 13; - y := 108; +sqdist ::= fn(p: Point) { + use p; + x * x + y * y } main ::= fn() { - use n; - use m; - //x = 7; - //puti(x); - puti(y); - y = 100; - puti(m.y); + p: Point; + use p; + x = 3; + y = 4; + //puti(sqdist(p)); } |