summaryrefslogtreecommitdiff
path: root/lib/unicode/mktables.PL
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unicode/mktables.PL')
-rwxr-xr-xlib/unicode/mktables.PL41
1 files changed, 35 insertions, 6 deletions
diff --git a/lib/unicode/mktables.PL b/lib/unicode/mktables.PL
index 7d70b18469..a6e3a5ef3d 100755
--- a/lib/unicode/mktables.PL
+++ b/lib/unicode/mktables.PL
@@ -181,6 +181,11 @@ foreach $file (@todo) {
else {
open(OUT, ">$table.pl") or die "Can't create $table.pl: $!\n";
}
+ print OUT <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+EOH
print OUT <<"END";
return <<'END';
END
@@ -195,6 +200,11 @@ exit if @ARGV and not grep { $_ eq Block } @ARGV;
print "Block\n";
open(UD, 'Blocks.txt') or die "Can't open blocks.txt: $!\n";
open(OUT, ">Block.pl") or die "Can't create $table.pl: $!\n";
+print OUT <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+EOH
print OUT <<"END";
return <<'END';
END
@@ -208,6 +218,11 @@ while (<UD>) {
print OUT "$code $last $name\n";
$name =~ s/\s+//g;
open(BLOCK, ">In/$name.pl");
+ print BLOCK <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+EOH
print BLOCK <<"END2";
return <<'END';
$code $last
@@ -388,24 +403,38 @@ foreach my $b (@base) {
@unicode = sort keys %unicode;
print "EqUnicode\n";
-if (open(EQ_UNICODE, ">Eq/Unicode")) {
+if (open(OUT, ">Eq/Unicode.pl")) {
+ print OUT <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+return <<'END';
+EOH
foreach my $c (@unicode) {
- print EQ_UNICODE "$c @{$unicode{$c}}\n";
+ print OUT "$c @{$unicode{$c}}\n";
}
- close EQ_UNICODE;
+ print OUT "END\n";
+ close OUT;
} else {
die "$0: failed to open Eq/Unicode for writing: $!\n";
}
print "EqLatin1\n";
-if (open(EQ_LATIN1, ">Eq/Latin1")) {
+if (open(OUT, ">Eq/Latin1.pl")) {
+ print OUT <<EOH;
+# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+# This file is built by $0 from e.g. $UnicodeData.
+# Any changes made here will be lost!
+return <<'END';
+EOH
foreach my $c (@unicode) {
last if hex($c) > 255;
my @c = grep { hex($_) < 256 } @{$unicode{$c}};
next unless @c;
- print EQ_LATIN1 "$c @c\n";
+ print OUT "$c @c\n";
}
- close EQ_LATIN1;
+ print OUT "END\n";
+ close OUT;
} else {
die "$0: failed to open Eq/Latin1 for writing: $!\n";
}