You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Forge COBOL readers: hyphen word boundaries (END-PERFORM, END-IF, END-CALL) and column-7 comment lines #3420
Found by the mainframe ground-truth ledger while building the CardDemo answer key. The answer key's own reader had the same hyphen bugs; this PR fixes and pins them there. Causes: forge_hyphen_word_boundary and forge_reads_comment_lines.
1. \b matches after a hyphen (cobol_graveyard_finder.py)
_PERFORM = \bPERFORM\s+(NAME) (line 53): with END-PERFORM followed by PERFORM X, \b matches between - and P. That reads as a PERFORM of the word PERFORM and swallows the real call. On CardDemo COTRTLIC, 9450-CLOSE-FORWARD-CURSOR and its -EXIT are PERFORMed from a live paragraph but are reported dead.
_last_sentence counts \bIF\b against \bEND-IF\b, so each END-IF counts as an IF too, and any sentence with a closed IF looks unterminated. A paragraph ending … END-IF … GOBACK. or … PERFORM GET-ME-OUT-OF-HERE. then reads as falling through. On CBSA, DELACC, INQACCCU and UPDCUST's A999 are dead but the forge reports them live. The key had the same bug and missed them too; this PR corrects the CBSA key. EVALUATE / END-EVALUATE has the same problem.
Fix: use (?<![\w-]) instead of \b before the verb, as the key reader now does.
2. cobol_dag_architect.py scans comment lines and hyphenated words
commented-out lines (column-7 *), for example *CALL ASSEMBLER PROGRAM, * CALL MENU PROGRAM, * CALL CARD DETAIL PROGRAM;
END-CALL followed by the next word (IF);
3200-INSERT-IMS-CALL THRU.
That's 12 false dynamic CALLs on CardDemo (ASSEMBLER, MENU, CARD, TO, FAILED, FAIL, IF, THRU).
OPEN modes are read from commented-out SELECT/OPEN lines too. On DBUNLDGS that gives 2 false outputs, OUTFIL1 and OUTFIL2, whose SELECT and OPEN are both commented out.
Acceptance
The matching forge | dead, forge | dynamic CALLs and forge | outputs ledger entries stop reproducing (CardDemo and CBSA), and are ratcheted out with ground_truth_ledger.py update. Add fixtures for each shape.
One more mechanism for this issue, found by the blind cross-check (cross_verify.py): cobol_graveyard_finder._is_terminal / _last_sentence test only a unit's last sentence. In CBSA's BNK1CAC/CCA/CCS/CRA/DAC/DCS/TFN/UAC and BNKMENU, A010 has an unconditional EXEC CICS RETURN TRANSID(...) RESP(...) END-EXEC. sentence followed by an IF <resp not normal> … PERFORM ABEND-THIS-TASK END-IF. recovery sentence. The RETURN already ends the unit, so A999 is dead in all nine. The key's own reader had the same bug; the key is now corrected and those 9 entries are ledgered as forge_last_sentence_only. When fixing it, note the other side of the same code: CardDemo CBSTM03A reaches 8200/8300/8400-*-OPEN only through ALTER 8100-FILE-OPEN TO PROCEED TO …. A reader that stops treating a stray trailing EXIT. as fall-through must count ALTER targets, or it will mark those live paragraphs dead.
Activity
answer key: CardDemo key, verification tiers, seven draft-reader fixes (
squid-protocol commentedon Sep 23, 2026
One more mechanism for this issue, found by the blind cross-check (cross_verify.py):
cobol_graveyard_finder._is_terminal/_last_sentencetest only a unit's last sentence. In CBSA's BNK1CAC/CCA/CCS/CRA/DAC/DCS/TFN/UAC and BNKMENU, A010 has an unconditionalEXEC CICS RETURN TRANSID(...) RESP(...) END-EXEC.sentence followed by anIF <resp not normal> … PERFORM ABEND-THIS-TASK END-IF.recovery sentence. The RETURN already ends the unit, soA999is dead in all nine. The key's own reader had the same bug; the key is now corrected and those 9 entries are ledgered asforge_last_sentence_only. When fixing it, note the other side of the same code: CardDemo CBSTM03A reaches8200/8300/8400-*-OPENonly throughALTER 8100-FILE-OPEN TO PROCEED TO …. A reader that stops treating a stray trailingEXIT.as fall-through must count ALTER targets, or it will mark those live paragraphs dead.answer key: blind cross-verification tool; all three keys cross_verif…
answer key: full blind census of all three corpora (2,339/2,340, no k…
Forge COBOL readers: hyphen word boundaries, any-sentence terminals, …