Repository navigation
det: a wide character in a PROCEDURE DIVISION literal is a statement hole, not a refused program (#4272, #4462) - #4588
Merged
Conversation
…hole, not a refused program (#4272, #4462) A UTF-8 em dash (U+2014) in an alphanumeric literal of the PROCEDURE DIVISION refused the whole program before the parser ("national / DBCS text ... is not modelled"). No single-byte code page holds it, so the literal's bytes and length are what the source's transfer to the compiler made of it (a substitute byte, or three UTF-8 bytes), not what COBOL says: the statement holding it (a MOVE, an IF / WHEN condition, an EXEC block) is now a hole by name (gen.WIDE_WHY) and the rest of the program translates; the grammar is handed a stand-in (U+001D, source.narrowed) column for column and the literal never reaches Java. A `*>` comment's wide characters are read. A VALUE, a national / DBCS literal (N / G / NX / U) and a name stay refused whole (#4272). Recorded as oracle_assumptions D4. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6
Contributor
squid-protocol
marked this pull request as ready for review
October 6, 2026 23:22
squid-protocol
added a commit
that referenced
this pull request
Oct 6, 2026
…lice4 Conflict: det/stmt.py's import list -- kept both cut_literal (this branch) and narrowed (#4588). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6
squid-protocol
added a commit
that referenced
this pull request
Oct 6, 2026
…efused by name (#4462 slice 4) (#4590) * det: listing control, code pointers, JSON / XML and SET TO ENTRY holes; cut literals and copybooks refused by name (#4462 slice 4) Ranked by `cics_census.py blockers` (the whole-program refusals "PROCEDURE DIVISION does not parse", "DATA DIVISION does not parse", "paragraph_header does not parse"): - EJECT, SKIP1/2/3 and TITLE literal (listing control, the only statement on their line) are dropped with the comment lines (an EJECT after a paragraph's EXIT; a TITLE before the IDENTIFICATION DIVISION). - USAGE PROCEDURE-POINTER / FUNCTION-POINTER are laid out as POINTER (8 bytes; oracle_assumptions C9 notes IBM's function pointer is 4). - JSON PARSE / GENERATE, XML PARSE / GENERATE (with their exception phrases) and SET p TO ENTRY x are holes by name, so the statements around them translate. - Refused by name: a literal left open at column 72 with text in columns 73-80 and no continuation (a source defect: fixed-form COBOL does not read columns 73-80), and a source with no PROGRAM-ID (a copybook saved as a program). Part of #4462 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6 * det: name the cut-literal refusal "source text past column 72" (#4462 slice 4) The text past column 72 can run beyond column 80 (NexusBank NSTMT-GEN), so the refusal quotes it as text past column 72, not columns 73-80. It also covers NACC, NDEP, NEXS, NMOD-CUST and NSTMT-GEN once their national-text refusal (#4588) is lifted. Part of #4462 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6 --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 7, 2026
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.
Part of #4272 and #4462 (the #4587 blocker ranking's #1 gap:
refused: LayoutError: national / DBCS text (…) is not modelled, 6 non-burned CICS programs, all in one census estate).What
A UTF-8 em dash (U+2014) inside an alphanumeric literal of the PROCEDURE DIVISION (
MOVE '... — ...' TO WS-MSG) refused the whole program before the parser. Now only the statement holding it is a hole, by name; the rest of the program translates.source.unmodelledno longer refuses a character beyond Latin-1 inside a PROCEDURE DIVISION alphanumeric literal (no N / G / NX / U / X prefix), nor in a*>comment (and a*>comment is no longer read as a name by the national-letter check).source.narrowed(called bylayout.parseandstmt.parseafterunmodelled): such a character becomes the stand-in U+001D, column for column; in a comment, a space. U+001D in the source itself is refused by name, like QQ / HX.gen._statement: a statement whose own text / parts hold the stand-in (a MOVE, an IF's or a WHEN's condition, an EXEC block; not its nested statements) isthrow new Hole(...)withWIDE_WHY. The literal never reaches Java.Why a hole, not a translation (oracle_assumptions D4, new)
Enterprise COBOL reads source in a single-byte EBCDIC page and an alphanumeric literal's length is its bytes in that page. No SBCS EBCDIC page and not Latin-1 (the det runtime's record charset) holds U+2014. So the transfer of the source to the compiler decides the literal, not COBOL: one substitute byte (X'3F'), three bytes (X'E28094', binary transfer / GnuCOBOL on UTF-8), or a failed transfer. The bytes and the length (padding / truncation in the receiver) differ, and even column 72 moves (characters vs bytes). The narrower case is refused by name rather than guessed.
Stays refused whole: the character in a VALUE (lays storage out), in a national / DBCS literal (N'…', G'…', NX'…', U'…': national data, #4272), or in a name.
Evidence
Survey of the affected census corpus (det_survey translation only), before (origin/main) vs after;
cics_census.py blockerswith the rest of the census / burned surveys unchanged:*refused: national / DBCS text(only gap, NB)*refused: ExprError: the PROCEDURE DIVISION does not parse(only gap, NB)MOVE/STRINGwide-literal hole (programs touched)No program became whole: of the 7 programs the refusal named, 2 now translate with holes (166 statements / 118 translated; 41 / 38) and 5 now meet their next gap,
the PROCEDURE DIVISION does not parse: their source runs past column 72 (a literal cut at column 72 is left unterminated; confirmed independent of the stand-in by parsing with the wide characters replaced by ASCII). The one-away program's other gap isDFHCOMMAREA: no such item. Follow-ups: code past column 72 (a separate refusal by name, or a stated column limit), then those programs' remaining CICS / Db2 holes.No file of the local mainframe corpora is changed by
narrowed(259 files), so no det-sweep case should move.Checks
tests/cobol_mainframe/test_det_translate.py(importorskip tree_sitter_language_pack; failing first): the hole by name (MOVE, EVALUATE WHEN), still-refused-whole cases (VALUE, N'', G'', a name), a*>comment, the stand-in refused in source.test_det_source_4462.py: the PROCEDURE literal row is nowN'漢字'(still refused).pr_gates.py: 7/7 gates pass (lint, audits, secrets, xray, gauntlet, golden, suite). CI green at first check, det sweep included.🤖 Generated with Claude Code
https://claude.ai/code/session_011wnQoeeAZP4npeyGnDviK6