aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_latin.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcharconv_latin.c')
-rw-r--r--libcharconv_latin.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/libcharconv_latin.c b/libcharconv_latin.c
index a3bc55f..473896a 100644
--- a/libcharconv_latin.c
+++ b/libcharconv_latin.c
@@ -550,6 +550,7 @@ 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';
@@ -561,6 +562,49 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
c2 = (c & 2u) ? '2' : '1';
goto conv2;
+ } else if (UINT32_C(0x1F0E1) <= c && c <= UINT32_C(0x1F0E9)) {
+ /* cards */
+ c -= (uint_least32_t)UINT32_C(0x1F0E1) - (uint_least32_t)'1';
+ goto conv;
+ } else if (UINT32_C(0x1F0EA) <= c && c <= UINT32_C(0x1F0F3)) {
+ /* cards */
+ c -= (uint_least32_t)UINT32_C(0x1F0EA) - (uint_least32_t)'0';
+ c1 = '1';
+ c2 = (char)c;
+ goto conv2;
+ } else if (UINT32_C(0x1F0F4) <= c && c <= UINT32_C(0x1F0F5)) {
+ /* cards */
+ c -= (uint_least32_t)UINT32_C(0x1F0F4) - (uint_least32_t)'0';
+ c1 = '2';
+ c2 = (char)c;
+ goto conv2;
+ } else if (UINT32_C(0x1F0A1) <= c && c <= UINT32_C(0x1F0AE)) {
+ /* cards */
+ c1 = "A234567890JCQK"[c - UINT32_C(0x1F0A1)];
+ c2 = 'S';
+ goto conv_card;
+ } else if (UINT32_C(0x1F0B1) <= c && c <= UINT32_C(0x1F0BE)) {
+ /* cards */
+ c1 = "A234567890JCQK"[c - UINT32_C(0x1F0B1)];
+ c2 = 'H';
+ goto conv_card;
+ } else if (UINT32_C(0x1F0C1) <= c && c <= UINT32_C(0x1F0CE)) {
+ /* cards */
+ c1 = "A234567890JCQK"[c - UINT32_C(0x1F0C1)];
+ c2 = 'D';
+ goto conv_card;
+ } else if (UINT32_C(0x1F0D1) <= c && c <= UINT32_C(0x1F0DE)) {
+ /* cards */
+ c1 = "A234567890JCQK"[c - UINT32_C(0x1F0D1)];
+ c2 = 'C';
+ conv_card:
+ if (c1 != '0')
+ goto conv2;
+ c3 = c2;
+ c2 = c1;
+ c1 = '1';
+ goto conv3;
+
} else {
use_switch:
switch (c) {
@@ -1011,6 +1055,21 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
case UINT32_C(0x23C5): c1 = '_'; c2 = 'A'; goto conv2;
case UINT32_C(0x23C8): c1 = '_'; c2 = '~'; goto conv2;
+ /* cards */
+ case UINT32_C(0x1F0A0): c1 = '#'; goto conv1;
+ case UINT32_C(0x1F0BF): c1 = 'r'; goto conv1;
+ case UINT32_C(0x1F0CF): c1 = 'b'; goto conv1;
+ case UINT32_C(0x1F0DF): c1 = 'w'; goto conv1;
+ case UINT32_C(0x1F0E0): c1 = 'f'; goto conv1;
+ case UINT32_C(0x2660): c1 = 'S'; goto conv1;
+ case UINT32_C(0x2661): c1 = 'h'; goto conv1;
+ case UINT32_C(0x2662): c1 = 'd'; goto conv1;
+ case UINT32_C(0x2663): c1 = 'C'; goto conv1;
+ case UINT32_C(0x2664): c1 = 's'; goto conv1;
+ case UINT32_C(0x2665): c1 = 'H'; goto conv1;
+ case UINT32_C(0x2666): c1 = 'D'; goto conv1;
+ case UINT32_C(0x2667): c1 = 'c'; goto conv1;
+
default:
no_match:
*n += clen;