feat(text): normalization forms of a String #812
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!812
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/363-string-normalization"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Declares
String.toNfc(),toNfd(),toNfkc()andtoNfkd()instd/textover the UAX #15 natives of #362 (no seed change).std/text/src/lib.trb: four documentednative fndeclarations (examples, pitfalls: normalization changes bytes, compare normalized texts, NFKC loses distinctions, not a security boundary by itself).tests/conformance/text-normalization.trbwith.expected,.exitand.allocations: composed vs decomposed u-diaeresis, Hangul syllables and jamo, canonical reordering, the singleton U+2126, compatibility forms (fi ligature, circled one, fullwidth A, squared apaato), ASCII (shared storage, shown by the allocation budget), the empty text, idempotence.std/text/tests/normalization.test.trb: all 81 rows of the committed excerpt of NormalizationTest.txt (Unicode 17.0.0) through all four methods; the whole-file runtime test stays.Local:
torb test std/text81 passed,torb format --check,torb docs skill --check,torb doc --check std/text, and the conformance program in VM and native. Tier A and B run in CI.Closes #363
String.toNfc(),toNfd(),toNfkc()andtoNfkd()(commit 2 of 2) #363Approved at
73b72e4.text-normalization.trbwith.expected,.exitand.allocationscovers every case the issue lists (ü composed/decomposed, Hangul, ccc reordering, U+2126, fi ① A ㌀, ASCII shared storage, empty text, idempotence). The std test runs 81 NormalizationTest rows through all four forms. CI for this head: tier A, bootstrap, JS, PHP, same-C and gates are green. Tier B is skipped by the repo rule (ci.yml: only PRs touching ir/backend/runtime/tools/.forgejo run it); this PR touches none of them.runtime/normalization.c, #362). The declarations match the doc and the expected output (e.g. NFKD of ㌀ keeps the U+309A mark, NFKC composes it).Non-blocking: none.
String.toNfc(),toNfd(),toNfkc()andtoNfkd()(commit 2 of 2) #363