Thomas Munro <thomas.munro@enterprisedb.com> writes: > See attached a proof-of-concept patch. It reduces the size of > tab-complete.c by a bit over a thousand lines. I realise that changing so > many lines just to refactor code may may be a difficult sell! But I think > this would make it easier to improve the tab completion code in future, and > although it's large it's a superficial and mechanical change.
I really dislike the magical "<" business. Maybe you could use NULL instead of having to reserve a class of real strings as placeholders.
Thanks, good point. Here's a version that uses NULL via a macro ANY. Aside from a few corrections it also now distinguishes between TAIL_MATCHESn (common) and MATCHESn (rarely used for now), for example:
/* ALTER TABLE,INDEX,MATERIALIZED VIEW xxx ALL IN TABLESPACE xxx */