summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-20 11:48:32 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-20 11:48:32 -0400
commit429eeee4d194820890bcbd6010765f9f7eccb21e (patch)
tree07ad88b4ac1790bee991f0f7e995ca46a1dcd6cd /tests
parent29be3d971133bbb6f45008d877d1094ff9276123 (diff)
compile time defer
Diffstat (limited to 'tests')
-rw-r--r--tests/defer.toc8
-rw-r--r--tests/defer_expected4
2 files changed, 8 insertions, 4 deletions
diff --git a/tests/defer.toc b/tests/defer.toc
index 6c2a304..578668d 100644
--- a/tests/defer.toc
+++ b/tests/defer.toc
@@ -26,10 +26,10 @@ main ::= fn() {
io.puti(same(3));
a, b := thing1();
c, d := thing2();
- io.puti(a);
- io.puti(b);
- io.puti(c);
- io.puti(d);
+ e, f ::= thing1();
+ g, h ::= thing2();
+ io.puti(a); io.puti(b); io.puti(c); io.puti(d);
+ io.puti(e); io.puti(f); io.puti(g); io.puti(h);
defer io.puts("deferred from main()");
for i := 1..10 {
defer io.puts("deferred from for");
diff --git a/tests/defer_expected b/tests/defer_expected
index e678115..1c13a6d 100644
--- a/tests/defer_expected
+++ b/tests/defer_expected
@@ -4,6 +4,10 @@
6
6
6
+5
+6
+6
+6
1
deferred from for
2