pgsql: ecpg: clean up documentation of parse.pl, and add more input che

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: ecpg: clean up documentation of parse.pl, and add more input che
Date: 2024-10-14 17:55:19
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

ecpg: clean up documentation of parse.pl, and add more input checking.

README.parser is the user's manual, such as it is, for parse.pl.
It's rather poorly written if you ask me; so try to improve it.
(More could be written here, but this at least covers the same
info in a more organized fashion.)

Also, the single solitary line of usage info in parse.pl itself
was a lie. Replace.

Add some error checks that the ecpg.addons entries meet the syntax
rules set forth in README.parser. One of them didn't, but
accidentally worked anyway because the logic in include_addon is
such that 'block' is the default behavior.

Also add a cross-check that each ecpg.addons entry is matched exactly
once in the backend grammar. This exposed that there are two dead
entries there --- they are dead because the %replace_types table in
parse.pl causes their nonterminals to be ignored altogether.
Removing them doesn't change the generated preproc.y file.

(This implies that check_rules.pl is completely worthless and should
be nuked: it adds build cycles and maintenance effort while failing
to reliably accomplish its one job of detecting dead rules. I'll
do that separately.)

Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/00b0e7204d530d878b188254b62008651030921a

Modified Files
--------------
src/interfaces/ecpg/preproc/README.parser | 119 +++++++++++++++++++-----------
src/interfaces/ecpg/preproc/ecpg.addons | 11 +--
src/interfaces/ecpg/preproc/parse.pl | 58 +++++++++++----
3 files changed, 123 insertions(+), 65 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2024-10-14 19:15:09 pgsql: Move ICU-specific code from pg_locale.c into pg_locale_icu.c.
Previous Message Masahiko Sawada 2024-10-14 16:53:44 pgsql: Remove obsolete comment in reorderbuffer.h.