summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc34
1 files changed, 16 insertions, 18 deletions
diff --git a/test.toc b/test.toc
index b1d5e06..058d589 100644
--- a/test.toc
+++ b/test.toc
@@ -1,24 +1,22 @@
#include "std/io.toc", io;
-s ::= struct (t :: Type, hasz ::= true) {
- x, y: t;
- #if hasz {
- z: t;
- a :: t = 3 as t;
- }
-}
-
main ::= fn() {
- p: s(float);
- p.x = 7;
- p.y = 13;
- p.z = 12;
- io.puti(p.x as int);
- io.puti(s(int).a as int);
- q: s(int, false);
- q.x = 13;
- io.puti(q.x);
- //io.puti(q.a);
+ defer io.puts("deferred from main");
+ for i := 0..10 {
+ defer io.puti(i);
+ if i == 7 {
+ defer io.puts("break!!!");
+ break;
+ }
+ if i % 2 == 0 {
+ defer io.puts("continue!!!");
+ continue;
+ }
+ io.puts("number...");
+ }
+ return;
+ io.puts("end of main");
}
+main();