Skip to content

det translator: conditions with ZERO inside arithmetic, and a relation split after NOT, do not parse #4656

Closed

Description

@squid-protocol

Problem

The randomized differential run of #4287 (random COMPUTE / IF / EVALUATE programs, cobc vs det port) hit three statements the det translator cannot parse, each a hole where GnuCOBOL compiles the statement:

  1. IF (ZERO + 3) / 12 NOT > D0 ... and IF (ZERO / 12) * P0 > S3 ...: "IF condition: not a condition near ')'". Parser._paren_is_condition takes the group for a condition because ZERO is in CLASS_WORDS (det/expr.py).
  2. EVALUATE TRUE WHEN D0 + ZERO > Q3: the WHEN object stays UNPARSED ("EVALUATE WHEN ...").
  3. A relation split after NOT (... NOT at a line end, < X on the next line): "the PROCEDURE DIVISION does not parse at line N" (the whole program).

Each is a refusal, not a wrong result. None is known in a corpus program; (3) is the likeliest to appear in real code.

Proposal

(1)/(2): treat ZERO as a class word only after an operand (X IS ZERO), not inside an arithmetic group; (3): find where the split relation is lost (tree-sitter or stmt.py) and add a case to test_det_translate.py.

Part of #4270.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    legacy-modernization
    priority: low
    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: lowscope:sweep

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions