qupa-project / uniview-lang

View once immutability enabling the safeties of immutable code, while enjoying near procedural performance
https://uniview.qupa.org
MIT License
2 stars 0 forks source link

+ Elif statements #48

Closed AjaniBilby closed 3 years ago

AjaniBilby commented 3 years ago

Added else if statements which can be infinitly chained

AjaniBilby commented 3 years ago

Test case

import "print.uv";

fn test(a: int, b: int) {
    if (a > b) {
        println("Greater");
    } elif (a < b) {
        println("Lesser");
    } else {
        println("Equal");
    }

    return;
}

fn main(): int {
    test(1, 3); // Lesser
    test(2, 2); // Equal
    test(3, 1); // Greater

    return 0;
}