summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc15
1 files changed, 11 insertions, 4 deletions
diff --git a/test.toc b/test.toc
index 666a9d1..786bd03 100644
--- a/test.toc
+++ b/test.toc
@@ -1,8 +1,15 @@
-addmul ::= fn (x::=0, y:=0)
-add := x+y, mul := x*y {
- a : []char = x;
+Point ::= struct {
+ x, y : int;
+};
+
+p :: fn(Point) int = #foreign "p", "./test.so";
+
+mkpoint ::= fn(x:int,y:int) p : Point {
+ p.x = x;
+ p.y = y;
};
main ::= fn() {
- addmul(6,7);
+ point ::= mkpoint(-3,-5);
+ total ::= p(point);
}; \ No newline at end of file