summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-04-04 23:23:59 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-04-04 23:23:59 -0400
commit943922ae04fa5194091606ad717ecea91ad2f646 (patch)
tree3c10758c2154770d0433a581da8253b29e4d094a /test.toc
parent98534503a8fdf8bcb5692c4e9c76adee4a70e5d3 (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.toc25
1 files changed, 11 insertions, 14 deletions
diff --git a/test.toc b/test.toc
index d64d32e..41c91ce 100644
--- a/test.toc
+++ b/test.toc
@@ -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));
}