aboutsummaryrefslogtreecommitdiff
path: root/mkcasefold.pl
blob: 4c0863431b8aeb64018f88967fe744d639a9fc32 (plain)
  1. print("    switch (c) {\n");
  2. my $lastchar = "";
  3. while (<STDIN>) {
  4. if (/^[A-F0-9]/ and / [CF]; /) {
  5. my ($char, $type, $subst) = m/([A-F0-9]+); ([CF]); ([^;]+)/;
  6. if ($char eq $lastchar) {
  7. break;
  8. }
  9. my @subst = $subst =~ m/(\w+)/g;
  10. printf(" case 0x%s:\n", $char);
  11. foreach (@subst) {
  12. printf(" bufpush(0x%s);\n", $_);
  13. }
  14. printf(" break;\n");
  15. $lastchar = $char;
  16. }
  17. }
  18. printf(" default:\n");
  19. printf(" bufpush(c);\n");
  20. print(" }\n");