diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-06-28 13:06:43 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2011-06-28 13:07:52 -0700 |
| commit | a7c4c19d4bea6d84f63709218146f7be76d5c9f2 (patch) | |
| tree | 297c43cba0454e749f6d239e0117dcc3e0babaf2 /src/comp | |
| parent | d5fc01caefed33c9633e8d26f4901f3e34a21f48 (diff) | |
| download | rust-a7c4c19d4bea6d84f63709218146f7be76d5c9f2.tar.gz rust-a7c4c19d4bea6d84f63709218146f7be76d5c9f2.zip | |
add a predicate that determines whether a binop is lazy (and and or are lazy)
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/front/ast.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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 { |
