Scan pgtypes sources for out-param Doxygen and step over preprocessor guards#75
Merged
estebanzimanyi merged 1 commit intoJul 23, 2026
Conversation
… guards The vendored PostgreSQL base-type layer (json, date/interval, …) lives in the sibling pgtypes/ tree, outside meos/, and its base functions carry their @param[out] tags on the .c definitions there — for example json_array_elements in pgtypes/utils/jsonfuncs.c. Two things kept those out-params out of the catalog: the out-param Doxygen scan globbed only meos/src + meos/include, and the function-definition regex did not step over the #if MEOS guard that separates a base function's doc block from its definition. Scan pgtypes/**/*.c alongside meos/, and skip a run of blank and preprocessor lines before the return-type line. The skip pattern is a line-based subset of doxygroup.py's _SKIP: the multi-line-comment alternative is omitted here because, combined with this module's whole-doc-block match, a DOTALL run inside the skip would backtrack catastrophically (doxygroup runs a bounded two-step search). Add tests/test_outparam.py covering the plain meos/src case, the guarded pgtypes twin, the sibling-tree scan, and the non-const-pointer cross-check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The vendored PostgreSQL base-type layer (json, date/interval, …) lives in the sibling
pgtypes/tree, outsidemeos/, and its base functions carry their@param[out]tags on the.cdefinitions there — for examplejson_array_elementsinpgtypes/utils/jsonfuncs.c. Two things keep those out-params out of the catalog:parser/outparam.pyglobs onlymeos/src+meos/include;#if MEOSguard that separates a base function's doc block from its definition.As a result
shape.outParamsis empty for the whole vendored-base surface, and every binding leaves those out-parameters as visible caller arguments instead of folding them.This scans
pgtypes/**/*.calongsidemeos/, and skips a run of blank and preprocessor lines before the return-type line. The skip pattern is a line-based subset ofdoxygroup.py's_SKIP(which already scans pgtypes for@ingroup): the multi-line-comment alternative is deliberately omitted here because, combined with this module's whole-doc-block match, a DOTALL run inside the skip backtracks catastrophically —doxygroupcan afford it because it runs a bounded two-step search.Adds
tests/test_outparam.pycovering the plainmeos/srccase, the guarded pgtypes twin, the sibling-tree scan, and the non-const-pointer cross-check. Regenerating the catalog now marks e.g.json_array_elements → outParams: ['count']; the meos/src surface is unchanged (the skip matches zero lines when there is no guard).