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:
Orkun ÇAKILKAYA 2026-09-25 15:31:34 +03:00
parent 3eda72e8c2
commit 5ffe50ed02
463 changed files with 72045 additions and 67421 deletions

View file

@ -11,18 +11,18 @@ program UiComponent {
if n.text != "" { push(out, n.text) }
for i in 0 .. len(n.children) { texts(n.children[i], out) }
}
function frame(ui_st: mut UiState) -> UiNode {
let root: UiNode = ui_nodes(ui_st, "App", null)
ui_place(ui_st, root, 0.0, 0.0, 400.0, 400.0)
function frame() -> UiNode {
let root: UiNode = ui_nodes("App", null)
ui_place(root, 0.0, 0.0, 400.0, 400.0)
return root
}
entry (ui_st: mut UiState) {
var root = frame(ui_st)
entry {
var root = frame()
let b = root.children[0].children[2]
ui_press(ui_st, b.children[1])
ui_press(ui_st, b.children[1])
ui_press(ui_st, root.children[0].children[1].children[1])
root = frame(ui_st)
ui_press(b.children[1])
ui_press(b.children[1])
ui_press(root.children[0].children[1].children[1])
root = frame()
let out = new []string
texts(root, out)
var joined = ""
@ -30,8 +30,8 @@ program UiComponent {
print(joined)
let b2 = root.children[0].children[2]
print(`b margin {int(b2.mt)}; b text {b2.children[0].fg}; outside {root.children[0].children[3].fg}; button {int(b2.children[1].ch)}`)
ui_press(ui_st, b2.children[2])
root = frame(ui_st)
ui_press(b2.children[2])
root = frame()
print(root.children[0].children[2].children[0].text)
}
}