feat(lang): a module's private records and events are its own

A property or event a module does not export no longer collides with
another module's of the same spelling: each private one is renamed for
its module, with the types, new, emit and @On written in that module.
Exported ones stay one namespace; two events of one spelling are now
refused. Generic records, entity components and component or view
records stay global. Reseed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 11:02:48 +03:00
parent 029a1ebba2
commit 69352babfd
17 changed files with 50199 additions and 44822 deletions

View file

@ -4,7 +4,7 @@
# (`sp_seed` in module shop becomes `sp_seed$shop`), and so is every reference to it written in that
# module that no local shadows. Exported and public names stay one namespace, so a clash between two
# of those is still the error it was. Nothing is renamed when nothing clashes, so a program with no
# clash compiles exactly as before. Records and events still share one namespace.
# clash compiles exactly as before. Records and events: privates_types.ludic.
var g_rn_mod: []pointer = new []pointer
var g_rn_old: []pointer = new []pointer
var g_rn_new: []pointer = new []pointer
@ -107,8 +107,8 @@ function privates_rename() -> void {
}
a = b
}
if len(g_rn_old) == 0 { return }
priv_apply()
if len(g_rn_old) > 0 { priv_apply() }
privates_types() # records and events (privates_types.ludic)
}
# the rename for a reference to `s` written in file `f`, or null
function priv_find(s: pointer, f: pointer, want_fn: int) -> pointer {