Repository navigation
COBOL: a paragraph named END-... is a unit; only reserved END- words are terminators (#4031) - #4069
Merged
Merged
Conversation
…ND- words are terminators The engine's COBOL func_start shield excluded every `END-...` word as a scope terminator, so a legal paragraph named END-... was never a unit. It now excludes only the reserved END- words -- the list #4028 gave the graveyard finder (COBOL 2014 / IBM Enterprise COBOL / GnuCOBOL). Golden masters re-blessed (both modes), because galaxyscope's output changes on real code: the NIST CCVS85 suite in language-crucible names ~600 paragraphs END-ROUTINE / END-ROUTINE-1 / END-RTN-EXIT / ... (`PERFORM END-ROUTINE THRU END-ROUTINE-13`) that the engine missed; COBOL units and archetype counts rise, and every file's map coordinates move slightly with the totals. cics-genapp's END-PROGRAM is a unit in 5 programs (ground-truth ledger: units tp 157 -> 162, the 5 #4031 rows ratcheted away, the fixed cause removed). Three of those END-PROGRAMs are reached only by fall-through, so the engine's unreferenced-by-name census flags them -- assigned to the existing deliberate cause (#2806: usage_status is a name census, not reachability). Tests: END-PROGRAM / END-IPROC1 / End-Program are units, END-IF / END-PERFORM / END-EXEC are not; the carried-forward `END-TargetFunc.` invalid case was the old behaviour and is now a valid one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
Contributor
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.
Closes #4031.
The engine's COBOL
func_startshield excluded everyEND-...word as a scope terminator, so a legal paragraph namedEND-...was never a unit. It now excludes only the reserved END- words, using the list #4028 gave the graveyard finder (COBOL 2014, IBM Enterprise COBOL, GnuCOBOL).Why galaxyscope's output changes (golden masters re-blessed, both modes)
END-ROUTINE,END-ROUTINE-1,END-RTN-EXITand so on are real (PERFORM END-ROUTINE THRU END-ROUTINE-13) and were missed. COBOL unit, archetype and composition counts rise. Every file's map coordinates move slightly with the totals, which accounts for most of the 3,345 changed values.END-PROGRAMis now a unit in the 5 programs the issue names. In the ground-truth ledger, units tp goes from 157 to 162, the 5#4031rows are ratcheted away, and the fixed cause is removed.END-PROGRAMis reached only by fall-through. The engine's unreferenced-by-name census therefore flags them, and they are assigned to the existing deliberate causeengine_dead_is_unreferenced_by_name(orphaned_logic reports 100% dead code for five languages whose invocation model never names the callee — the family #2727 closed without covering #2806:usage_statusis a name census, not reachability). The 2 programs that name it (PERFORM/GO TO) are correctly not flagged.Tests:
END-PROGRAM,END-IPROC1andEnd-Programare units, whileEND-IF,END-PERFORMandEND-EXECare not. The carried-forward invalid caseEND-TargetFunc.encoded the old behaviour and is now a valid one.The full
tests/tree passes with language-crucible v1.6.0 and the mainframe corpora present (13,247 passed).audit_checkis clear.🤖 Generated with Claude Code
https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ