Repository navigation
COBOL record_data: keep the OCCURS DEPENDING ON object's qualifiers (#4282; pins #4281) - #4348
Merged
Merged
Conversation
…4282) _DEPENDING_CLAUSE read one name, so `DEPENDING ON BETA OF ALPHA` was recorded as `BETA`, which can name a different item. The object is now read with its OF / IN qualifiers (a line break included), upper-cased and single-spaced -- the det translator's spelling. Also pins #4281 (REDEFINES target on the next line), already fixed on main by #4300. Golden masters regenerated in both legs: 8 Occurs Depending On values gain their qualifier, nothing else moved. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
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.
Fixes #4282
Fixes #4281
What was broken
mainframe_boundary._DEPENDING_CLAUSEread a single name, soOCCURS 1 TO 9 DEPENDING ON BETA OF ALPHAwas recorded withoccurs_depending_on = "BETA". The qualifier was lost, and a bareBETAcan name a different item.COTRTUPC.cbl:115-116) does not reproduce on main. COBOL engine: a cols 1-6 sequence number is read as the operand when PERFORM / GO TO / CALL / COPY continues on the next line #4300 fixed it: the target used to read the next line's sequence number011600, which no name pattern matches, soredefineswasNone. On main it readsWS-EDIT-DATE-X, confirmed on the corpus file before and after COBOL: blank the numbered sequence area so split operands read the real target (#4300) #4334. This PR only adds a regression test for it.The fix
The DEPENDING ON object is read with up to 15
OF/INqualifiers, line breaks included. It is upper-cased and whitespace is collapsed to one space (BETA OF ALPHA), matching the det translator's spelling.INis kept as written. A followingINDEXED BYdoes not match, becauseINmust be a whole word. The galaxy_ir consumers only test whether the value is set, so they are unaffected.Evidence
New tests in
tests/cobol_mainframe/test_odo_qualifier_4282.py:OF, lowercasein, a qualifier split over two lines, and a chainX OF Y IN Z. This test fails on main.DEPENDING ON BETA INDEXED BY IX, both unchanged.Golden-master diff (both legs regenerated, identical)
Record Layout only. 8 items gain their qualifier, and nothing else moves:
CSUTLDTC.cbl:VSTRING-LENGTH→VSTRING-LENGTH OF WS-DATE-TO-TEST/… OF WS-DATE-FORMATCRECUST.cbl:VSTRING-LENGTH→… OF CHRDATE/… OF PICSTRCOPYR001(.padded).CBL:B→B OF AEXR001(.padded).CBL:BETA→BETA OF ALPHAThe CSUTLDTC and CRECUST cases show why this matters: two different
VSTRING-LENGTHitems, previously indistinguishable.pytest -m golden_cruciblepasses in both venvs.Ground-truth ledger
ground_truth_ledger.py checkis clean.tests/cobol_mainframeandtests/extractionpass with the pinned corpora (10,966).Local checks
mypy_audit --ci,ruff_audit --ci(0.16.0) anddead_key_audit --cireport nothing new.🤖 Generated with Claude Code