benilla-re systems structs docs

s_grammarWork

global · ui

Address
0xcf2cd0 · 8192 bytes, up to 0xcf4ccf
Type
uint16_t[4096]
Meaning
Holds the UTF-16 text the grammar escape passes build before converting it back
Confidence
verified, proof one
Finding
ui/fonttext#korean-escape

Finding: Korean escape in ui: font string internals

In a text set from Lua, |1 followed by a non-digit opens a two-way particle, |1first;second;, which becomes one part by the sound that ends the text before it. A Hangul syllable with a final consonant picks the first part, one without it the second, except that a syllable ending in ㄹ (final index 8) picks the second when the first starts with 으. A digit picks by a ten-byte table (1 for 0, 1, 3, 6, 7, 8), a Latin letter by a 26-byte table (1 for b, c, k, l, m, n, p, q); other characters and bytes after | are skipped, and with nothing to look back at the first part wins.

The derivation is in the doc.