ludic.ui, ludic.i18n: frame_allocs to 0 - a wrap, an ellipsis, a tooltip's lines, a text-shadow's colour and a range's value kept by what made them; pointer events from a ring; inline text joined through the memo; the pool's and the state's lists through ui_kept; parse, memo miss, pool miss, lazy start and template errors declared; the translation cache clears in place

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:41:47 +03:00
parent 629579123a
commit 429e419327
71 changed files with 365 additions and 155 deletions

View file

@ -26,8 +26,8 @@ function env_new(ui_st: mut UiState, parent: UiEnv) -> UiEnv {
return e
}
function env_bind(e: UiEnv, name: string, v: Val) -> void {
push(e.names, name)
push(e.vals, v)
ui_kept(e.names, name)
ui_kept(e.vals, v)
}
function env_get(ui_st: mut UiState, e: UiEnv, name: string) -> Val {
var at = e
@ -48,6 +48,7 @@ function env_get(ui_st: mut UiState, e: UiEnv, name: string) -> Val {
cx = cx.parent
}
if e.model != null and Value.has(e.model, name) != 0 { return Value.get(e.model, name) }
@alloc_ok("only when a template is wrong: a broken screen, never a working one")
ui_err(ui_st, `no {name} here: not a loop's, a prop, a state or in the view`)
return Value.null()
}
@ -58,6 +59,7 @@ function env_set(ui_st: mut UiState, e: UiEnv, name: string, v: Val) -> void {
if at.inst != null {
let args = Value.list()
Value.add(args, v)
@alloc_ok("on an action that sets a component's state, not a frame")
if Value.kind(at.inst.cls.call(at.inst.ptr, `set:{name}`, args, null)) != 99 { return }
}
if at.state != null and Value.has(at.state, name) != 0 {
@ -66,10 +68,12 @@ function env_set(ui_st: mut UiState, e: UiEnv, name: string, v: Val) -> void {
}
at = at.parent
}
@alloc_ok("only when a template is wrong: a broken screen, never a working one")
ui_err(ui_st, `set {name}: no state here holds it - declare it with <state {name}="..."/>`)
}
# an error is said once, however many frames make it, and names the template line being built
# said by the runtime, or by a host about something a template asked for
@alloc_ok("only when a template is wrong: a broken screen, never a working one")
export function ui_err(ui_st: mut UiState, msg0: string) -> void {
var msg = msg0
if ui_st.ui_at != "" and not ui_has(msg, ".xml:") { msg = `{ui_st.ui_at}: {msg}` }