compiler: text keys (phase 26.2) - k"pause.resume" / kn"catch.count" of the builtin type Key (not a string, and no string one; == compares), its run-time value the key after a marker byte (1, or 2 for a plural); package.ludic's lang "assets/lang" en and a gettext .po reader; every key literal checked against en.po (a kn"" one wants a msgid_plural), trf / trn and a template's t('key', ...) against the English's holes, a component's template words and a @Text row's English as "English left" (warnings, english_left in ludic deps), a @Text Key field a compiled row leaves out filled with its derived key <registry>.<row>.<field> (or @TextKey's prefix; maps.<map>.<table>.<row>.<field> for a @PerMap row, checked), one English under several undescribed keys warned at en.po's line; the schema's "lang" (keys and their sites, unused, undescribed, split, and every other language's missing / fuzzy / extra); k"" in .lres data, @PerMap rows included (lres_key); ludic-fmt keeps a key literal whole; reseeded, bootstrap-cfree fixpoint holds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
82c652ca31
commit
cc1ea0f4ae
28 changed files with 139268 additions and 109746 deletions
|
|
@ -34,6 +34,7 @@ function ck_compare(e: Node, op: pointer, l: pointer, r: pointer, a: Node, b: No
|
|||
let cr = ck_class(r)
|
||||
# a pointer holding text is compared with a string all through the runtime and the compiler
|
||||
if ((l == "pointer") and (cr == "string")) or ((r == "pointer") and (cl == "string")) { return }
|
||||
if ((l == "pointer") and (cr == "key")) or ((r == "pointer") and (cl == "key")) { return }
|
||||
if cl != cr {
|
||||
ck_err("compare", e, `{op} between {ck_a(l)} and {ck_a(r)}`)
|
||||
return
|
||||
|
|
@ -46,6 +47,10 @@ function ck_compare(e: Node, op: pointer, l: pointer, r: pointer, a: Node, b: No
|
|||
# `string` and the untyped `pointer` are both text to an operator (the emitter's is_textish)
|
||||
function ck_is_text(t: pointer) -> bool { return (t == "string") or (t == "pointer") }
|
||||
function ck_arith(e: Node, op: pointer, l: pointer, r: pointer, a: Node, b: Node) -> pointer {
|
||||
if ck_is_key(l) or ck_is_key(r) {
|
||||
ck_err("key", e, `{op} on a Key: a key names a text, it is not one - make the text with tr(key)`)
|
||||
return "?"
|
||||
}
|
||||
if ck_is_text(l) or ck_is_text(r) {
|
||||
if ck_unknown(l) or ck_unknown(r) { return "string" }
|
||||
if ck_is_text(l) and ck_is_text(r) and (op == "+") { return "string" }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue