mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-26 04:18:58 +08:00
98182da528
* java/io/PushbackReader.java: Merged with Classpath. * java/util/Arrays.java: Updated from Classpath. * scripts/blocks.pl: New file. * java/lang/Character.java (Subset): New class. (UnicodeBlock): New class. * java/lang/Math.java (toDegrees, toRadians): New methods. * java/lang/Float.java: Implement Comparable. (compareTo): New methods. * java/lang/Double.java: Implement Comparable. (compareTo): New methods. From-SVN: r37512
49 lines
957 B
Raku
49 lines
957 B
Raku
#! /usr/bin/perl
|
|
|
|
if ($ARGV[0] eq '')
|
|
{
|
|
$file = 'Blocks.txt';
|
|
if (! -f $file)
|
|
{
|
|
# Too painful to figure out how to get Perl to do it.
|
|
# FIXME.
|
|
system 'wget -o .wget-log http://www.isi.edu/in-notes/iana/unidata/Blocks.txt';
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$file = $ARGV[0];
|
|
}
|
|
|
|
open (INPUT, "< $file") || die "couldn't open $file: $!";
|
|
|
|
@array = ();
|
|
while (<INPUT>)
|
|
{
|
|
next if /^#/;
|
|
chop;
|
|
|
|
($start, $to, $text) = split (/; /);
|
|
($symbol = $text) =~ tr/a-z/A-Z/;
|
|
$symbol =~ s/[- ]/_/g;
|
|
|
|
# Special case for one of the SPECIALS.
|
|
next if $start eq 'FEFF';
|
|
|
|
printf " public static final UnicodeBlock %s = new UnicodeBlock (\"%s\", '\\u%s', '\\u%s');\n",
|
|
$symbol, $text, $start, $to;
|
|
|
|
push (@array, $symbol);
|
|
}
|
|
|
|
printf " private static final UnicodeBlock[] blocks = {\n";
|
|
foreach (@array)
|
|
{
|
|
printf " %s", $_;
|
|
printf "," unless $_ eq 'SPECIALS';
|
|
printf "\n";
|
|
}
|
|
printf " };\n";
|
|
|
|
close (INPUT);
|