aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog4
-rw-r--r--src/interp/g-opt.boot10
2 files changed, 10 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ba0e3580..9390281e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
2011-12-14 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot (packWhen!): Tidy.
+
+2011-12-14 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/g-opt.boot (exitScope?): New.
(packWhen!): Use it.
(coagulateWhenSeries): Tidy.
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 5aa43f69..c2e18d41 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -302,6 +302,12 @@ exitScope?(x,g) ==
++ Transform nested-to-tower.
packWhen! x == walkWith!(x,function f) where
f x ==
+ x is ['%when,[p1,['%when,[p2,s]]]] =>
+ resetTo(x,f ['%when,[['%and,p1,p2],s]])
+ x is ['%when,:cl,['%otherwise,y]] and y is ['%when,:.] =>
+ resetTo(x,f ['%when,:cl,:y.args])
+ x is ['%leave,g,['%when,[p,['%leave,=g,s]]]] =>
+ resetTo(x,['%leave,g,['%when,[p,s]]])
x is ['%scope,g,y] and y is ['%seq,:stmts] =>
repeat
stmts = nil => leave nil
@@ -317,10 +323,6 @@ packWhen! x == walkWith!(x,function f) where
coagulateWhenSeries(y,g) is [u,v] =>
resetTo(x,f ['%when,:u,['%otherwise,f mkDefault(g,v)]])
x
- x is ['%when,[p1,['%when,[p2,s]]]] =>
- resetTo(x,f ['%when,[['%and,p1,p2],s]])
- x is ['%when,:cl,['%otherwise,y]] and y is ['%when,:.] =>
- resetTo(x,f ['%when,:cl,:y.args])
x
spliceSeq! x == walkWith!(x,function f) where