From e648c05d244406114451d78e0399461abc013775 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Wed, 8 Jul 2026 12:44:02 +0200 Subject: [PATCH] Match one-line MEOS-C definitions when attaching @csqlfn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `_FNDEF` located the MEOS-C definition following a `@csqlfn` doxygen block only when the return type was on its own line (`bool\nname(`). A one-line definition (`bool tpcbox_eq(const TPCBox *box1, ...)`, the pointcloud predicate style) was not matched, so the tag attached to the next matchable definition instead — collapsing several wrappers onto one MEOS function and leaving the skipped functions with no SQL name. Allow an optional same-line return-type prefix before the name. Regenerating the catalog restores the SQL name of ten functions that were previously dropped from every binding (the `tpcbox_eq..ge` comparison operators, the `hasX/hasZ/hasT` accessors and `pcpatch_get_pcid`) with no other change. --- parser/sqlfn.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/parser/sqlfn.py b/parser/sqlfn.py index 0c0fcf1..df7966f 100644 --- a/parser/sqlfn.py +++ b/parser/sqlfn.py @@ -25,9 +25,15 @@ _CSQLFN = re.compile(r"@csqlfn\b") _CSQLFN_REF = re.compile(r"#(\w+)\s*\(\)") _CSQLFN_END = re.compile(r"@\w|\*/") -# After the doxygen close, the MEOS-C definition: an optional return-type line -# (no parens/braces/;/=), then `name(`. -_FNDEF = re.compile(r"\*/\s*\n(?:[^\n(){};=]+\n)?(\w+)\s*\(") +# After the doxygen close, the MEOS-C definition. The return type may sit on its +# own line (`bool\nleft_tpcbox_tpcbox(`) OR on the same line as the name +# (`bool tpcbox_eq(const TPCBox *box1, ...)`, the one-line predicate style). Match +# both: an optional return-type line, then an optional same-line type prefix +# (word/space/`*` only), then `name(`. Without the same-line case a one-line def is +# not matched and its @csqlfn silently attaches to the NEXT matchable definition, +# collapsing several wrappers onto one MEOS function (the tpcbox_eq..ge comparison +# operators lost their SQL name that way). +_FNDEF = re.compile(r"\*/\s*\n(?:[^\n(){};=]+\n)?(?:[\w\s*]+?\s)?(\w+)\s*\(") _SQLFN = re.compile(r"@sqlfn\s+(\w+)\s*\(\)") _SQLOP = re.compile(r"@sqlop\s+@p\s+(\S+)") _DATUM = re.compile(r"Datum\s+(\w+)\s*\(\s*PG_FUNCTION_ARGS")