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:
parent
629579123a
commit
429e419327
71 changed files with 365 additions and 155 deletions
|
|
@ -7,13 +7,16 @@ export function L(i18n_st: mut I18nState, s: string) -> string {
|
|||
let r = whole(i18n_st, s)
|
||||
if Dict.size(i18n_st.cache) >= CACHE_MAX {
|
||||
Dict.clear(i18n_st.cache)
|
||||
i18n_st.cache_out = new []string
|
||||
List.clear(i18n_st.cache_out)
|
||||
}
|
||||
@alloc_ok("a translation cache miss: the entry is kept, up to CACHE_MAX")
|
||||
Dict.set(i18n_st.cache, s, len(i18n_st.cache_out))
|
||||
@alloc_ok("a translation cache miss: as above")
|
||||
push(i18n_st.cache_out, r)
|
||||
return r
|
||||
}
|
||||
|
||||
@alloc_ok("a translation cache miss (L): once per distinct text, bounded by CACHE_MAX")
|
||||
function whole(i18n_st: mut I18nState, s: string) -> string {
|
||||
let n = len(s)
|
||||
if n == 0 { return s }
|
||||
|
|
@ -37,6 +40,7 @@ function whole(i18n_st: mut I18nState, s: string) -> string {
|
|||
}
|
||||
|
||||
# a paragraph built from sentences, one at a time; English stays where a sentence is unknown
|
||||
@alloc_ok("a translation cache miss (L): once per distinct text")
|
||||
function sentences(i18n_st: mut I18nState, s: string) -> string {
|
||||
let n = len(s)
|
||||
var r = ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue