diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-05-22 13:04:48 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-05-22 13:04:48 -0400 |
| commit | 8255c7a5eeba8f1a38b7a431c04909bde4f5e67d (patch) | |
| tree | 50b5b32eaf388701b2714244a10fb23f8d4a2c7c /src/tools | |
| parent | be76af171cdb3e7465c4ef234af403f97ad79b7b (diff) | |
Phase 2 pgindent run for v12.
Switch to 2.1 version of pg_bsd_indent. This formats
multiline function declarations "correctly", that is with
additional lines of parameter declarations indented to match
where the first line's left parenthesis is.
Discussion: https://postgr.es/m/CAEepm=0P3FeTXRcU5B2W3jv3PgRVZ-kGUXLGfd42FFhUROO3ug@mail.gmail.com
Diffstat (limited to 'src/tools')
| -rwxr-xr-x | src/tools/pgindent/pgindent | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent index 2d81672e158..d726a69a5ef 100755 --- a/src/tools/pgindent/pgindent +++ b/src/tools/pgindent/pgindent @@ -12,7 +12,7 @@ use IO::Handle; use Getopt::Long; # Update for pg_bsd_indent version -my $INDENT_VERSION = "2.0"; +my $INDENT_VERSION = "2.1"; # Our standard indent settings my $indent_opts = @@ -250,22 +250,6 @@ sub post_indent # Use a single space before '*' in function return types $source =~ s!^([A-Za-z_]\S*)[ \t]+\*$!$1 *!gm; - # Move prototype names to the same line as return type. Useful - # for ctags. Indent should do this, but it does not. It formats - # prototypes just like real functions. - - my $ident = qr/[a-zA-Z_][a-zA-Z_0-9]*/; - my $comment = qr!/\*.*\*/!; - - $source =~ s! - (\n$ident[^(\n]*)\n # e.g. static void - ( - $ident\(\n? # func_name( - (.*,([ \t]*$comment)?\n)* # args b4 final ln - .*\);([ \t]*$comment)?$ # final line - ) - !$1 . (substr($1,-1,1) eq '*' ? '' : ' ') . $2!gmxe; - return $source; } |
