aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_latin.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-01-26 18:31:24 +0100
committerMattias Andrée <m@maandree.se>2026-01-26 18:31:24 +0100
commitd2569edaafac2c92a9782327370ad11e1f878495 (patch)
tree3c4542e716a73154c280ad07fb5358c4e89782e3 /libcharconv_latin.c
parentClean up (diff)
downloadcharconv-d2569edaafac2c92a9782327370ad11e1f878495.tar.gz
charconv-d2569edaafac2c92a9782327370ad11e1f878495.tar.bz2
charconv-d2569edaafac2c92a9782327370ad11e1f878495.tar.xz
Add metrical
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcharconv_latin.c')
-rw-r--r--libcharconv_latin.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libcharconv_latin.c b/libcharconv_latin.c
index 4b41391..2693ea4 100644
--- a/libcharconv_latin.c
+++ b/libcharconv_latin.c
@@ -550,6 +550,16 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
c2 = (char)(c - (UINT32_C(0x278A) - (uint_least32_t)'1'));
c3 = ')';
goto conv3;
+ } else if (UINT32_C(0x23D6) <= c && c <= UINT32_C(0x23D9)) {
+ /* metrical */
+ c -= (uint_least32_t)UINT32_C(0x23D6) - (uint_least32_t)'2';
+ goto conv;
+ } else if (UINT32_C(0x23D2) <= c && c <= UINT32_C(0x23D5)) {
+ /* metrical */
+ c -= (uint_least32_t)UINT32_C(0x23D2);
+ c1 = (c & 1u) ? '_' : '-';
+ c2 = (c & 2u) ? '2' : '1';
+ goto conv2;
} else {
use_switch:
@@ -981,6 +991,9 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
case UINT32_C(0x2793): c1 = '('; c2 = '1'; c3 = '0'; c4 = ')'; goto conv4;
case UINT32_C(0x1F10C): c1 = '('; c2 = '0'; c3 = ')'; goto conv3;
+ /* metrical */
+ case UINT32_C(0x23D1): c1 = '1'; goto conv1;
+
default:
no_match:
*n += clen;