cmark
My personal build of CMark ✏️
mkcasefold.pl (525B)
1 binmode STDOUT; 2 print(" switch (c) {\n"); 3 my $lastchar = ""; 4 while (<STDIN>) { 5 if (/^[A-F0-9]/ and / [CF]; /) { 6 my ($char, $type, $subst) = m/([A-F0-9]+); ([CF]); ([^;]+)/; 7 if ($char eq $lastchar) { 8 break; 9 } 10 my @subst = $subst =~ m/(\w+)/g; 11 printf(" case 0x%s:\n", $char); 12 foreach (@subst) { 13 printf(" bufpush(0x%s);\n", $_); 14 } 15 printf(" break;\n"); 16 $lastchar = $char; 17 } 18 } 19 printf(" default:\n"); 20 printf(" bufpush(c);\n"); 21 print(" }\n"); 22