Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 409de6b

Browse files
committed
Re-add brace removal code but comment it out so we know why we removed
it and have it in case we need it for some special case.
1 parent 47402a9 commit 409de6b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/tools/pgindent/pgindent

+29
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,35 @@ do
17421742
sed 's;\([^ ]\)\(/\*.*\*/\)$;\1 \2;' |
17431743
# move trailing * in function return type
17441744
sed 's;^\([A-Za-z_][^ ]*\)[ ][ ]*\*$;\1 *;' |
1745+
# remove un-needed braces around single statements
1746+
# Do not use because it uglifies PG_TRY/PG_CATCH blocks and probably
1747+
# isn't needed for general use.
1748+
# awk '
1749+
# {
1750+
# line3 = $0;
1751+
# if (skips > 0)
1752+
# skips--;
1753+
# if (line1 ~ " *{$" &&
1754+
# line2 ~ " *[^;{}]*;$" &&
1755+
# line3 ~ " *}$")
1756+
# {
1757+
# print line2;
1758+
# line2 = "";
1759+
# line3 = "";
1760+
# skips = 3;
1761+
# }
1762+
# else
1763+
# if (skips == 0 && NR >= 3)
1764+
# print line1;
1765+
# line1 = line2;
1766+
# line2 = line3;
1767+
# }
1768+
# END {
1769+
# if (NR >= 2 && skips <= 1)
1770+
# print line1;
1771+
# if (NR >= 1 && skips <= 2)
1772+
# print line2;
1773+
# }' |
17451774
# remove blank line between opening brace and block comment
17461775
awk '
17471776
{

0 commit comments

Comments
 (0)