sunflower/test.foo

43 lines
510 B
Plaintext
Raw Normal View History

2022-07-03 23:13:12 +02:00
print("hello".eq("world"));
2022-07-03 23:13:12 +02:00
print((40 + 2).is_42() == true);
let y = 0;
def test_func(x) {
print(x);
while x < 100 {
print(x);
x = x + 1;
2022-07-04 15:36:03 +02:00
if x > 10 {
return "bar";
}
}
2022-07-04 15:36:03 +02:00
return "foo";
}
2022-07-04 15:36:03 +02:00
def add_one(x) {
x + 1
}
let x = test_func(y);
print(x);
print(add_one(41));
2022-07-04 21:49:08 +02:00
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);