mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
Initial pgindent and pgperltidy run for v13.
Includes some manual cleanup of places that pgindent messed up,
most of which weren't per project style anyway.
Notably, it seems some people didn't absorb the style rules of
commit c9d297751
, because there were a bunch of new occurrences
of function calls with a newline just after the left paren, all
with faulty expectations about how the rest of the call would get
indented.
This commit is contained in:
@@ -94,7 +94,8 @@ while (my $line = <$INPUT>)
|
||||
my $nfkc_utf8 = codepoint_string_to_hex($nfkc);
|
||||
my $nfkd_utf8 = codepoint_string_to_hex($nfkd);
|
||||
|
||||
print $OUTPUT "\t{ $linenum, { $source_utf8 }, { { $nfc_utf8 }, { $nfd_utf8 }, { $nfkc_utf8 }, { $nfkd_utf8 } } },\n";
|
||||
print $OUTPUT
|
||||
"\t{ $linenum, { $source_utf8 }, { { $nfc_utf8 }, { $nfd_utf8 }, { $nfkc_utf8 }, { $nfkd_utf8 } } },\n";
|
||||
}
|
||||
|
||||
# Output terminator entry
|
||||
|
@@ -14,39 +14,40 @@ my $codepoint;
|
||||
my $prev_codepoint;
|
||||
my $count = 0;
|
||||
|
||||
print "/* generated by src/common/unicode/generate-unicode_combining_table.pl, do not edit */\n\n";
|
||||
print
|
||||
"/* generated by src/common/unicode/generate-unicode_combining_table.pl, do not edit */\n\n";
|
||||
|
||||
print "static const struct mbinterval combining[] = {\n";
|
||||
|
||||
foreach my $line (<ARGV>)
|
||||
{
|
||||
chomp $line;
|
||||
my @fields = split ';', $line;
|
||||
$codepoint = hex $fields[0];
|
||||
chomp $line;
|
||||
my @fields = split ';', $line;
|
||||
$codepoint = hex $fields[0];
|
||||
|
||||
next if $codepoint > 0xFFFF;
|
||||
next if $codepoint > 0xFFFF;
|
||||
|
||||
if ($fields[2] eq 'Me' || $fields[2] eq 'Mn')
|
||||
{
|
||||
# combining character, save for start of range
|
||||
if (!defined($range_start))
|
||||
{
|
||||
$range_start = $codepoint;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# not a combining character, print out previous range if any
|
||||
if (defined($range_start))
|
||||
{
|
||||
printf "\t{0x%04X, 0x%04X},\n", $range_start, $prev_codepoint;
|
||||
$range_start = undef;
|
||||
}
|
||||
}
|
||||
if ($fields[2] eq 'Me' || $fields[2] eq 'Mn')
|
||||
{
|
||||
# combining character, save for start of range
|
||||
if (!defined($range_start))
|
||||
{
|
||||
$range_start = $codepoint;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# not a combining character, print out previous range if any
|
||||
if (defined($range_start))
|
||||
{
|
||||
printf "\t{0x%04X, 0x%04X},\n", $range_start, $prev_codepoint;
|
||||
$range_start = undef;
|
||||
}
|
||||
}
|
||||
}
|
||||
continue
|
||||
{
|
||||
$prev_codepoint = $codepoint;
|
||||
$prev_codepoint = $codepoint;
|
||||
}
|
||||
|
||||
print "};\n";
|
||||
|
@@ -138,7 +138,7 @@ foreach my $char (@characters)
|
||||
# Decomposition size
|
||||
# Print size of decomposition
|
||||
my $decomp_size = scalar(@decomp_elts);
|
||||
die if $decomp_size > 0x1F; # to not overrun bitmask
|
||||
die if $decomp_size > 0x1F; # to not overrun bitmask
|
||||
|
||||
my $first_decomp = shift @decomp_elts;
|
||||
|
||||
@@ -153,7 +153,7 @@ foreach my $char (@characters)
|
||||
if ($decomp_size == 2)
|
||||
{
|
||||
# Should this be used for recomposition?
|
||||
if ($character_hash{$first_decomp}
|
||||
if ( $character_hash{$first_decomp}
|
||||
&& $character_hash{$first_decomp}->{class} != 0)
|
||||
{
|
||||
$flags .= " | DECOMP_NO_COMPOSE";
|
||||
|
@@ -11,7 +11,8 @@ use warnings;
|
||||
|
||||
my %data;
|
||||
|
||||
print "/* generated by src/common/unicode/generate-unicode_normprops_table.pl, do not edit */\n\n";
|
||||
print
|
||||
"/* generated by src/common/unicode/generate-unicode_normprops_table.pl, do not edit */\n\n";
|
||||
|
||||
print <<EOS;
|
||||
#include "common/unicode_norm.h"
|
||||
@@ -44,7 +45,7 @@ foreach my $line (<ARGV>)
|
||||
$first = $last = $codepoint;
|
||||
}
|
||||
|
||||
foreach my $cp (hex($first)..hex($last))
|
||||
foreach my $cp (hex($first) .. hex($last))
|
||||
{
|
||||
$data{$prop}{$cp} = $value;
|
||||
}
|
||||
@@ -61,9 +62,10 @@ foreach my $prop (sort keys %data)
|
||||
next if $prop eq "NFD_QC" || $prop eq "NFKD_QC";
|
||||
|
||||
print "\n";
|
||||
print "static const pg_unicode_normprops UnicodeNormProps_${prop}[] = {\n";
|
||||
print
|
||||
"static const pg_unicode_normprops UnicodeNormProps_${prop}[] = {\n";
|
||||
|
||||
my %subdata = %{$data{$prop}};
|
||||
my %subdata = %{ $data{$prop} };
|
||||
foreach my $cp (sort { $a <=> $b } keys %subdata)
|
||||
{
|
||||
my $qc;
|
||||
|
Reference in New Issue
Block a user