sunflower/test.foo

43 lines
510 B
Plaintext

print("hello".eq("world"));
print((40 + 2).is_42() == true);
let y = 0;
def test_func(x) {
print(x);
while x < 100 {
print(x);
x = x + 1;
if x > 10 {
return "bar";
}
}
return "foo";
}
def add_one(x) {
x + 1
}
let x = test_func(y);
print(x);
print(add_one(41));
let x = 0;
if x == 0 {
x = x + 10;
}
print(x);
let x = 5;
print(if x < 10 { 20 } else { 30 });
let f1 = native_test();
let f2 = other_foo();
let f3 = f1 + f2;
print(f3);