Skip to content

det translator: NOT at the end of a line before its relational operator fails the whole PROCEDURE DIVISION #4674

Closed

Description

@squid-protocol

Problem

A relational operator after NOT on the next source line makes the det translator reject the whole PROCEDURE DIVISION (ExprError: the PROCEDURE DIVISION does not parse at line N), so the program gets no port at all. GnuCOBOL (-std=ibm) compiles it.

Minimal repro (found by the #4655 randomized differential run; #4287's run hit the same, seeds 89/91/97):

       PROCEDURE DIVISION.
           IF S3 NOT
               < 3 + B0 * - D0
               DISPLAY 'Y'
           END-IF

IF S3 NOT < 3 on one line, or the break after < 3, translate fine. E.parse_condition accepts the joined text, so the break is lost in statement splitting (det/stmt.py / source.py), not in the expression parser.

Proposal

Find where a line ending in NOT is cut off from its operator (likely the verb/statement-boundary scan) and keep NOT + relational operator together across a line break; add the repro as a test.

Part of #4270.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    legacy-modernization
    on Oct 8, 2026
  2. added
    scope:sweep
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-modernizationpriority: mediumscope:sweep

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions