antimony-lang / antimony

The Antimony programming language
https://antimony-lang.github.io/antimony/
Apache License 2.0
138 stars 6 forks source link

match statements #14

Closed garritfra closed 3 years ago

garritfra commented 3 years ago

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")
    }
}