mirror of
https://github.com/helix-editor/helix
synced 2026-08-03 01:54:10 +02:00
This will be used by the cargo indent-check xtask to validate queries, similar to the existing indent tests in helix-core.
27 lines
423 B
Plaintext
27 lines
423 B
Plaintext
module a::m {
|
|
struct S has copy {
|
|
x: u64,
|
|
y: u64,
|
|
}
|
|
|
|
fun f(o: S): u64 {
|
|
let total = 0;
|
|
if (o.x > 0) {
|
|
total = o.x;
|
|
} else {
|
|
total = o.y;
|
|
}
|
|
while (total > 0) {
|
|
total = total - 1;
|
|
}
|
|
total
|
|
}
|
|
|
|
fun classify(n: u64): u64 {
|
|
match (n) {
|
|
0 => 1,
|
|
_ => 0,
|
|
}
|
|
}
|
|
}
|