Add back variable assignment at declaration time

This commit is contained in:
nub31
2025-07-03 19:02:25 +02:00
parent 66d47b9100
commit 50b640b364
6 changed files with 43 additions and 28 deletions

View File

@@ -1,31 +1,29 @@
namespace main
// struct Name {
// first: cstring
// last: cstring
// }
struct Name {
first: cstring
last: cstring
}
// struct Human
// {
// name: Name
// age: i64
// }
struct Human
{
name: Name
age: i64
}
export func main(args: []cstring): i64
{
// let x: Human
let x: Human = alloc Human
{
name = alloc Name
{
first = "john"
last = "doe"
}
age = 23
}
// x = alloc Human {
// name = alloc Name {
// first = "john"
// last = "doe"
// }
// age = 23
// }
// c::puts(x.name.last)
c::puts("test")
c::puts(x.name.last)
return 0
}