diff options
author | Karl Williamson <khw@cpan.org> | 2015-05-15 14:21:25 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-09-04 10:21:17 -0600 |
commit | c93ea49efa21178588f8f466fb74da0fb52cdc41 (patch) | |
tree | 018c520491726cf7f1d0d03e55871a96acc9116b /regen | |
parent | be9be6ec157d2e6c3e855cb3d43297e57713f162 (diff) | |
download | perl-c93ea49efa21178588f8f466fb74da0fb52cdc41.tar.gz |
regen/mk_PL_charclass.pl: Refactor a print
This is in preparation for the next commits.
Diffstat (limited to 'regen')
-rw-r--r-- | regen/mk_PL_charclass.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/regen/mk_PL_charclass.pl b/regen/mk_PL_charclass.pl index 86f316206b..ac03715057 100644 --- a/regen/mk_PL_charclass.pl +++ b/regen/mk_PL_charclass.pl @@ -338,10 +338,14 @@ foreach my $charset (get_supported_code_pages()) { $name =~ s/:.*//; } } + my $index = $a2n[$ord]; - $out[$index] = ($ord == $index) - ? sprintf "/* U+%02X %s */ %s,\n", $ord, $name, $bits[$ord] - : sprintf "/* 0x%02X U+%02X %s */ %s,\n", $index, $ord, $name, $bits[$ord]; + $out[$index] = "/* "; + $out[$index] .= sprintf "0x%02X ", $index if $ord != $index; + $out[$index] .= sprintf "U+%02X ", $ord; + $out[$index] .= "$name */ "; + $out[$index] .= $bits[$ord]; + $out[$index] .= ",\n"; } $out[-1] =~ s/,$//; # No trailing comma in the final entry |