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

@ -5,21 +5,19 @@ import "ludic.ui"
import "ui_text_parts/Fit.ludic"
program UiText {
numbers float
state UitextState {
said: []string = new []string
}
function rec_text(uitext_st: mut UitextState, x: float, y: float, s: string, size: float, c: int, a: float) -> void { push(uitext_st.said, `{s}@{int(size * 10.0)} y{int(y)}`) }
var said: []string = new []string
function rec_text(x: float, y: float, s: string, size: float, c: int, a: float) -> void { push(said, `{s}@{int(size * 10.0)} y{int(y)}`) }
function w(s: string, size: float) -> float { return float(len(s)) * size * 0.5 }
entry (ui_st: mut UiState, uitext_st: UitextState) {
entry {
let b = new UiBackend
b.text = fn rec_text
b.measure = fn w
ui_backend(ui_st, b)
ui_show(ui_st, "Fit", null, 0.0, 0.0, 400.0, 600.0)
let root: UiNode = ui_nodes(ui_st, "Fit", null)
ui_place(ui_st, root, 0.0, 0.0, 400.0, 600.0)
ui_backend(b)
ui_show("Fit", null, 0.0, 0.0, 400.0, 600.0)
let root: UiNode = ui_nodes("Fit", null)
ui_place(root, 0.0, 0.0, 400.0, 600.0)
let page = root.children[0]
let lines = page.children[3]
print(`{uitext_st.said[0]} | {uitext_st.said[1]} | {uitext_st.said[2]} | lines {len(lines.lines)} {int(lines.mh)} {uitext_st.said[3]} {uitext_st.said[4]} | tall {int(page.children[4].mh)} | em {int(page.children[5].pt)} {int(page.children[6].pt)} | tie {ui_hex(page.children[7].fg)}`)
print(`{said[0]} | {said[1]} | {said[2]} | lines {len(lines.lines)} {int(lines.mh)} {said[3]} {said[4]} | tall {int(page.children[4].mh)} | em {int(page.children[5].pt)} {int(page.children[6].pt)} | tie {ui_hex(page.children[7].fg)}`)
}
}