From 7b679c464516e0c3e3bf7bfba4e8eb3249c3890b Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 25 Dec 2011 02:19:28 +0000 Subject: * interp/g-opt.boot (unnestWhen!): Recurse into more control structures. --- src/interp/g-opt.boot | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/interp') diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 089e2718..2bdde63a 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -318,7 +318,13 @@ unnestWhen! x == f x where x do abstraction? x => x.absBody := f x.absBody - x is ['%leave,.,y] => second(x.args) := f y + x is ['%leave,.,y] or x is ['%return,.,y] => second(x.args) := f y + x is ['%when,:.] => + for cl in x.args repeat + second(cl) := f second cl + x is ['%seq,:.] => + for stmts in tails x.args repeat + stmts.first := f first stmts x ++ Transform nested-to-tower. -- cgit v1.2.3