Skip to content

COBOL engine: a paragraph named END-... is not a unit (function-start rule excludes every END- word) #4031

Description

@squid-protocol

Found while fixing #4026 (PR #4028). The COBOL function-start rule in gitgalaxy/standards/language_standards/languages/cobol.py (~line 272) excludes every word matching END-[A-Z...]+ as a scope terminator. A paragraph whose name starts with END- is legal, so it is not a unit to the engine.

Evidence (pinned corpus)

cics-genapp has a real paragraph End-Program. in Area A, reached by fall-through from MAINLINE and by PERFORM END-PROGRAM, in 5 programs:

program line
base/src/lgipdb01.cbl 312
base/src/lgucdb01.cbl 142
base/src/lgucus01.cbl 119
base/src/lgupdb01.cbl 215
base/src/lgupol01.cbl 146

#4028 fixes the same rule in cobol_graveyard_finder (the forge) and in the answer-key reader, and corrects the GENAPP key. The ground-truth ledger then shows the engine missing these 5 units (engine | units | … | END-PROGRAM | fn); #4028 ledgers them against this issue.

opensourcecobol4j jp-compat 029–033 (END-IPROC1., END-OPROC1.) has the same shape.

Fix

Exclude only the reserved END- scope terminators (END-IF, END-PERFORM, END-EVALUATE, END-READ, END-EXEC, … the full reserved list, as #4028 does for the finder), not every END- name. This changes galaxyscope's output on these files, so it needs a golden-master re-bless (crucible_check.py --update) with the moves explained, and then ground_truth_ledger.py update to ratchet the 5 rows away.

🤖 Generated with Claude Code

Activity

  1. added
    bugUnintended behavior or logic failure in the engine
    legacy-modernizationCOBOL refractor, dead-code extraction, and JCL forging
    on Sep 30, 2026
  2. added 3 commits that reference this issue on Sep 30, 2026
  3. added a commit that references this issue on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginelegacy-modernizationCOBOL refractor, dead-code extraction, and JCL forging

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions