diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2018fd03..5a05ae7f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2011-12-24 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/g-opt.boot (unnestWhen!): Recurse into more control + structures. + +2011-12-24 Gabriel Dos Reis <gdr@cs.tamu.edu> + * algebra/rep2.spad.pamphlet (RepresentationPackage2) [areEquivalent?]: Tidy. 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. |