PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/complex.rs

http://github.com/jruderman/rust
Rust | 33 lines | 23 code | 9 blank | 1 comment | 4 complexity | f36efcbbba43e515ab02b2a962005101 MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5type t = int;
 6
 7fn nothing() { }
 8
 9fn putstr(s: ~str) { }
10
11fn putint(i: int) {
12    let mut i: int = 33;
13    while i < 36 { putstr(~"hi"); i = i + 1; }
14}
15
16fn zerg(i: int) -> int { return i; }
17
18fn foo(x: int) -> int {
19    let mut y: t = x + 2;
20    putstr(~"hello");
21    while y < 10 { putint(y); if y * 3 == 4 { y = y + 2; nothing(); } }
22    let mut z: t;
23    z = 0x55;
24    foo(z);
25    return 0;
26}
27
28fn main() {
29    let x: int = 2 + 2;
30    log(debug, x);
31    debug!{"hello, world"};
32    log(debug, 10);
33}