aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_latin.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-01-26 17:57:59 +0100
committerMattias Andrée <m@maandree.se>2026-01-26 17:57:59 +0100
commitb48e74772cc4e6879a6d37a5c00ad6df2db1edc3 (patch)
tree4d1497bc28ff8ef8f2c4102195326dfe76b2622d /libcharconv_latin.c
parentAdd flipping and turning for yijing n-grams, and add invisible (diff)
downloadcharconv-b48e74772cc4e6879a6d37a5c00ad6df2db1edc3.tar.gz
charconv-b48e74772cc4e6879a6d37a5c00ad6df2db1edc3.tar.bz2
charconv-b48e74772cc4e6879a6d37a5c00ad6df2db1edc3.tar.xz
Add enclosed
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcharconv_latin.c')
-rw-r--r--libcharconv_latin.c93
1 files changed, 93 insertions, 0 deletions
diff --git a/libcharconv_latin.c b/libcharconv_latin.c
index 5e90e1e..4b41391 100644
--- a/libcharconv_latin.c
+++ b/libcharconv_latin.c
@@ -473,6 +473,84 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
c = (uint_least32_t)"eEe"[(c - UINT32_C(0x1FA48)) % 3u];
goto conv;
+ } else if (UINT32_C(0x2460) <= c && c <= UINT32_C(0x2468)) {
+ /* enclosed (positive) */
+ c1 = '(';
+ c2 = (char)(c - (UINT32_C(0x2460) - (uint_least32_t)'1'));
+ c3 = ')';
+ goto conv3;
+ } else if (UINT32_C(0x2469) <= c && c <= UINT32_C(0x2472)) {
+ /* enclosed (positive) */
+ c1 = '(';
+ c2 = '1';
+ c3 = (char)(c - (UINT32_C(0x2469) - (uint_least32_t)'0'));
+ c4 = ')';
+ goto conv4;
+ } else if (UINT32_C(0x24D0) <= c && c <= UINT32_C(0x24E9)) {
+ /* enclosed (positive) */
+ c1 = '(';
+ c2 = (char)(c - (UINT32_C(0x24D0) - (uint_least32_t)'a'));
+ c3 = ')';
+ goto conv3;
+ } else if (UINT32_C(0x24B6) <= c && c <= UINT32_C(0x24CF)) {
+ /* enclosed (positive) */
+ c1 = '(';
+ c2 = (char)(c - (UINT32_C(0x24B6) - (uint_least32_t)'A'));
+ c3 = ')';
+ goto conv3;
+ } else if (UINT32_C(0x1F130) <= c && c <= UINT32_C(0x1F149)) {
+ /* enclosed (positive) */
+ c1 = '[';
+ c2 = (char)(c - (UINT32_C(0x1F130) - (uint_least32_t)'A'));
+ c3 = ']';
+ goto conv3;
+ } else if (UINT32_C(0x2780) <= c && c <= UINT32_C(0x2788)) {
+ /* enclosed (positive) */
+ c1 = '(';
+ c2 = (char)(c - (UINT32_C(0x2780) - (uint_least32_t)'1'));
+ c3 = ')';
+ goto conv3;
+ } else if (UINT32_C(0x24F5) <= c && c <= UINT32_C(0x24FD)) {
+ /* enclosed (positive) */
+ c1 = '(';
+ c2 = '(';
+ c3 = (char)(c - (UINT32_C(0x24F5) - (uint_least32_t)'1'));
+ c4 = ')';
+ c5 = ')';
+ goto conv5;
+
+ } else if (UINT32_C(0x2776) <= c && c <= UINT32_C(0x277E)) {
+ /* enclosed (negative) */
+ c1 = '(';
+ c2 = (char)(c - (UINT32_C(0x2776) - (uint_least32_t)'1'));
+ c3 = ')';
+ goto conv3;
+ } else if (UINT32_C(0x24EB) <= c && c <= UINT32_C(0x24F3)) {
+ /* enclosed (negative) */
+ c1 = '(';
+ c2 = '1';
+ c3 = (char)(c - (UINT32_C(0x24EB) - (uint_least32_t)'1'));
+ c4 = ')';
+ goto conv4;
+ } else if (UINT32_C(0x1F150) <= c && c <= UINT32_C(0x1F169)) {
+ /* enclosed (negative) */
+ c1 = '(';
+ c2 = (char)(c - (UINT32_C(0x1F150) - (uint_least32_t)'A'));
+ c3 = ')';
+ goto conv3;
+ } else if (UINT32_C(0x1F170) <= c && c <= UINT32_C(0x1F189)) {
+ /* enclosed (negative) */
+ c1 = '[';
+ c2 = (char)(c - (UINT32_C(0x1F170) - (uint_least32_t)'A'));
+ c3 = ']';
+ goto conv3;
+ } else if (UINT32_C(0x278A) <= c && c <= UINT32_C(0x2792)) {
+ /* enclosed (negative) */
+ c1 = '(';
+ c2 = (char)(c - (UINT32_C(0x278A) - (uint_least32_t)'1'));
+ c3 = ')';
+ goto conv3;
+
} else {
use_switch:
switch (c) {
@@ -888,6 +966,21 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
case UINT32_C(0x2063): c = (uint_least32_t)'|'; goto conv;
case UINT32_C(0x2064): c = (uint_least32_t)'+'; goto conv;
+ /* enclosed (positive) */
+ case UINT32_C(0x24EA): c1 = '('; c2 = '0'; c3 = ')'; goto conv3;
+ case UINT32_C(0x2473): c1 = '('; c2 = '2'; c3 = '0'; c4 = ')'; goto conv4;
+ case UINT32_C(0x1F1A5): c1 = '['; c2 = 'd'; c3 = ']'; goto conv3;
+ case UINT32_C(0x24FE): c1 = '('; c2 = '('; c3 = '1'; c4 = '0'; c5 = ')'; c6 = ')'; goto conv6;
+ case UINT32_C(0x2789): c1 = '('; c2 = '1'; c3 = '0'; c4 = ')'; goto conv4;
+ case UINT32_C(0x1F10B): c1 = '('; c2 = '0'; c3 = ')'; goto conv3;
+
+ /* enclosed (negative) */
+ case UINT32_C(0x24FF): c1 = '('; c2 = '0'; c3 = ')'; goto conv3;
+ case UINT32_C(0x277F): c1 = '('; c2 = '1'; c3 = '0'; c4 = ')'; goto conv4;
+ case UINT32_C(0x24F4): c1 = '('; c2 = '2'; c3 = '0'; c4 = ')'; goto conv4;
+ case UINT32_C(0x2793): c1 = '('; c2 = '1'; c3 = '0'; c4 = ')'; goto conv4;
+ case UINT32_C(0x1F10C): c1 = '('; c2 = '0'; c3 = ')'; goto conv3;
+
default:
no_match:
*n += clen;