Repository navigation
COBOL record_data: read a signed (and leading-point) numeric VALUE (#4277) - #4346
Merged
Merged
Conversation
…4277) _VALUE_CLAUSE's bareword could not open with a sign or a decimal point, so `VALUE +0` / `VALUE -1` / `VALUE .25` read no value at all, and `VALUE IS -1.06` backtracked to read the keyword `IS` as the value. A sign (or point) now opens the bareword when a digit follows; `VALUE - 1` and a quoted '-' are unchanged. Golden masters regenerated in both legs: 205 record_data VALUEs gained in 57 files, 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 #4277
What was broken
mainframe_boundary._VALUE_CLAUSE's bareword alternative had to start with a letter or digit, so three shapes went wrong:VALUE +0andVALUE -1read no value. GenApplgicdb01.cbl:35(01 WS-ABSTIME PIC S9(8) COMP VALUE +0.) is one example; the COBOL: engine-to-translator fact cross-check as a CI gate (and who owns each fact) #4273 cross-check found 132 items like it.VALUE .25, was lost the same way.VALUE IS -1.06was worse: the optionalISlet the regex backtrack, so it read the keywordISas the value (NIST NC1344.2D-2/D-4/D-5).The fix
The bareword may now open with a sign and/or a decimal point when a digit follows:
(?:[+-](?=\.?[0-9]))?(?:\.(?=[0-9]))?. These are unchanged:'-';VALUE - 1(sign separated from the digits);Evidence
lgicdb01.cbl:35WS-ABSTIME: valueNone→+0.tests/cobol_mainframe/test_signed_value_4277.py. The first fails on main. It covers+0,-1,VALUE IS -12.5,+.5, and a sign on the next line. The second test pins the non-cases.Golden-master diff (both legs regenerated, identical)
Noneand now read a signed literal:+0×68,-4×9,+10×8,-8.32×7, …Noneand now read a leading-point literal: NIST.25,.01,.19,.1.ISand now read the real literal: NC1344-1.06,+10.1,-1.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,963).Local checks
mypy_audit --ci,ruff_audit --ci(0.16.0),dead_key_audit --ci: nothing new.🤖 Generated with Claude Code