use 5.012;
use strict;
use warnings;
-use Config;
+require 'regen/regen_lib.pl';
# This program outputs the 256 lines that form the guts of the PL_charclass
# table. The output should be used to manually replace the table contents in
# Read in the case fold mappings.
my %folded_closure;
-my $file="$Config{privlib}/unicore/CaseFolding.txt";
+my $file="lib/unicore/CaseFolding.txt";
open my $fh, "<", $file or die "Failed to read '$file': $!";
while (<$fh>) {
chomp;
APC
);
+my $out_fh = safer_open('l1_char_class_tab.h-new', 'l1_char_class_tab.h');
+print $out_fh read_only_top(lang => 'C', style => '*', by => $0, from => $file);
+
# Output the table using fairly short names for each char.
for my $ord (0..255) {
my $name;
$name =~ s/LATIN CAPITAL LETTER //
|| $name =~ s/LATIN SMALL LETTER (.*)/\L$1/;
}
- printf "/* U+%02X %s */ %s,\n", $ord, $name, $bits[$ord];
+ printf $out_fh "/* U+%02X %s */ %s,\n", $ord, $name, $bits[$ord];
}
+read_only_bottom_close_and_rename($out_fh)
-/* !! MODIFY AND USE Porting/mk_PL_charclass.pl TO CHANGE THIS TABLE !! */
+/* -*- buffer-read-only: t -*-
+ * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+ * This file is built by Porting/mk_PL_charclass.pl from
+ * lib/unicore/CaseFolding.txt.
+ * Any changes made here will be lost!
+ */
+
/* U+00 NUL */ _CC_CNTRL_A|_CC_CNTRL_L1,
/* U+01 SOH */ _CC_CNTRL_A|_CC_CNTRL_L1,
/* U+02 STX */ _CC_CNTRL_A|_CC_CNTRL_L1,
/* U+FD y with acute */ _CC_ALNUMC_L1|_CC_ALPHA_L1|_CC_CHARNAME_CONT|_CC_GRAPH_L1|_CC_IDFIRST_L1|_CC_LOWER_L1|_CC_PRINT_L1|_CC_WORDCHAR_L1,
/* U+FE thorn */ _CC_ALNUMC_L1|_CC_ALPHA_L1|_CC_CHARNAME_CONT|_CC_GRAPH_L1|_CC_IDFIRST_L1|_CC_LOWER_L1|_CC_PRINT_L1|_CC_WORDCHAR_L1,
/* U+FF y with diaeresis */ _CC_NONLATIN1_FOLD|_CC_ALNUMC_L1|_CC_ALPHA_L1|_CC_CHARNAME_CONT|_CC_GRAPH_L1|_CC_IDFIRST_L1|_CC_LOWER_L1|_CC_PRINT_L1|_CC_WORDCHAR_L1,
+
+/* ex: set ro: */