diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2018-05-09 10:14:46 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2018-05-09 10:14:46 -0400 |
commit | 35361ee78890ce5b559a710c8fa2fdfa843eb280 (patch) | |
tree | 22a5a33c4e327f6260f85e1bf36f54759da7f2be /src/backend/utils/mb/Unicode/convutils.pm | |
parent | 286bb240e1c8e279efa2d805c7f700abfb771925 (diff) |
Restrict vertical tightness to parentheses in Perl code
The vertical tightness settings collapse vertical whitespace between
opening and closing brackets (parentheses, square brakets and braces).
This can make data structures in particular harder to read, and is not
very consistent with our style in non-Perl code. This patch restricts
that setting to parentheses only, and reformats all the perl code
accordingly. Not applying this to parentheses has some unfortunate
effects, so the consensus is to keep the setting for parentheses and not
for the others.
The diff for this patch does highlight some places where structures
should have trailing commas. They can be added manually, as there is no
automatic tool to do so.
Discussion: https://postgr.es/m/a2f2b87c-56be-c070-bfc0-36288b4b41c1@2ndQuadrant.com
Diffstat (limited to 'src/backend/utils/mb/Unicode/convutils.pm')
-rw-r--r-- | src/backend/utils/mb/Unicode/convutils.pm | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/backend/utils/mb/Unicode/convutils.pm b/src/backend/utils/mb/Unicode/convutils.pm index 03151faf4bc..69ec099f29e 100644 --- a/src/backend/utils/mb/Unicode/convutils.pm +++ b/src/backend/utils/mb/Unicode/convutils.pm @@ -18,7 +18,8 @@ use constant { NONE => 0, TO_UNICODE => 1, FROM_UNICODE => 2, - BOTH => 3 }; + BOTH => 3 +}; ####################################################################### # read_source - common routine to read source file @@ -56,7 +57,8 @@ sub read_source comment => $4, direction => BOTH, f => $fname, - l => $. }; + l => $. + }; # Ignore pure ASCII mappings. PostgreSQL character conversion code # never even passes these to the conversion code. @@ -370,9 +372,11 @@ sub print_radix_table } unshift @segments, - { header => "Dummy map, for invalid values", + { + header => "Dummy map, for invalid values", min_idx => 0, - max_idx => $widest_range }; + max_idx => $widest_range + }; ### ### Eliminate overlapping zeros @@ -655,12 +659,14 @@ sub build_segments_recurse if ($level == $depth) { push @segments, - { header => $header . ", leaf: ${path}xx", + { + header => $header . ", leaf: ${path}xx", label => $label, level => $level, depth => $depth, path => $path, - values => $map }; + values => $map + }; } else { @@ -678,12 +684,14 @@ sub build_segments_recurse } push @segments, - { header => $header . ", byte #$level: ${path}xx", + { + header => $header . ", byte #$level: ${path}xx", label => $label, level => $level, depth => $depth, path => $path, - values => \%children }; + values => \%children + }; } return @segments; } @@ -776,7 +784,8 @@ sub make_charmap_combined code => $c->{code}, comment => $c->{comment}, f => $c->{f}, - l => $c->{l} }; + l => $c->{l} + }; push @combined, $entry; } } |