Repository navigation
Description
What
PR #1332 fixed func_start's recall gap for objc's -/+-prefixed method alternative (bodyless @interface declarations, e.g. - setupWindow;). The regex's OTHER alternative -- plain C-style prototypes, e.g. extern void write_rtf_header(NXStream* rtfStream); -- was deliberately left on the original brace-only path, since (unlike the method alternative) it has no exclusion shield and can already match a bare two-token statement (return foo(x);); extending bodyless-; support there risked resurrecting that false-positive class.
Consequence: a real C-style prototype like write_rtf_header is currently found ONLY when a { happens to appear later in the search window/next-match boundary -- and when it IS found, the {...} it grabs is unrelated (in the corpus case, an @interface block's own instance-variable list { ... } several lines later), giving the function a completely wrong body span / LOC / structural-impact score. If no such accidental { exists nearby, the declaration is silently dropped instead.
Confirmed via language-crucible/data/objective-c/worldwideweb/HyperText.h line 19: extern void write_rtf_header(NXStream* rtfStream); is GitGalaxy's one remaining extra_functions entry in the current tree-sitter-accuracy baseline for this file -- present only by accident, with a bogus body.
Why not fixed alongside #1332
Properly supporting this alternative needs the same kind of care as #1335's args-extraction gap -- the C-style branch's identifier capture has no exclusion shield against bare call/return statements, so accepting ; as a terminator for it needs either a real Invocation Shield or very careful adversarial testing first, not a drive-by copy of the method-alternative's fix.
Suggested next step
Likely low priority/rare (only 1 instance observed across the whole objc corpus) -- but worth fixing properly since the current behavior is silently WRONG (bogus body/LOC) rather than just missing, which is worse for downstream risk-scoring. Consider whether prototypes even belong in func_start's scope at all (a prototype has no "function body" to score) vs. being explicitly excluded.
Activity
fix(objective-c): recover bodyless C-style prototypes in func_start (#…
fix(perl): shield-corruption and legacy-prototype fixes for tree-sitt…
fix(perl): don't attribute an unrelated later block to a forward decl…
fix(go): extract bodyless function declarations (#1756) (#1760)