_ prefixed top-level symbols now file-local

This commit is contained in:
2026-07-11 23:37:30 +02:00
parent 6dd6b7ff54
commit 220b1c6e82
15 changed files with 282 additions and 90 deletions
+22
View File
@@ -0,0 +1,22 @@
_Thing :: struct {
value i32
}
_value :: 1
_helper func() i32 {
thing _Thing = _Thing { value = _value }
return thing.value
}
_foreign c_func() i32 {
return 1
}
_C_Record :: c_struct {
value c_int
}
from_a func() i32 {
return _helper()
}
+20
View File
@@ -0,0 +1,20 @@
_Thing :: struct {
value i32
}
_value :: 2
_helper func() i32 {
thing _Thing = _Thing { value = _value }
return thing.value
}
Box :: struct {
_value i32
}
from_b func(_input i32) i32 {
_local Box = Box { _value = _input }
record _C_Record = _C_Record { value = 0 }
return _helper() + _local._value + _foreign() + i32(record.value)
}
@@ -0,0 +1,3 @@
main func() i32 {
return from_a() + from_b(3)
}