Repository navigation
det translator: accept single-byte national letters in data names (BETRÄGE / GEBÜHR) (Fixes #4664) - #4854
Conversation
…mes (#4664) - Mask single-byte national characters (e.g. cp273 BETRÄGE) from tree-sitter parser by substituting them with a safe ASCII letter before parsing, while preserving exact byte length to extract from original source bytes. - Preserve national characters in generated Java identifiers (e.g. `s_BETRÄGE`) by substituting `[^\w]` instead of `[^A-Za-z0-9]` in `jname`. - Remove unmodelled refusal for single-byte national letters in `source.py`. - Add `NATLET` e2e test to verify equivalence between GnuCOBOL behavior and generated Java output.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV
…S COMMA literals get a notation cause Ledger lowered (`update`: the GEBÜHR refusal is GONE) and the 4 new entries assigned to notation-decimal-comma: the engine reports 0,5 / 1000,00 as written, the translator 0.5 / 1000.00 as modelled -- one value, neither side wrong. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV
|
No description provided. |
|
PR #4854 @ 869640c: 3 failed check(s) == det (failure) -- real == plan (cancelled) -- infra == shard ${{ matrix.shard }} (cancelled) -- infra |
…fused (#4664) The two refusal cases (BETRÄGE, GEBÜHR) become a test that they are laid out under their own names, distinct from the ASCII look-alike (BETRAGE), with the literal kept as written. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV
|
CI shepherd: the head of this PR (48835b4) is not the one a maintainer labelled |
|
No description provided. |
|
CI shepherd: the head of this PR (48835b4) is not the one a maintainer labelled |
…-byte names - Single-byte national letters: the grammar is handed a same-length copy where a letter becomes a digit (an ASCII-looking letter would turn ÄLL into the keyword ALL, ÄND into AND); all-national words become `a`s. One helper, used by layout and stmt. - Refused by name instead of read as one byte a character (a mistranslation: PIC N(4) was laid out as 4 alphanumeric-edited bytes): PIC N / G, USAGE NATIONAL / DISPLAY-1, N / NX / G / GX / U / UX literals, shift-out / shift-in bytes X'0E' / X'0F'. - Tests for single-byte, Kanji / DBCS, shift-delimited and mixed cases, and for look-alikes that must still be read. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
PR #4854 @ cd59ca6: 2 failed check(s) == full-suite (failure) -- real == full-suite part 1/3 (failure) -- real |
|
No description provided. |
2 similar comments
|
No description provided. |
|
No description provided. |
|
CI shepherd: real failure(s) on this head. Reproduce locally with the |
…when it holds national data (#4664) The translator now refuses PIC N / G, USAGE NATIONAL / DISPLAY-1 and N / G literals whole (it laid them out one byte a character), so the inventory's layout.parse raised and the program's PACKED / COMP / EDITED / statements went uncounted (test_data_types). The census now reads that national data as plain text for counting only, and counts NATIONAL itself. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
CI shepherd: the head of this PR (28d31f3) is not the one a maintainer labelled |
|
No description provided. |
|
No description provided. |
Fixes #4664.
What changes: the translator used to refuse a program whose data names hold a single-byte national letter (estate-crucible DEUT ZINSBER:
GEBÜHR,BETRÄGEin cp273), because the COBOL grammar reads ASCII words only.9, orain a word of national letters alone) viasource.ascii_for_grammar(layout.parse,stmt.parse); a digit becauseÄLLread asaLLis the keyword ALL andÄNDthe operator AND. Offsets are unchanged, and names and literals are still read from the original source by byte offset, so'GEBÜHR'stays'GEBÜHR'.unmodelledrefusal for a national letter in a name is gone. National / DBCS text beyond Latin-1 is still refused.jnamekeeps the letter (Java identifiers allowÄ). ASCII names are unchanged.Proof:
NATLETdet program (01 BETRÄGE … DISPLAY BETRÄGE): GnuCOBOL and the Java port print the same output, in all 3 modes (end-to-end, Docker + JDK 17);det_port checkagainst main: 103/103 existing ports byte-identical.Fact cross-check: ZINSBER now translates, so its refusal entry is GONE (ledger lowered). It shows 4 new entries, the same values in two notations under
DECIMAL-POINT IS COMMA: the engine reports0,5/1000,00as written, the translator0.5/1000.00. These are assigned to a new cause,notation-decimal-comma(definitional).How it was made: the change was written by agy (Gemini). I reviewed it, ran the formatter, ran the end-to-end proof and the port diff, and triaged the ledger. Gates:
pr_gates --fast5/5; ratchets 7/7 after the ledger update.Widened scope (review: "does this cover the whole input class?"). National and double-byte text, probed one sub-case at a time:
N'ABC'Not supported, and refused rather than translated: any PIC N / G data, NATIONAL usage, and national / DBCS literals. They need a two-byte layout and runtime (#4272). Words that merely contain the tokens (NATIONAL-ID, G-U, a literal's content, a
*>comment) are still read.Tests:
tests/cobol_mainframe/test_det_source_4462.py(keyword look-alike names x12,ascii_for_grammarcolumn check, 17 refusal rows, 3 look-alike reads, Kanji literal / name / VALUE). Gates after the widening:pr_gates --fastgauntlet / audits / secrets / xray pass, lint pass after an import-order fix;--ratchets7/7 (ledger unchanged). The NATLET end-to-end proof was not re-run (no Docker / JDK 17 run in this pass; the change after it touches only the grammar stand-in and the new refusals).🤖 Generated with Claude Code
https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV