Closed xhliu closed 2 years ago
sol
for (uint i = 0; i < 10; i++) {
if (i == 3) {
if (i == 3) {
// Skip to next iteration with continue
continue;
}
uint a = 3;
}
if (i == 5) {
// Exit loop with break
break;
}
}
scrypt
bool loop_break_flag = false;
loop(__$SCR_LOOP_COUNT__): i {
if (!loop_break_flag) {
bool loop_continue_flag = false;
if (i == 3) {
if (i == 3) {
loop_continue_flag = true;
}
if(!loop_continue_flag) {
uint a = 3;
}
}
if (!loop_continue_flag) {
if (i == 5) {
loop_break_flag = true;
}
}
}
}
Just fail when continue
& return
are both present, since they may interfere w/ each other.
break
resolved in https://github.com/sCrypt-Inc/sol2scrypt/pull/159
Bug
https://scryptdoc.readthedocs.io/en/latest/loop.html#break