mclangc/test.mcl
MCorange 081ff9a27a Add external functions (both import and export), make includes work
still need to fix literal arrays, it has the same problem as struct
literals had with moving the literal into memory and modifying the
memory with variables
2026-01-29 22:37:04 +02:00

48 lines
670 B
Plaintext

type str = [u8];
include "std.mcl";
struct Foo {
a: usize,
b: &str
}
fn Foo.new(a: usize, b: &str) -> &Foo {
return &Foo {
a: a,
b: b
};
}
fn print(s: &str) {
// do nothign for now
}
fn mul(n: usize, n2: usize) -> usize {
return n * n2;
}
fn main() -> i32 {
let obj = Foo::new(1, "owo");
obj->b;
let owo = "ahahaha";
loop {
print(owo);
}
for (let i = 0; i < 10; i += 1) {
print("nyaaa");
if (i > 7) {
break;
} else {
continue;
}
print("cant see me!");
}
while (true) {
mul(1);
}
}
const FOO: usize = main;