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
cobol func_start: Area-B continuation lines ending in a period become paragraphs (follow-up to #2538's deferred fixed/free-format anchor) #3197
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginelegacy-modernizationCOBOL refractor, dead-code extraction, and JCL forging
Found by the #3120 differential (old refraction parsers vs. the engine DB) on two real CICS/batch corpora. Follow-up to #2538, which fixed the CEE3DMP. shape narrowly and deliberately deferred the structural fix ("a real structural fix needs file-level fixed/free-format detection", cobol.py func_start comment at the CEE3DMP|CEEMOUT|CEEDUMP shield).
What the real corpora show
cobol func_start accepts any lone NAME. whose indentation is in Area B, so the last line of a multi-line statement becomes a paragraph:
corpus
phantom units
examples
IBM/zopeneditor-sample 8f98353
9 across 5 programs
CURRENT-SECOND. closing a multi-line DISPLAY (SAM1.cbl:232, :258); REPORT-FILE. closing OPEN INPUT … OUTPUT … (SAM1.cbl:360); TRAN-MSG. / SAM2-PARMS. closing PROCEDURE DIVISION USING … (SAM2.cbl:55)
REQUIRED-SORT-CODE.; data-division continuations NUMBER-OF-ACCOUNTS. closing OCCURS 1 TO 20 DEPENDING ON (DELACCZ.cpy:14) and PROC-TRAN-EYE-CATCHER. closing REDEFINES (PROCTRAN.cpy:11)
Knock-on effects:
A phantom splits the real paragraph's span, so its loc is wrong (SAM1 000-MAIN reads 15 lines instead of 44).
4 CBSA data copybooks get "paragraphs", so a copybook looks like a procedure copybook.
Two phantoms are flagged usage_status = 1 (SAM2-PARMS, DBCRFUN's COMM-ACT-BAL).
Why it's worth revisiting now
#2538 kept the tolerance for free-format source. But neither corpus contains a free-format paragraph header, and these 39 phantoms are the only false paragraphs the differential found on the two corpora. Every phantom sits in columns 12+ of a file that is otherwise consistently fixed-format (sequence area plus Area-A paragraph names). The file-level fixed/free-format detection #2538 deferred would let fixed-format files anchor paragraph names to Area A (cols 8–11) while free-format files keep today's behaviour.
Evidence and the harness: docs/refraction_engine_differential.md and tests/tools/refraction_differential.py (PR for #3120). Needs the usual strict-suite / crucible / keyword-rosetta (b.cpy plants) verification.
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginelegacy-modernizationCOBOL refractor, dead-code extraction, and JCL forging
Activity
feat(#3120): refraction pipeline reads the engine master DB (opt-in I…
Fix #4264: fixed / free COBOL reference format, per file and per dire…