Repository navigation
det: read continued apostrophe literals, "" inside literals, PROGRAM-ID without its period (#4523, #4462) - #4526
Merged
Merged
Conversation
…ID without its period (#4523, #4462) The tree-sitter COBOL grammar continues a literal only in quotation marks and splits "IT""S" into two literals. as_fixed_rows now hands it every literal of a re-wrapped line in quotation marks (same value) and each "" as U+001E, which unwrap restores; EXEC block lines keep their own quotes. A doubled quote at column 72 of a re-wrapped row is kept together. logical_lines puts back the period after PROGRAM-ID (estate-crucible LNCALC). Newly translating: CardDemo CBSTM03A, DSF FO04F1X1, estate-crucible RPTHDR and LNCALC. CBSTM03A's cross-check found the engine's group USAGE gap (#4525), ledgered. DECIMAL-POINT IS COMMA stays refused (det_port_design.md says why). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
Contributor
squid-protocol
marked this pull request as ready for review
October 6, 2026 03:12
This was referenced Oct 6, 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.
Closes #4523. Part of #4462 (LNCALC; DECIMAL-POINT IS COMMA was looked at and stays refused).
What changed (
det/source.py)'...at column 72 followed by- '...did not parse.as_fixed_rows(det translator: re-wrap joined continuation lines to fixed form in det/source.as_fixed (recovers most parse failures) #4412) now writes every literal on a re-wrapped line in quotation marks for the grammar. The value is unchanged (''is undoubled), and every reader takes the delimiter from the literal's first character (expr._unquote,layout._one).""inside a quotation-mark literal. The grammar readVALUE "IT""S"as two values (IT,S: silently wrong) and refusedMOVE "IT""S". It reads'IT''S'correctly. Each""is now handed to the grammar as U+001E (source.QQ), andunwrapturns it back into"". A source that already contains U+001E is refused by name (unmodelled).PROGRAM-ID LNCALC.(det translator: 32 programs refused across the keyed corpora and estate-crucible (code pages, free format, multi-program sources, grammar gaps); KYUYJP crashes #4462):logical_linesputs back the missing period, which Enterprise COBOL accepts with a warning.0,5vsA, B), VALUE parsing, edited PICTUREs with.and,swapped, and changes to runtime edited moves and DISPLAY. Its only program, ZINSBER, would still be refused because of its national-letter nameBETRÄGE. The reason is recorded indet_port_design.md.Effect (fact cross-check)
Newly translating: CardDemo CBSTM03A, DSF FO04F1X1, estate-crucible RPTHDR and LNCALC. Their
translator-refuses-*entries leave the ledger (fact_crosscheck.py update). CBSTM03A brings 40 new disagreements, each assigned withassign:value-all-literal(18) andpointer-width(8): existing definitional causes.engine-group-usage-not-inherited(14, engine side, new issue COBOL engine: a group's USAGE (01 X COMP.) is not inherited by its elementary items, so sizes and offsets are wrong #4525):01 COMP-VARIABLES COMP.and01 COMP3-VARIABLES COMP-3.The engine sizes the children as DISPLAY (S9(4) as 4 bytes instead of 2, S9(9)V99 as 11 instead of 6). The translator's sizes are right.Evidence
tests/cobol_mainframe/test_det_translate.py. They cover both quote styles with the continuation in Area B (columns 12 and 20), a doubled quote plus the other quote kind inside a continued literal, a doubled quote at column 72,""in a VALUE and a MOVE, the U+001E refusal, an EXEC SQL line keeping its apostrophes, a hex literal on a wrapped line, and PROGRAM-ID in three forms. The selfscan venv has the translator extra, and 158/158 tests pass with no skips.pr_gates.py: 7/7 pass (lint, audits, secrets, xray, gauntlet, golden, suite). Golden is unchanged, so nothing was re-blessed.pr_gates.py --ratchets: 5/5 pass (ports, estate, fact-crosscheck, completeness, ground-truth), both before and after merging origin/main (det: SEND CONTROL and terminal RECEIVE (INTO/SET/LENGTH/MAXLENGTH/NOTRUNCATE, LENGERR, EOC) (#4413) #4500).git archiveexport of HEAD: no new errors.proof_sweep.py --det-only --skip-db2): "as expected", so the baseline is unchanged.Still open under #4462
DBCS / national text (KYUY), DECIMAL-POINT IS COMMA (ZINSBER, plus its
BETRÄGEname), several programs in one source (PAYMAIN, refused first by its COPY collision), IDMS (LNIDMS01), and the grammar gaps intranslator-refuses-grammar: SEARCH ALL /no open EVALUATE, DL/I, DSF ALPHABET / FD shapes,FUNCTION CURRENT-DATE (1:4)(KØBREG), CBIMPORT, lgtestc1, polloo2. A continued hex literal (X'...over two rows) still does not parse in either quote style.🤖 Generated with Claude Code
https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR