Permalink
Browse files

fixed negation of conditionals

  • Loading branch information...
1 parent 559540d commit 45ca9da2354cdd6733b89070bdaa952940fa55dc @mishoo committed Feb 3, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/squeeze.lisp
View
@@ -93,17 +93,17 @@
(:seq (_ two)
(boolean-expr two))))
-(defun negate (c &optional bool-context)
+(defun negate (c)
(flet ((not-c ()
`(:unary-prefix :! ,c)))
(or (ast-case c
(:unary-prefix (op expr)
- (when (and (eq op :!) (or bool-context (boolean-expr expr)))
+ (when (and (eq op :!) (boolean-expr expr))
expr))
(:seq (one two)
`(:seq ,one ,(negate two)))
(:conditional (cond left right)
- `(:conditional ,(negate cond t) ,right ,left))
+ `(:conditional ,cond ,(negate right) ,(negate left)))
(:binary (op left right)
(case op
(:< `(:binary :>= ,left ,right))

0 comments on commit 45ca9da

Please sign in to comment.