Lyricdev
GitHub

LYR-PAR0022

a do block without 'while'

error · spec 07-statements

The block of a do loop is not followed by while and its condition.

Explanation

A do loop runs its block first and tests after it: do { … } while (c);. The while and the condition belong to it.

Write while before the condition.

Wrong

fn main(): void {
    var i = 0;
    do {
        i += 1;
    } (i < 3);
}
fn main(): void {
    var i = 0;
    do {
        i += 1;
    } while (i < 3);
}