tests/indent/move.move
raw| 1 | module a::m { |
| 2 | struct S has copy { |
| 3 | x: u64, |
| 4 | y: u64, |
| 5 | } |
| 6 | |
| 7 | fun f(o: S): u64 { |
| 8 | let total = 0; |
| 9 | if (o.x > 0) { |
| 10 | total = o.x; |
| 11 | } else { |
| 12 | total = o.y; |
| 13 | } |
| 14 | while (total > 0) { |
| 15 | total = total - 1; |
| 16 | } |
| 17 | total |
| 18 | } |
| 19 | |
| 20 | fun classify(n: u64): u64 { |
| 21 | match (n) { |
| 22 | 0 => 1, |
| 23 | _ => 0, |
| 24 | } |
| 25 | } |
| 26 | } |