Skip to content

Commit 47402a9

Browse files
committed
Remove code that delete braces around single statements.
1 parent abc98dc commit 47402a9

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/tools/pgindent/pgindent

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,33 +1742,6 @@ 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-
awk '
1747-
{
1748-
line3 = $0;
1749-
if (skips > 0)
1750-
skips--;
1751-
if (line1 ~ " *{$" &&
1752-
line2 ~ " *[^;{}]*;$" &&
1753-
line3 ~ " *}$")
1754-
{
1755-
print line2;
1756-
line2 = "";
1757-
line3 = "";
1758-
skips = 3;
1759-
}
1760-
else
1761-
if (skips == 0 && NR >= 3)
1762-
print line1;
1763-
line1 = line2;
1764-
line2 = line3;
1765-
}
1766-
END {
1767-
if (NR >= 2 && skips <= 1)
1768-
print line1;
1769-
if (NR >= 1 && skips <= 2)
1770-
print line2;
1771-
}' |
17721745
# remove blank line between opening brace and block comment
17731746
awk '
17741747
{

0 commit comments

Comments
 (0)