aboutsummaryrefslogtreecommitdiff
path: root/mkcasefold.pl
blob: 740ce77a60362e656b7a17dc8ba78be4d7af142f (plain)
  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");