rpg_source.zig: settle() enforces the validator rules condition_literal and bif_numeric (also root.zig) #791
Loading…
Reference in a new issue
No description provided.
Delete branch "enforce3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After
blocks,loop_exit,returnandinterface,settle()enforces the last two validator rules. They runonly when the earlier steps flip nothing, on the current text; when anything flips
settleresets and renders againas before. It never runs
dropUnreferenced,nameSymbolsorfitGlobalsagain, and it adds no placeholder.condition_literal(refuseConditions, RNF7423): a DOW, DOU, IF or WHEN whose condition is a bare numberbecomes a failure line ending
(validator: condition_literal). The parts of its block then fail throughblocks(the ENDDO), and a LEAVE or ITER that is left with no emitted loop fails throughloop_exit.bif_numeric(refuseNumerics, RNF0553): a statement with a %REM operand declared as other than a numberbecomes a failure line ending
(validator: bif_numeric).Both use one helper (
refuseFound) with the statement number of the finding, asrefuseInterfacesdoes. Astatement that two entries share, or that is not code, is left alone and the finding stays in the receipt.
Other typing (RNF7416, RNF7421, call arguments) stays report-only. Nothing else about the emitter changes.
Why
dow 1;: the source isdow '1';. The statement is recovered aspartial: the condition is the constantcharacter
'1'and the recovery stops at type inference of an indicator. No object fact or committed twin provesthat
dow *on;ordow '1' = '1'compiles to the same object, so the form is not guessed: the refusal is the safeaction, and the one DOW per program is a failure.
Measured, enforce2 build (v0.1.999 in the coordinator bin) against this build (statements, emitted, failures,
placeholders;
validatorcounts):In each program six statements fall: the DOW (
condition_literal), its ENDDO (blocks), three LEAVEs inside it(
loop_exit) and the one %REM statement (bif_numeric). The text between the DOW and the ENDDO stays code. Theseprograms do not compile today.
The 852 committed twin emits are byte-identical (no row differs), so no matching twin changes, and none has a
finding of these two rules.
Tests:
src/rpg_source_enforce3_test.zig.Gate (coordinator, base v0.1.507)
DOW 1, its ENDDO, three LEAVEs, one%REMstatement). Gate FAIL lists exactly those six moves (intended: text that could not compile becomes a refusal).e2a0954b8e84eeba1364