aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-09-20 22:13:30 +0000
committerdos-reis <gdr@axiomatics.org>2007-09-20 22:13:30 +0000
commit9c14e01323f5076804740aa25d0d1384d25efb28 (patch)
tree101e6680235afabc9c0ec8a4e522ff27457181f3
parent0850ca5458cb09b2d04cec162558500e9a05cf4a (diff)
downloadopen-axiom-9c14e01323f5076804740aa25d0d1384d25efb28.tar.gz
Fix SNAFU of last night.
-rw-r--r--src/interp/parse.boot33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/interp/parse.boot b/src/interp/parse.boot
index 8328af6b..f2480254 100644
--- a/src/interp/parse.boot
+++ b/src/interp/parse.boot
@@ -333,7 +333,9 @@ parseOr u ==
(x:= parseTran first u) is ["not",y] => parseIf [y,parseOr rest u,"true"]
true => parseIf [x,"true",parseOr rest u]
-parseNot u == ['not,parseTran first u]
+parseNot u ==
+ $InteractiveMode => ["not",parseTran first u]
+ parseTran ["IF",first u,:'(false true)]
parseEquivalence [a,b] == parseIf [a,b,parseIf [b,:'(false true)]]
@@ -406,20 +408,23 @@ parseIf t ==
t isnt [p,a,b] => t
ifTran(parseTran p,parseTran a,parseTran b) where
ifTran(p,a,b) ==
- null($InteractiveMode) and p='true => a
- null($InteractiveMode) and p='false => b
- p is ['not,p'] => ifTran(p',b,a)
- p is ['IF,p',a',b'] => ifTran(p',ifTran(a',COPY a,COPY b),ifTran(b',a,b))
- p is ['SEQ,:l,['exit,1,p']] =>
- ['SEQ,:l,['exit,1,ifTran(p',incExitLevel a,incExitLevel b)]]
+ null($InteractiveMode) and p="true" => a
+ null($InteractiveMode) and p="false" => b
+ p is ["not",p'] => ifTran(p',b,a)
+ p is ["IF",p',a',b'] => ifTran(p',ifTran(a',COPY a,COPY b),ifTran(b',a,b))
+ p is ["SEQ",:l,["exit",1,p']] =>
+ ["SEQ",:l,["exit",1,ifTran(p',incExitLevel a,incExitLevel b)]]
--this assumes that l has no exits
- a is ['IF, =p,a',.] => ['IF,p,a',b]
- b is ['IF, =p,.,b'] => ['IF,p,a,b']
--- makeSimplePredicateOrNil p is ['SEQ,:s,['exit,1,val]] =>
--- parseTran ['SEQ,:s,['exit,1,incExitLevel ['IF,val,a,b]]]
- ['IF,p,a,b]
-
-makeSimplePredicateOrNil p == nil
+ a is ["IF", =p,a',.] => ["IF",p,a',b]
+ b is ["IF", =p,.,b'] => ["IF",p,a,b']
+ makeSimplePredicateOrNil p is ["SEQ",:s,["exit",1,val]] =>
+ parseTran ["SEQ",:s,["exit",1,incExitLevel ["IF",val,a,b]]]
+ ["IF",p,a,b]
+
+makeSimplePredicateOrNil p ==
+ isSimple p => nil
+ u:= isAlmostSimple p => u
+ true => wrapSEQExit [["LET",g:= GENSYM(),p],g]
parseWhere l == ["where",:mapInto(l, function parseTran)]