Skip to content

det: NOT split from its operator by a line break, whole input class (Fixes #4682) - #4872

Merged
squid-protocol merged 1 commit into
mainfrom
fix/4682-not-linebreak
Oct 11, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/4682-not-linebreak

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes #4682

The issue's exact shape (IF D0 NOT / < 3) already translates on main (#4674's _join_not_breaks); it is pinned now. The rest of the input class did not, and each refused the whole PROCEDURE DIVISION ("does not parse at line N") although cobc -std=ibm compiles them:

  • NOT at a line end before a word operator: NOT / LESS THAN, AND NOT / EQUAL TO, AND NOT / GREATER / THAN
  • NOT <=, NOT >=, NOT LESS|GREATER [THAN] OR EQUAL [TO] (also one-line), NOT IS LESS THAN
  • an omitted-subject relation after AND / OR at a line end (AND / > 5, OR / EQUAL TO 5, AND GREATER OR EQUAL)

Fix (det/stmt.py): _join_not_breaks takes NOT and its whole operator as one phrase (literals skipped), spells the forms the grammar refuses as the relation they are (NOT <= is >, NOT GREATER OR EQUAL is LESS THAN, ...), and moves the line break after it; the line count is unchanged, so every statement keeps its line.

Tests: test_det_translate.py (matrix of every operator form x a break at every word boundary, class/sign conditions, abbreviated combined conditions, EVALUATE WHEN, PERFORM UNTIL, literal untouched; asserts the relation's shape and statement lines); test_det_conditions.py runs a break-laden program against GnuCOBOL (bytes and typed modes, E2E-gated; passed locally).

Not covered (separate): a fixed-format inline *> comment inside a condition (IF D0 < 3 *> hi) is a hole on main with or without NOT.

Gates: pr_gates --fast 5/5, --ratchets 7/7 (0 skipped). det_port.py check: 104/104 ports unchanged, so no moved ports.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX

…y, before every operator form (Fixes #4682)

The issue's exact shape (IF D0 NOT / < 3) already translated on main after #4674; the rest of the class did not: NOT before a word operator on the next line (NOT / LESS THAN, AND NOT / EQUAL TO), NOT <=, NOT >=, NOT LESS|GREATER [THAN] OR EQUAL [TO], NOT IS LESS, and an omitted-subject relation after an AND / OR at a line end (AND / > 5, AND GREATER OR EQUAL) all refused the whole PROCEDURE DIVISION. cobc -std=ibm compiles them all. _join_not_breaks now takes NOT and its whole operator as one phrase, spells the forms the grammar refuses as the relation they are, and moves the break after it (same line count). det_port.py check: 104/104 ports unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AUWeQX7v4QBdErFbghEEEX
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: medium labels Oct 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 11, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 11, 2026 03:04
@squid-protocol
squid-protocol enabled auto-merge (squash) October 11, 2026 03:04
@squid-protocol
squid-protocol merged commit b6faf2c into main Oct 11, 2026
42 checks passed
@squid-protocol
squid-protocol deleted the fix/4682-not-linebreak branch October 11, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: medium shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

det: a relation's NOT at the end of a line, its operator on the next, crashes the PROCEDURE DIVISION parse

1 participant