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

@ -9,21 +9,21 @@ program UiReload {
const PATH: string = "build/ui_reload_example.xml"
const V1: string = "<ui><screen name='note'><state n='{0}'/><button on-click='set n = n + 1'>{title} {n}</button></screen></ui>"
const V2: string = "<ui><screen name='note'><state n='{0}'/><h1>{title} again {n}</h1></screen></ui>"
function shown(ui_st: mut UiState) -> string {
let root: UiNode = ui_nodes(ui_st, "note", view_note())
function shown() -> string {
let root: UiNode = ui_nodes("note", view_note())
let first = root.children[0]
if len(first.children) > 0 { return first.children[0].text }
return first.text
}
entry (ui_st: mut UiState) {
entry {
Fs.write_text(PATH, V1)
ui_load(ui_st, PATH)
let root: UiNode = ui_nodes(ui_st, "note", view_note())
ui_press(ui_st, root.children[0])
let before = shown(ui_st)
let same = ui_reload(ui_st)
ui_load(PATH)
let root: UiNode = ui_nodes("note", view_note())
ui_press(root.children[0])
let before = shown()
let same = ui_reload()
Fs.write_text(PATH, V2)
let changed = ui_reload(ui_st)
print(`{before} | reloaded {same} then {changed} | {shown(ui_st)}`)
let changed = ui_reload()
print(`{before} | reloaded {same} then {changed} | {shown()}`)
}
}