From a7c4c19d4bea6d84f63709218146f7be76d5c9f2 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Tue, 28 Jun 2011 13:06:43 -0700 Subject: [PATCH] add a predicate that determines whether a binop is lazy (and and or are lazy) --- src/comp/front/ast.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index abc1c11a44a..e36c0338238 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -173,6 +173,14 @@ fn binop_to_str(binop op) -> str { } } +pred lazy_binop(binop b) -> bool { + alt (b) { + case (and) { true } + case (or) { true } + case (_) { false } + } +} + tag unop { box(mutability); deref; not; neg; } fn unop_to_str(unop op) -> str {