Re: Making tab-complete.c easier to maintain - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Making tab-complete.c easier to maintain
Date
Msg-id CAEepm=1x-inE_3Hsa07Wp5zDg2puGR1TdJsstgm0=ATXpxur=Q@mail.gmail.com
Whole thread Raw
In response to Re: Making tab-complete.c easier to maintain  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Making tab-complete.c easier to maintain
List pgsql-hackers
On Sun, Dec 13, 2015 at 1:08 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Wed, Dec 9, 2015 at 8:17 PM, Thomas Munro wrote:
>> Thanks for looking at this Michael.  It's probably not much fun to
>> review!  Here is a new version with that bit removed.  More responses
>> inline below.
>
> Could this patch be rebased? There are now conflicts with 8b469bd7 and
> it does not apply cleanly.

New version attached.

I've also add (very) primitive negative pattern support and used it in
5 places.  Improvement?  Examples:

        /* ALTER TABLE xxx RENAME yyy */
-       else if (TailMatches5("ALTER", "TABLE", MatchAny, "RENAME", MatchAny) &&
-                        !TailMatches1("CONSTRAINT|TO"))
+       else if (TailMatches5("ALTER", "TABLE", MatchAny, "RENAME",
"!CONSTRAINT|TO"))
                COMPLETE_WITH_CONST("TO");

        /* If we have CLUSTER <sth>, then add "USING" */
-       else if (TailMatches2("CLUSTER", MatchAny) &&
!TailMatches1("VERBOSE|ON"))
+       else if (TailMatches2("CLUSTER", "!VERBOSE|ON"))
                COMPLETE_WITH_CONST("USING");

--
Thomas Munro
http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Using quicksort for every external sort run
Next
From: Peter Geoghegan
Date:
Subject: Re: Using quicksort for every external sort run