Eliah-Lakhin / ad-astra

Scripting language for Rust.
https://ad-astra.lakhin.com/
75 stars 0 forks source link

Extend Match Statement Syntax #4

Open Eliah-Lakhin opened 1 day ago

Eliah-Lakhin commented 1 day ago

Currently, the body of a match arm can only be either an expression or a statement block:

let x = 10;

match x {
    10 => { return x; },  // Supported
    20 => x = 20,         // Supported
    30 => return x,       // Not yet supported
    40 => match x {},     // Not yet supported
    50 => loop {},        // Not yet supported
}

The set of supported body statements should be extended to include all possible Ad Astra statements.