compiler: a Key reaches a template as its marked text (a component's or a view's Key field, for t(expr)), and a derived key's message names it as one; reseeded, bootstrap-cfree fixpoint holds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 23:38:03 +03:00
parent cc1ea0f4ae
commit 4988adb170
5 changed files with 73023 additions and 72909 deletions

View file

@ -394,7 +394,7 @@ function i18n_data_rec(rec: Node, comp: Node, base: pointer) -> void {
if fi != null { i18n_data_val(fi.a, f.ty, key, text) }
else if text and i18n_is_key_ty(f.ty) {
# a map's row: its key is derived and must be in en.po (the fill is compiled registries')
g_i18n_what = `{key}, the derived key of a @Text field the row gives no value,`
g_i18n_what = `{key} (the derived key of a @Text field the row gives no value)`
i18n_use(key, false, KS_DATA, rec.file, rec.line, rec.col)
g_i18n_what = null
}
@ -405,7 +405,7 @@ function i18n_data_rec(rec: Node, comp: Node, base: pointer) -> void {
function i18n_data_val(e: Node, ty: pointer, key: pointer, text: bool) -> void {
if e == null { return }
if i18n_is_key(e) {
if e.ty != null and (e.ty == "derived") { g_i18n_what = `{key}, the derived key of a @Text field the row gives no value,` }
if e.ty != null and (e.ty == "derived") { g_i18n_what = `{key} (the derived key of a @Text field the row gives no value)` }
i18n_use(i18n_key_text(e), e.ival == KEY_PLURAL, KS_DATA, e.file, e.line, e.col)
g_i18n_what = null
return

View file

@ -6,6 +6,7 @@ function vw_conv(v: int, ty: pointer, x: pointer, head: Node) -> pointer {
if (ty == "int") { return `value_int({x})` }
if (ty == "float") { return `value_float({x})` }
if (ty == "string") { return `value_str({x})` }
if i18n_is_key_ty(ty) { return `value_str(string({x}))` } # a Key: its marked text, for a template's t(expr)
if (ty == "bool") {
vw_helper(`function view_val_bool(b: bool) -> Val {{\n if b {{ return value_bool(1) }}\n return value_bool(0)\n}}\n`, "view_val_bool", head)
return `view_val_bool({x})`

View file

@ -6,6 +6,7 @@ function vw_set(v: int, ty: pointer, o: pointer, k: pointer, x: pointer, head: N
if (ty == "int") { return ` value_set_int({o}, "{k}", {x})\n` }
if (ty == "float") { return ` value_set_float({o}, "{k}", {x})\n` }
if (ty == "string") { return ` value_set_str({o}, "{k}", {x})\n` }
if i18n_is_key_ty(ty) { return ` value_set_str({o}, "{k}", string({x}))\n` } # a Key: its marked text, for t(expr)
if (ty == "bool") { return ` value_set_bool({o}, "{k}", {x})\n` }
if (ty == "[]int") { return ` value_set_ints({o}, "{k}", {x})\n` }
if (ty == "[]float") { return ` value_set_floats({o}, "{k}", {x})\n` }