Repository navigation
det parse: abbreviated 'OR NOT = x' relation; pin conditions holes 1-2 (#4681) - #4683
Merged
Merged
Conversation
…SVS does (#4287) The det translator replays cobc -std=ibm's compile-time ARITHMETIC-OSVS decision (det/osvs.py, from GnuCOBOL 3.1.2 typeck.c / tree.c): dmax from receivers and cb_walk_cond, the expr_decp stack with its pushes, pending aligns flushed on the next load, constant folding, conditions built right to left, the state an EVALUATE leaves to its sentence. It emits Cobol.align (libcob's cob_decimal_align, its downward shift included) where cobc emits cob_decimal_align, and a literal on the right of an operation as a Cobol.Dc (libcob's decimal constant, whose scale its uses change). Cobol.divide keeps cob_decimal_div's places and Cobol.power cob_decimal_pow's trimming. Register C2 rewritten: the det runtime matches the oracle; the oracle's departures from IBM's rule are listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The oracle (GnuCOBOL 3.1.2 -std=ibm) leaves every receiver unchanged on a zero divisor, with or without ON SIZE ERROR; the det port threw ArithmeticException. Cobol.divide now returns libcob's NaN (scale -32768) and raises the statement's size error; add/subtract/multiply/negate/power carry it where the translator sees a division or exponent below; store/storeChecked leave the receiver (lifted receivers guarded with isNan); Cobol.align truncates a NaN to 0 as libcob does. A division in a function argument is 0 (cob_intr_binop); FUNCTION MOD/REM by zero are 0. 0 ** 0 raises the size error; a non-finite exponent is NaN. Statements with ON SIZE ERROR clear and read the size-error state. DIVIDE REMAINDER now uses the quotient truncated to the receiver's places (cob_div_quotient), not the stored quotient. Register entry oracle_assumptions C14 (IBM: undefined / S0CB on z/OS). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…4655) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
expr imported det.cics (for DFHRESP) and det.cvda lazily, and det.cics imported det.gen, which imports det.osvs, which imports expr. expr now imports DFHRESP from gitgalaxy.standards.cics.resp (its home) and CVDA from det.cvda (no imports) at module level, so expr no longer reaches gen. Also one import form for test_det_programs in test_det_osvs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
# Conflicts: # gitgalaxy/tools/cobol_to_java/det/expr.py
…CodeQL) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
Conflicts in oracle_assumptions.md, Cobol.java and gen.py came from #4654's pre-squash commits: main's side taken, then this PR's own changes (6e1de82..f6da8e4) re-applied on top. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
…n-holes stmt.py: main's _join_not_breaks (#4680) runs first, then this PR's abbreviated AND/OR NOT = rewrite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
oracle_assumptions.md: both register entries kept, C13 (#4668) then C14 (this PR), in the table and the sections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
…/4681-condition-holes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
squid-protocol
marked this pull request as ready for review
October 8, 2026 21:14
squid-protocol
added a commit
that referenced
this pull request
Oct 8, 2026
…merged) The conflicts were #4677's pre-squash commits against its squash (identical trees): this branch's side kept; #4683's stmt.py / test_det_conditions.py merged as main has them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MQNoe4wPJgr7dbUvs3DG6D
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 #4681
stacked on #4677 (-> #4654) -- merge those first
... OR NOT = 'C'/... AND NOT = 'C'(it takesNOT <,NOT >,NOT EQUAL), which refused the whole PROCEDURE DIVISION.det/stmt.pynow spells that abbreviated formNOT EQUALbefore the grammar (string literals untouched); the expression parser already handled it. Note: the rewrite sits beside the existingNOT=->NOT =line instmt.parse; det parser: NOT split from its relational operator across lines; ZERO in condition arithmetic (#4674, #4656) #4680 (_join_not_breaks,_paren_is_condition) touches the same area ofstmt.py/expr.py, so expect a trivial textual conflict at most.D0 + 1 > Q3,S3 NOT < 3 + B0 * - D0): already agree with cobc on this base (det runtime: truncate arithmetic intermediates as cobc's ARITHMETIC-OSVS does (#4287) #4654 OSVS truncation / det runtime: a zero divisor leaves the receivers unchanged, as the oracle (#4655) #4677); no code change, pinned by the end-to-end test.NOT/ operator line split is joined; unjoined they still fail to parse, which is det parser: NOT split from its relational operator across lines; ZERO in condition arithmetic (#4674, #4656) #4680's_join_not_breaks, not this PR.Tests:
tests/cobol_mainframe/test_det_conditions.py(cobc vs port, bytes and typed; hole 3 fails before, holes 1 and 2 pass before and after).det_port.py checkvs #4677: 68/68 ports unchanged. pr_gates --fast 5/5, --ratchets 7/7, evidence_report --check clean.🤖 Generated with Claude Code