From 19879cbdaa8f64442135f29896e02725e435483a Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 26 Feb 2011 01:37:33 +0000 Subject: * interp/g-opt.boot (optNot): Push %not inside conditionals. (optCond): Remove ineffectual transformation. --- src/ChangeLog | 5 +++++ src/interp/g-opt.boot | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0178b6d9..18878936 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-02-25 Gabriel Dos Reis + + * interp/g-opt.boot (optNot): Push %not inside conditionals. + (optCond): Remove ineffectual transformation. + 2011-02-25 Gabriel Dos Reis * interp/parse.boot (parseLessEqual): Remove. diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index c12e6689..b119ce5f 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -308,14 +308,11 @@ optCond (x is ['%when,:l]) == l is [[p1,['%when,[p2,c2]]]] => optCond ['%when,[['%and,p1,p2],c2]] l is [[p1,:c1],[p2,:c2],[p3,:c3]] and p3 = '%otherwise => EqualBarGensym(c1,c3) => - optCond ['%when,[['%or,p1,['%not,p2]],:c1],['%otherwise,:c2]] + optCond ['%when,[['%or,p1,optNot ['%not,p2]],:c1],['%otherwise,:c2]] EqualBarGensym(c1,c2) => optCond ['%when,[['%or,p1,p2],:c1],['%otherwise,:c3]] x for y in tails l repeat - c := first y - if c is [['%not,['%not,p]],:.] then - c.first := p while y is [[a1,c1],[a2,c2],:y'] and EqualBarGensym(c1,c2) repeat a := ['%or,a1,a2] first(y).first := a @@ -692,6 +689,8 @@ optNot(x is ['%not,a]) == a = '%true => '%false a = '%false => '%true a is ['%not,b] => b + a is ['%when,:.] => + optCond [a.op, :[[p,optNot ['%not,c]] for [p,c] in a.args]] x optAnd(x is ['%and,a,b]) == -- cgit v1.2.3