From d2569edaafac2c92a9782327370ad11e1f878495 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 26 Jan 2026 18:31:24 +0100 Subject: Add metrical MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libcharconv_latin.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libcharconv_latin.c') 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; -- cgit v1.2.3-70-g09d2