56 |
|
|
57 |
# A hash of added fields and the JDK they were added in, to automatically |
# A hash of added fields and the JDK they were added in, to automatically |
58 |
# print @since tags. Maintaining this is optional (and tedious), but nice. |
# print @since tags. Maintaining this is optional (and tedious), but nice. |
59 |
%additions = ("SYRIAC" => "1.4", |
my %additions = ("SYRIAC" => "1.4", |
60 |
"THAANA" => "1.4", |
"THAANA" => "1.4", |
61 |
"SINHALA" => "1.4", |
"SINHALA" => "1.4", |
62 |
"MYANMAR" => "1.4", |
"MYANMAR" => "1.4", |
63 |
"ETHIOPIC" => "1.4", |
"ETHIOPIC" => "1.4", |
64 |
"CHEROKEE" => "1.4", |
"CHEROKEE" => "1.4", |
65 |
"UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS" => "1.4", |
"UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS" => "1.4", |
66 |
"OGHAM" => "1.4", |
"OGHAM" => "1.4", |
67 |
"RUNIC" => "1.4", |
"RUNIC" => "1.4", |
68 |
"KHMER" => "1.4", |
"KHMER" => "1.4", |
69 |
"MONGOLIAN" => "1.4", |
"MONGOLIAN" => "1.4", |
70 |
"BRAILLE_PATTERNS" => "1.4", |
"BRAILLE_PATTERNS" => "1.4", |
71 |
"CJK_RADICALS_SUPPLEMENT" => "1.4", |
"CJK_RADICALS_SUPPLEMENT" => "1.4", |
72 |
"KANGXI_RADICALS" => "1.4", |
"KANGXI_RADICALS" => "1.4", |
73 |
"IDEOGRAPHIC_DESCRIPTION_CHARACTERS" => "1.4", |
"IDEOGRAPHIC_DESCRIPTION_CHARACTERS" => "1.4", |
74 |
"BOPOMOFO_EXTENDED" => "1.4", |
"BOPOMOFO_EXTENDED" => "1.4", |
75 |
"CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A" => "1.4", |
"CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A" => "1.4", |
76 |
"YI_SYLLABLES" => "1.4", |
"YI_SYLLABLES" => "1.4", |
77 |
"YI_RADICALS" => "1.4", |
"YI_RADICALS" => "1.4", |
78 |
); |
); |
79 |
|
|
80 |
print <<'EOF'; |
print <<'EOF'; |
81 |
/** |
/** |
138 |
} |
} |
139 |
EOF |
EOF |
140 |
|
|
141 |
$seenSpecials = 0; |
my $seenSpecials = 0; |
142 |
$seenSurrogates = 0; |
my $seenSurrogates = 0; |
143 |
$surrogateStart = 0; |
my $surrogateStart = 0; |
144 |
|
my @names = (); |
145 |
while (<BLOCKS>) { |
while (<BLOCKS>) { |
146 |
next if /^\#/; |
next if /^\#/; |
147 |
($start, $end, $block) = split(/; /); |
my ($start, $end, $block) = split(/; /); |
148 |
next unless defined $block; |
next unless defined $block; |
149 |
chomp $block; |
chomp $block; |
150 |
$block =~ s/ *$//; |
$block =~ s/ *$//; |
170 |
# Special case the name of PRIVATE_USE_AREA. |
# Special case the name of PRIVATE_USE_AREA. |
171 |
$block =~ s/(Private Use)/$1 Area/; |
$block =~ s/(Private Use)/$1 Area/; |
172 |
|
|
173 |
($name = $block) =~ tr/a-z -/A-Z__/; |
(my $name = $block) =~ tr/a-z -/A-Z__/; |
174 |
push @names, $name; |
push @names, $name; |
175 |
$since = (defined $additions{$name} |
my $since = (defined $additions{$name} |
176 |
? "\n * \@since $additions{$name}" : ""); |
? "\n * \@since $additions{$name}" : ""); |
177 |
|
my $extra = ($block =~ /Specials/ ? "'\\uFEFF', " : ""); |
178 |
print <<EOF; |
print <<EOF; |
179 |
|
|
180 |
/** |
/** |
181 |
* $block. |
* $block. |
182 |
* '\\u$start' - '\\u$end'.$since |
* $extra'\\u$start' - '\\u$end'.$since |
183 |
*/ |
*/ |
184 |
public final static UnicodeBlock $name |
public final static UnicodeBlock $name |
185 |
= new UnicodeBlock('\\u$start', '\\u$end', |
= new UnicodeBlock('\\u$start', '\\u$end', |