This commit is contained in:
nub31
2025-06-14 17:12:19 +02:00
parent 3789c24eb9
commit c9a9c4ff89
6 changed files with 126 additions and 118 deletions

4
example/c.nub Normal file
View File

@@ -0,0 +1,4 @@
namespace c
// extern func printf(fmt: ^u8, ...args: any): void
extern func puts(fmt: []u8)

43
example/main.nub Normal file
View File

@@ -0,0 +1,43 @@
namespace main
struct Human {
age: u64
print_age: func() = func() {
c::puts("pwp")
}
}
export func main(args: []^string): i64 {
let x = 2
let uwu = func() {
c::puts("uwu")
}
uwu()
func() {
c::puts("owo")
}()
let me = alloc Human {
age = 23
}
me.print_age()
if true {
// do something
}
c::puts("test")
let i = 1
while i <= 10 {
c::puts("test")
i = i + 1
}
return 0
}