From 429eeee4d194820890bcbd6010765f9f7eccb21e Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Fri, 20 Mar 2020 11:48:32 -0400 Subject: compile time defer --- tests/defer.toc | 8 ++++---- tests/defer_expected | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3