engine: one trans contract for every language
Japanese was never dispatched through the Lang table: dotrans and transstr both special-cased it into transjp, which edited Im in place and wrote commits through a side argument, while transko popped and cleared a pre that every caller overwrote anyway, and Vietnamese kept its key history in dotrans. Emit now carries the new raw state next to the new pre; transjp, transko and transvi are pure functions of (Im, key), and dotrans and transstr have a single path. Vietnamese history bookkeeping lives in vi.c, where the full-history flush no longer resets the caret as a side effect; istone was toneidx() >= 0.
This commit is contained in:
@@ -15,6 +15,7 @@ typevi(struct ct *t, char *keys, char *want)
|
||||
e = transvi(&state, (uchar)*p);
|
||||
sappend(&out, &e.s);
|
||||
state.pre = e.next;
|
||||
state.raw = e.raw;
|
||||
if(!e.eat)
|
||||
sputr(&out, (uchar)*p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user