aboutsummaryrefslogtreecommitdiff
path: root/src/boot/ast.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-09-04 03:10:47 +0000
committerdos-reis <gdr@axiomatics.org>2009-09-04 03:10:47 +0000
commit5ec566efd3ae43b1bf470e5da19de940ac95c0dd (patch)
treeeef2d0cf2cbae2993cacc5ef83033635935d6e16 /src/boot/ast.boot
parentffc2fe52c4d8f3b213e6f954ee262e9fc09b7248 (diff)
downloadopen-axiom-5ec566efd3ae43b1bf470e5da19de940ac95c0dd.tar.gz
* boot/ast.boot (bfAlternative): New. Move single assignment in
pattern matching to the body of the branch. (bfSequence): Use it.
Diffstat (limited to 'src/boot/ast.boot')
-rw-r--r--src/boot/ast.boot9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index 1fdeceb7..f455cc3b 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -980,9 +980,14 @@ bfWashCONDBranchBody x ==
x is ["PROGN",:y] => y
[x]
+bfAlternative(a,b) ==
+ a is ["AND",:conds,["PROGN",stmt,='T]] =>
+ [["AND",:conds], :bfWashCONDBranchBody bfMKPROGN [stmt,b]]
+ [a,:bfWashCONDBranchBody b]
+
bfSequence l ==
null l=> NIL
- transform:= [[a,:bfWashCONDBranchBody b] for x in l while
+ transform:= [bfAlternative(a,b) for x in l while
x is ["COND",[a,["IDENTITY",b]]]]
no:=#transform
before:= bfTake(no,l)
@@ -993,7 +998,7 @@ bfSequence l ==
f
bfMKPROGN [first l,bfSequence rest l]
null aft => ["COND",:transform]
- ["COND",:transform,['T,:bfWashCONDBranchBody bfSequence aft]]
+ ["COND",:transform,bfAlternative('T,bfSequence aft)]
bfWhere (context,expr)==
[opassoc,defs,nondefs] := defSheepAndGoats context