pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Undesirable entries in typedefs list
Date: Tue, 27 Mar 2018 18:02:47 -0400
Message-ID: <503.1522188167@sss.pgh.pa.us> (raw)
In-Reply-To: <CAA8=A79aEmShju8h8o4ijmYhRaZouznkG3DWUfMNCQQ_Ec65_w@mail.gmail.com>
References: <28690.1521912334@sss.pgh.pa.us>
	<CAA8=A79p+5TXLrOy0UY35fEuGG=_pV7yKJuOZyR=hxnjFKqG0A@mail.gmail.com>
	<CAA8=A79aEmShju8h8o4ijmYhRaZouznkG3DWUfMNCQQ_Ec65_w@mail.gmail.com>

Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
>> pgindent already has a list of blacklisted typedefs (see lines 121 to 123)

Oh, so it does.

> Here's a patch to pgindent which I think will do what you want fairly
> simply, assuming you have identified all the offending tokens.

Hm, this does not work for me (with perl 5.10.1), I get syntax errors like

Not enough arguments for map at src/tools/pgindent/pgindent line 64, near "abs allocfunc iterator other pointer printfunc reference string type )"
  (Might be a runaway multi-line () string starting on line 63)
syntax error at src/tools/pgindent/pgindent line 64, near "abs allocfunc iterator other pointer printfunc reference string type )"
Execution of src/tools/pgindent/pgindent aborted due to compilation errors.

After reading the perlfunc man page I changed

-my %blacklist = map { "$_\n" => 1 }
+my %blacklist = map { +"$_\n" => 1 }

and then it seems to work, but man this is an ugly language :-(

			regards, tom lane




view thread (11+ messages)  latest in thread

Message-ID: <503.1522188167@sss.pgh.pa.us>
Permalink:  ../503.1522188167@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/503.1522188167@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew.dunstan@2ndquadrant.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Undesirable entries in typedefs list
  In-Reply-To: <503.1522188167@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox