wip(0.S2): migrate - a var nothing writes becomes a let; a state is keyed by its module, directory or program, so every program's plan agrees; paths normalized; program states named SceneDemoState / scene_demo_st; the LSP reads state, mut and entry/handler parameters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3eda72e8c2
commit
5ffe50ed02
463 changed files with 72045 additions and 67421 deletions
|
|
@ -51,20 +51,20 @@ function act_keyword(r: UiRd, word: string) -> bool {
|
|||
}
|
||||
return true
|
||||
}
|
||||
function act_run(ui_st: mut UiState, a: UiAct, e: UiEnv) -> void {
|
||||
function act_run(a: UiAct, e: UiEnv) -> void {
|
||||
for i in 0 .. len(a.kinds) {
|
||||
if a.kinds[i] == A_SET { env_set(ui_st, e, a.names[i], ui_eval(ui_st, a.exprs[i], e)) }
|
||||
if a.kinds[i] == A_CALL { ui_eval(ui_st, a.exprs[i], e) }
|
||||
if a.kinds[i] == A_EMIT { act_emit(ui_st, a.names[i], e) }
|
||||
if a.kinds[i] == A_SET { env_set(e, a.names[i], ui_eval(a.exprs[i], e)) }
|
||||
if a.kinds[i] == A_CALL { ui_eval(a.exprs[i], e) }
|
||||
if a.kinds[i] == A_EMIT { act_emit(a.names[i], e) }
|
||||
}
|
||||
}
|
||||
function act_emit(ui_st: mut UiState, name: string, e: UiEnv) -> void {
|
||||
function act_emit(name: string, e: UiEnv) -> void {
|
||||
var at = e
|
||||
while at != null {
|
||||
if at.on_names != null {
|
||||
for i in 0 .. len(at.on_names) {
|
||||
if at.on_names[i] == name {
|
||||
act_run(ui_st, at.on_acts[i], at.on_envs[i])
|
||||
act_run(at.on_acts[i], at.on_envs[i])
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue