summaryrefslogtreecommitdiff
path: root/tests/defer.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-19 11:53:52 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-19 11:53:52 -0400
commit614026f24a4abce603ea3499d7241abd9383de48 (patch)
tree3a24082038146472b58bd29ffc3db58974d3df51 /tests/defer.toc
parentee43fea5d80116bd126eaf92b29e3c015634a22d (diff)
removed old tuple code, found a bug
Diffstat (limited to 'tests/defer.toc')
-rw-r--r--tests/defer.toc17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/defer.toc b/tests/defer.toc
index 32165e7..6c2a304 100644
--- a/tests/defer.toc
+++ b/tests/defer.toc
@@ -10,9 +10,26 @@ same ::= fn(n : int) int {
x
}
+thing1 ::= fn() (int, int) {
+ x := 5;
+ y := 6;
+ defer x += 1;
+ x, y
+}
+
+thing2 ::= fn() x := 5, y := 6 {
+ defer x += 1;
+}
+
main ::= fn() {
io.puti(plusone(3));
io.puti(same(3));
+ a, b := thing1();
+ c, d := thing2();
+ io.puti(a);
+ io.puti(b);
+ io.puti(c);
+ io.puti(d);
defer io.puts("deferred from main()");
for i := 1..10 {
defer io.puts("deferred from for");