buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.2k stars 34 forks source link

Match statement #80

Open giann opened 1 year ago

giann commented 1 year ago
match (n) {
    Locale.frFR,
    Locale.frBE -> {
        print("On parle français!");

        return true;
    },
    Locale.en -> print("we speak english!"),
    default -> print("Single statement is allowed"),
}

If evaluated expression is an EnumInstance we can detect missing cases.