E0009: unknown keyword

View source

At the top of a file, and at the start of a statement, the parser expects a keyword such as verb, struct or erg.

At the top of a file, and at the start of a statement, the parser expects a keyword such as verb, struct or erg. It reports this error when it finds a plain name there, which is usually a keyword from another language. The message names it. For a loop word of another language, such as while, the message also shows the Actus loop forms.

Example

actus
fn main() {
}
actus
verb main() {
    erg count = 0;
    while count < 3 {
        count = count + 1;
    }
}

Fix

Write the Actus keyword. Functions are verb declarations. A loop that leaves with break, or a counted for, replaces while.

actus
verb main() {
}
actus
verb main() {
    erg count = 0;
    loop {
        if count >= 3 {
            break;
        }
        count = count + 1;
    }
}

Run actus explain E0009 in your terminal to read this entry offline. Browse Lexer & parser or all error codes.