From 614026f24a4abce603ea3499d7241abd9383de48 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Thu, 19 Mar 2020 11:53:52 -0400 Subject: removed old tuple code, found a bug --- tests/defer.toc | 17 +++++++++++++++++ tests/defer_expected | 4 ++++ 2 files changed, 21 insertions(+) (limited to 'tests') 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"); diff --git a/tests/defer_expected b/tests/defer_expected index 99b45e1..e678115 100644 --- a/tests/defer_expected +++ b/tests/defer_expected @@ -1,5 +1,9 @@ 4 3 +5 +6 +6 +6 1 deferred from for 2 -- cgit v1.2.3