rayoko/examples/hello.ry
Luna 64e39a6f1e ast_printer: print scopes inside functions
- comp_ctx: add children attr for debug info
2019-09-26 16:58:57 -03:00

45 lines
558 B
Text

const (
test_var = 1 + 3
)
fn f() i32 {
//var a = 3;
return 2;
}
fn f2() i32 {
return f() + 2;
}
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));
//}