Skip to content

cobol func_start regex doesn't exclude LOCAL-STORAGE from paragraph/section capture #1890

Closed

Description

@squid-protocol

Description

Found investigating tri-comparison ledger shape cobol/function/existence/agree[gitgalaxy]_vs[ctags] (verified via tri-comparison-ledger-sweep, Gemini-dispatched read-only investigation, cross-checked directly against source).

gitgalaxy/standards/language_standards.py's cobol func_start regex bans several Data Division section headers from being captured as paragraphs/sections via a negative-lookahead reserved-word list — WORKING-STORAGE and LINKAGE are both explicitly banned — but LOCAL-STORAGE is missing from that list, so LOCAL-STORAGE SECTION. headers slip through and get miscounted as executable-logic paragraphs.

Steps to Reproduce

language-crucible/data/cobol/cics-banking-sample-application-cbsa/XFRFUN.cbl:107:

       LOCAL-STORAGE SECTION.
       01 SYSIDERR-RETRY                PIC 999.

This is a Data Division structural header (declares data items, no executable logic) — same role as WORKING-STORAGE SECTION., which the regex already correctly bans. GitGalaxy's func_start regex reports a function named LOCAL-STORAGE at line 105 for this file; it should report nothing here, same as it correctly does for WORKING-STORAGE.

Suggested fix

Add LOCAL-STORAGE to the reserved-word negative lookahead in the cobol func_start regex (gitgalaxy/standards/language_standards.py, alongside WORKING-STORAGE|...|LINKAGE|...).

Evidence

Full discrepancy record in docs/self_scan/tri_comparison_ledger.json, shape cobol/function/existence/agree[gitgalaxy]_vs[ctags] (one of 18 occurrences; the rest of the shape is a separate, unrelated ctags_reader.py test-harness gap, tracked separately).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginelegacy-modernizationtesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions