diff --git a/stdlib/lib.cl b/stdlib/lib.cl index 380a778..c866407 100644 --- a/stdlib/lib.cl +++ b/stdlib/lib.cl @@ -60,16 +60,6 @@ fn if_else() -> i32 { // block 4 } -fn while_else() -> i32 { - loop { - if conditional { - body; - } else { - break { else_body }; - } - } -} - #[cfg("test")] mod test { //! Tests for funky behavior @@ -96,4 +86,22 @@ mod test { StructEmpty {}, StructLike { member1: UnitLike, member2: TupleLike }, } + + fn noop () -> bool { + loop if false { + + } else break loop if false { + + } else break loop if false { + + } else break true; + } + + fn while_else() -> i32 { + while conditional { + pass + } else { + fail + } + } }