2010-06-23 21:03:09 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2010-06-23 21:03:09 -07:00
|
|
|
type t = int;
|
2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
fn nothing() { }
|
|
|
|
|
|
|
|
fn putstr(str s) { }
|
|
|
|
|
2010-06-23 21:03:09 -07:00
|
|
|
fn putint(int i) {
|
2011-06-15 11:19:50 -07:00
|
|
|
let int i = 33;
|
|
|
|
while (i < 36) { putstr("hi"); i = i + 1; }
|
2010-06-23 21:03:09 -07:00
|
|
|
}
|
2011-06-15 11:19:50 -07:00
|
|
|
|
2010-06-23 21:03:09 -07:00
|
|
|
fn zerg(int i) -> int { ret i; }
|
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
fn foo(int x) -> int {
|
|
|
|
let t y = x + 2;
|
|
|
|
putstr("hello");
|
|
|
|
while (y < 10) { putint(y); if (y * 3 == 4) { y = y + 2; nothing(); } }
|
|
|
|
let t z;
|
|
|
|
z = 0x55;
|
|
|
|
foo(z);
|
|
|
|
ret 0;
|
2010-06-23 21:03:09 -07:00
|
|
|
}
|
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
fn main() { let int x = 2 + 2; log x; log "hello, world"; log 10; }
|