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

@ -4,26 +4,24 @@
import "ludic.ui"
program UiAnim {
numbers float
state UianimState {
dim: bool = false
}
view Anim (uianim_st: UianimState) {
dim = uianim_st.dim
var dim: bool = false
view Anim {
dim = dim
}
const PAGE: string = "<ui><style>@keyframes fade { from { opacity: 0 } to { opacity: 1 } }\n@keyframes pulse { from { opacity: 1 } to { opacity: 0.5 } }\n.in { animation: fade 1s }\n.beat { animation: pulse 0.5s infinite alternate }\n.soft { transition: opacity 1s }\n.dim { opacity: 0.2 }</style><screen name='a'><p class='in'>a</p><p class='beat'>b</p><p class=\"soft {dim ? 'dim' : ''}\">c</p></screen></ui>"
function at(ui_st: mut UiState) -> string {
ui_show(ui_st, "a", view_anim(), 0.0, 0.0, 200.0, 200.0)
let r: UiNode = ui_nodes(ui_st, "a", view_anim())
function at() -> string {
ui_show("a", view_anim(), 0.0, 0.0, 200.0, 200.0)
let r: UiNode = ui_nodes("a", view_anim())
return `{int(r.children[0].alpha * 100.0)} {int(r.children[1].alpha * 100.0)} {int(r.children[2].alpha * 100.0)}`
}
entry (ui_st: mut UiState, uianim_st: mut UianimState) {
ui_load_text(ui_st, PAGE, "a.xml")
var out = at(ui_st)
for i in 0 .. 29 { at(ui_st) }
out = out + " | " + at(ui_st)
uianim_st.dim = true
for i in 0 .. 29 { at(ui_st) }
out = out + " | " + at(ui_st)
entry {
ui_load_text(PAGE, "a.xml")
var out = at()
for i in 0 .. 29 { at() }
out = out + " | " + at()
dim = true
for i in 0 .. 29 { at() }
out = out + " | " + at()
print(out)
}
}