2011-09-26 17:26:30 +00:00
|
|
|
// Just a grab bag of stuff that you wouldn't want to actually write.
|
2011-08-19 05:16:54 +00:00
|
|
|
|
2011-08-19 22:16:48 +00:00
|
|
|
fn strange() -> bool { let _x = ret true; }
|
2011-08-19 05:16:54 +00:00
|
|
|
|
|
|
|
fn funny() {
|
2011-08-19 22:16:48 +00:00
|
|
|
fn f(_x: ()) { }
|
2011-08-19 05:16:54 +00:00
|
|
|
f(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn what() {
|
2011-09-15 07:48:39 +00:00
|
|
|
fn the(x: @mutable bool) { ret while !*x { *x = true; }; }
|
2011-08-19 05:16:54 +00:00
|
|
|
let i = @mutable false;
|
|
|
|
let dont = bind the(i);
|
|
|
|
dont();
|
2011-08-19 22:16:48 +00:00
|
|
|
assert (*i);
|
2011-08-19 05:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn zombiejesus() {
|
2011-09-16 04:24:24 +00:00
|
|
|
do {
|
|
|
|
while (ret) {
|
|
|
|
if (ret) {
|
2012-01-30 03:58:16 +00:00
|
|
|
alt (ret) {
|
|
|
|
_ {
|
|
|
|
if (ret) {
|
|
|
|
ret
|
|
|
|
} else {
|
|
|
|
ret
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2011-09-16 04:24:24 +00:00
|
|
|
} else if (ret) {
|
|
|
|
ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while ret
|
2011-08-19 05:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn notsure() {
|
|
|
|
let _x;
|
|
|
|
let _y = (_x = 0) == (_x = 0);
|
|
|
|
let _z = (_x <- 0) < (_x = 0);
|
|
|
|
let _a = (_x += 0) == (_x = 0);
|
|
|
|
let _b = (_y <-> _z) == (_y <-> _z);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn hammertime() -> int {
|
2011-12-23 01:53:53 +00:00
|
|
|
let _x = log(debug, true == (ret 0));
|
2011-08-19 05:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn canttouchthis() -> uint {
|
2011-08-24 01:25:50 +00:00
|
|
|
pure fn p() -> bool { true }
|
2011-08-19 22:16:48 +00:00
|
|
|
let _a = (assert (true)) == (check (p()));
|
|
|
|
let _c = (check (p())) == ();
|
2011-12-23 01:53:53 +00:00
|
|
|
let _b = (log(debug, 0) == (ret 0u));
|
2011-08-19 05:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn angrydome() {
|
2011-08-19 22:16:48 +00:00
|
|
|
while true { if break { } }
|
2011-08-19 05:16:54 +00:00
|
|
|
let i = 0;
|
2011-08-19 22:16:48 +00:00
|
|
|
do { i += 1; if i == 1 { alt cont { _ { } } } } while false
|
2011-08-19 05:16:54 +00:00
|
|
|
}
|
|
|
|
|
2011-12-22 22:42:52 +00:00
|
|
|
fn evil_lincoln() { let evil <- #debug("lincoln"); }
|
2011-08-19 05:16:54 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
strange();
|
|
|
|
funny();
|
|
|
|
what();
|
|
|
|
zombiejesus();
|
|
|
|
notsure();
|
|
|
|
hammertime();
|
|
|
|
canttouchthis();
|
|
|
|
angrydome();
|
|
|
|
evil_lincoln();
|
|
|
|
}
|