diff options
Diffstat (limited to 'lib/unicode/prop')
-rw-r--r-- | lib/unicode/prop/uprop_get_lc.c | 30 | ||||
-rw-r--r-- | lib/unicode/prop/uprop_get_tc.c | 2 | ||||
-rw-r--r-- | lib/unicode/prop/uprop_get_uc.c | 4 |
3 files changed, 19 insertions, 17 deletions
diff --git a/lib/unicode/prop/uprop_get_lc.c b/lib/unicode/prop/uprop_get_lc.c index 4bbdc12..7d90d8d 100644 --- a/lib/unicode/prop/uprop_get_lc.c +++ b/lib/unicode/prop/uprop_get_lc.c @@ -13,18 +13,18 @@ uprop_get_lc(rune ch, struct lcctx ctx) if (ch == U'İ') return ctx.az_or_tr ? M('i') : M('i', 0x307); - if (ctx.lt_acc_after) { - switch (ch) { - case 'I': - return M('i', 0x307); - case 'J': - return M('j', 0x307); - case U'Į': - return M(U'į', 0x307); + if (ctx.lt) { + if (ctx.before_acc) { + switch (ch) { + case 'I': + return M('i', 0x307); + case 'J': + return M('j', 0x307); + case U'Į': + return M(U'į', 0x307); + } } - } - if (ctx.lt) { switch (ch) { case U'Ì': return M('i', 0x307, 0x300); @@ -35,10 +35,12 @@ uprop_get_lc(rune ch, struct lcctx ctx) } } - if (ch == 0x307 && ctx.az_tr_after_I) - return M(); - if (ch == 'I' && ctx.az_tr_not_before_dot) - return M(U'ı'); + if (ctx.az_or_tr) { + if (ch == 0x307 && ctx.after_I) + return M(); + if (ch == 'I' && !ctx.before_dot) + return M(U'ı'); + } ch = uprop_get_slc(ch); return M(ch); diff --git a/lib/unicode/prop/uprop_get_tc.c b/lib/unicode/prop/uprop_get_tc.c index c4c8070..029ef51 100644 --- a/lib/unicode/prop/uprop_get_tc.c +++ b/lib/unicode/prop/uprop_get_tc.c @@ -66,7 +66,7 @@ uprop_get_tc(rune ch, struct tcctx ctx) { if (ch == 'i' && ctx.az_or_tr) return M(U'İ'); - if (ch == 0x307 && ctx.lt_after_i) + if (ch == 0x307 && ctx.lt && ctx.after_i) return M(); rune CH = uprop_get_stc(ch); diff --git a/lib/unicode/prop/uprop_get_uc.c b/lib/unicode/prop/uprop_get_uc.c index d3ab274..69435b8 100644 --- a/lib/unicode/prop/uprop_get_uc.c +++ b/lib/unicode/prop/uprop_get_uc.c @@ -120,10 +120,10 @@ struct rview uprop_get_uc(rune ch, struct ucctx ctx) { if (ch == U'ß') - return ctx.cap_eszett ? M(U'ẞ') : M('S', 'S'); + return ctx.ẞ ? M(U'ẞ') : M('S', 'S'); if (ch == 'i' && ctx.az_or_tr) return M(U'İ'); - if (ch == 0x307 && ctx.lt_after_i) + if (ch == 0x307 && ctx.lt && ctx.after_i) return M(); rune CH = uprop_get_suc(ch); |