leo/tests/compiler/statements/all_loops.leo
Alessandro Coglio 1761b80578 [parser] Fix to disallow including loop ending bound.
This is not part of the current version of Leo (cf. ABNF grammar and Leo
Reference).

Adapt tests.
2022-05-16 21:24:42 -07:00

19 lines
341 B
Plaintext

/*
namespace: Compile
expectation: Pass
input_file: inputs/dummy.in
*/
function main(k: bool) -> bool {
let reverse: u32 = 0u32;
for i: u32 in 9u32..0u32 {
reverse = reverse + i;
}
let forward: u32 = 0u32;
for x: u32 in 0u32..10u32 {
forward = forward + x;
}
return (reverse == forward) && k;
}