Skip to content

Commit a7c4c19

Browse files
committed
add a predicate that determines whether a binop is lazy (and and or are lazy)
1 parent d5fc01c commit a7c4c19

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/comp/front/ast.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ fn binop_to_str(binop op) -> str {
173173
}
174174
}
175175
176+
pred lazy_binop(binop b) -> bool {
177+
alt (b) {
178+
case (and) { true }
179+
case (or) { true }
180+
case (_) { false }
181+
}
182+
}
183+
176184
tag unop { box(mutability); deref; not; neg; }
177185
178186
fn unop_to_str(unop op) -> str {

0 commit comments

Comments
 (0)