61 lines
773 B
Text
61 lines
773 B
Text
const (
|
|
test_var = 1 + 3
|
|
)
|
|
|
|
fn f() i32 {
|
|
// var a = 3;
|
|
// return a;
|
|
return 2;
|
|
}
|
|
|
|
fn f2() i32 {
|
|
return f() + 2;
|
|
}
|
|
|
|
//fn f2() bool {
|
|
// return 1 > 10;
|
|
//}
|
|
|
|
enum B {
|
|
a
|
|
b
|
|
c
|
|
}
|
|
|
|
enum C {
|
|
blah
|
|
bluh
|
|
}
|
|
|
|
fn test_function() B {
|
|
return B.b;
|
|
}
|
|
|
|
fn multwo(num: i32, double_flag: bool) i32 {
|
|
// TODO resolve expr variables
|
|
if (true) {
|
|
var truthy = true;
|
|
return 1 * 2;
|
|
} else {
|
|
var falsey = false;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
fn multwo_with_one(b: i32) i32 {
|
|
return multwo(b, false) + b;
|
|
}
|
|
|
|
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));
|
|
//}
|