Formatting of variadic functions and struct literals with named fields
used to be ugly due to pg_bsd_indent treating period as always being a
binary operator. After a comma, it's not that, so insert a space.
Bump pg_bsd_indent's version so that people who use out-of-tree
copies will know they need to update. (This also covers the other
pg_bsd_indent behavioral change introduced in
a3e6beba6.)
Author: Andreas Karlsson <andreas@proxel.se>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/
c3327be8-09e2-46a1-88b4-
228a339d6916@proxel.se
#include "indent_globs.h"
#include "indent.h"
-#define INDENT_VERSION "2.1.2"
+#define INDENT_VERSION "2.1.3"
/* profile types */
#define PRO_SPECIAL 1 /* special case */
case period: /* treat a period kind of like a binary
* operation */
+ if (ps.want_blank && ps.last_token == comma)
+ *e_code++ = ' ';
*e_code++ = '.'; /* move the period into line */
ps.want_blank = false; /* don't put a blank after a period */
break;
static
_attribute_printf(1, 2)
void
-print_error(const char *fmt,...)
+print_error(const char *fmt, ...)
{
}
int b;
struct y c = (struct y *)&a;
}
+
+static struct foo f = { .a = 1,.b=2 };
int b;
struct y c = (struct y *)&a;
}
+
+static struct foo f = {.a = 1, .b = 2};
END { unlink $bak_to_cleanup if defined $bak_to_cleanup; }
# Update for pg_bsd_indent version
-my $INDENT_VERSION = "2.1.2";
+my $INDENT_VERSION = "2.1.3";
# Our standard indent settings
my $indent_opts =