no segfault!

This commit is contained in:
2026-01-28 22:30:02 +02:00
parent 1f4645ed24
commit 834b5b1213
21 changed files with 1311 additions and 338 deletions

View File

@@ -1,21 +1,47 @@
type str = [u8];
struct Foo {
a: usize,
b: &str
}
fn Foo.new(a: usize, b: &str) -> Foo {
return Foo {
fn Foo.new(a: usize, b: &str) -> &Foo {
return &Foo {
a: a,
b: b
};
}
fn main() -> i32 {
let obj = Foo::new();
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;