antimony-lang/antimony

match statements

garritfra opened this issue · 0 comments

Implement simple match statements.

fn main() {
    let x = 42

    match x {
        1 => println("x is 1")
        2 => {
            println("This is a branch with multiple statements.") 
            println("x is 2, in case you're wondering")
        }
        42 => println("The answer to the universe and everything!")
        else => println("Default case")
    }
}