rayoko/examples/hello.ry
Luna e69451cdd9 example: function calls can't happen on consts yet
- add suggestion to make it work as TODO
2019-09-25 18:10:17 -03:00

47 lines
553 B
Text

// import std;
fn f() i32 {
return 2;
}
fn f2() i32 {
return f() + 2;
}
const (
piss = 1 + 3
)
enum B {
a
b
c
}
fn test_function() B {
return B.a;
}
fn multwo(num: i32, double_flag: bool) i32 {
// TODO resolve expr variables
if (true) {
return 1 * 2;
} else {
return 1;
}
}
fn add(a: i32, b: i32) i32 {
return 69 + 69;
}
fn and_fn() bool {
return true and false;
}
// type is void by default
//fn main() {
// print("piss\n");
// // print("2 + 2 = %d\n", add(1, 2));
//}