rpg_statements.zig, rpg_source.zig: a select head has the empty statement region, and an export procedure is not the cycle main #783

Manually merged
binjovi-bot merged 3 commits from lsel into trunk 2026-11-11 01:08:25 +00:00
Owner

Two false readings had one cause, and the change makes both from object facts.

  1. renderStatement read every codeless statement that stands before a
    condition as the head of a select. The dcl-proc of an exported
    procedure and an endif that lands a forward jump came out as SELECT/WHEN,
    so if/endif blocks were refused. The head of a real select; is the
    statement whose whole operation family is the empty statement region,
    110 108 111 6 111 6 [27 35] (rpg_select_head.isHead). The dcl-proc,
    else, other, endif and endsl statements are bare (110 108 27 35 ...).
  2. Symbol class 1 is both the cycle main and an export procedure, and an
    exported procedure was read as the cycle main (no DCL-PROC, no procedure
    end, the main-only readers). The cycle main is symbol 1; an export
    procedure has another symbol (Module.isCycleMain). All six readers of
    "class 1 is the main" use it: rpg_statements (the exit label and the
    subprocedure frame), rpg_source (isMain), rpg_cycle_transfer,
    rpg_cycle_template, rpg_specs (the main body tail) and rpg_file_ops
    (the main of the file runtime).

The question per case (battery captures/lsel-select-head, 24 cases, DBGVIEW(*ALL), option(*srcstmt))

The empty region stays on every real select; head and on no other statement.
Read over every statement of the 24 cases: the family is exactly
110 108 111 6 111 6 27 35 for 14 of 14 select; lines, whether the construct
is the first statement of an exported or a local procedure, follows an
assignment, follows an if/endif block (with if or select after it),
stands in an else, in a dou body, in the for loop of the Async_AwaitAll
shape (array element of a dim() const options(*varsize) parameter, and the
scalar twin), or is the first statement of a cycle main; exp-sel1 (a select
with one when) and thread(*concurrent) keep it. Every dcl-proc, else,
other, endif and endsl (and the endif that precedes an if or a
select) has the family 110 108 27 35 plus, for a dcl-proc, 111 111 111 111 111.
Neither direction has an exception in the 24 cases and in the six Async
programs (2 of 2 select; lines). The prefix 110 108 111 6 111 6 alone is
not enough: an if, a dow and the return; of a cycle main open with it and
carry code after it, so the rule compares the whole family.

Symbol class 1: the cycle main of lsel-cyc-* is symbol 1; the exported
procedure of lsel-exp-* and lsel-for-arr-* (and the 26 exports of each
Async program) is class 1 with another symbol; symbol 1 of a module with main()
or nomain is class 3. All 753 class 1 procedures of the committed stripped RPG
twins are symbol 1; the other class 1 symbols of the twins (symbol 2 and 3) are C
modules (source.c), which are not read as RPG.

Counter

lsel-count.sh on the six public Async captures (l10-pgm-a1, l10-pgm-a2):

before after
recovered statements 1997 1931
select text (SELECT/WHEN/OTHER/ENDSL) 228 12
false on if lines 150 0
false on dcl-proc lines 66 0
genuine (on select/when/other/endsl lines) 12 12

The recovered count of those captures falls by 66 because the false readings
left; that fall is the correction, not a regression. The counter counts
source; recovered statements: the 66 false SELECT heads on dcl-proc lines
are now declaration; recovered DCL-PROC NAME (and 126 END-PROC that were
unresolved are now declaration; partial). Statement by statement over the
six captures (3671 statements before and after), no statement is lost: 450
change, among them 72 ENDSL to ENDIF and 66 WHEN to IF. Where the
if condition itself is unresolved (a call in the condition), its endif is
now ? (no operation) where it was a false SELECT.

Gates measured on the lane build (Debug)

  • Statements of all 797 committed stripped twins, base against this build:
    only the three adopted probes below change; no committed twin with a real
    select changes.
  • The adopted probes (public captures of the lane battery):
    lsel-exp-if (export, if), lsel-exp-sel (export, select),
    lsel-for-arr-if-if (the Async_AwaitAll loop shape) and lsel-cyc-sel
    (the real select; of a cycle main stays). Their emit still carries
    SOURCERER-FAIL lines (the emit of an export procedure is not written:
    DCL-PROC TARGET is refused), so the three exported ones need a matrix class
    by the coordinator.
  • Not determined: a module with both a cycle main and an export procedure
    (no battery case has both); request requests/lsel/cyc-export (2 cases).
  • Emit of an export procedure is not written (isSubprocedure still wants
    class 3 and the keyword export is not emitted): the emit failures of the
    adopted exported probes rose (exp-if 5 to 8, exp-sel 8 to 13) while their
    statements are now read right. The next change.

Tests: src/rpg_select_head_test.zig.

Release gate (coordinator, build of cc9bee25 against v0.1.499)

  • Ship row cc9bee25: every gate passed (census 645/0, twins regressions none, emit worse none); the row is ok: false only for the push after the rebase, done afterwards with push.sh --force-with-lease.
  • Development emits: byte-identical. Committed twins at v0.1.499 (emit-bytes-diff.sh): byte-identical. L10-test direction: rose.
  • 66 public captures (capture-emit-diff.sh): 22 change. Where the emitted count falls (exported-procedure probes, the six public Async programs), the base text was false: a select/when/endsl for a source if/endif, and a module-level dcl-pi taken from the exported procedure. The head refuses those lines (DCL-PROC NAME, the parameter of the exported procedure) until the emit of an export procedure has a rule; that is the next change.
  • Host round trips with this build: lsel-cyc-sel, lsel-cyc-if, lsel-cyc-stmt-sel all match.
  • captures/lsel-cyc-export (a cycle main and an export procedure in one module, two cases): the cycle main is symbol 1 in both and both procedures read correctly; not adopted as a test yet.
Two false readings had one cause, and the change makes both from object facts. 1. `renderStatement` read every codeless statement that stands before a condition as the head of a `select`. The `dcl-proc` of an exported procedure and an `endif` that lands a forward jump came out as `SELECT`/`WHEN`, so `if`/`endif` blocks were refused. The head of a real `select;` is the statement whose whole operation family is the empty statement region, `110 108 111 6 111 6 [27 35]` (`rpg_select_head.isHead`). The `dcl-proc`, `else`, `other`, `endif` and `endsl` statements are bare (`110 108 27 35 ...`). 2. Symbol class 1 is both the cycle main and an `export` procedure, and an exported procedure was read as the cycle main (no `DCL-PROC`, no procedure end, the main-only readers). The cycle main is symbol 1; an export procedure has another symbol (`Module.isCycleMain`). All six readers of "class 1 is the main" use it: `rpg_statements` (the exit label and the subprocedure frame), `rpg_source` (`isMain`), `rpg_cycle_transfer`, `rpg_cycle_template`, `rpg_specs` (the main body tail) and `rpg_file_ops` (the main of the file runtime). ## The question per case (battery `captures/lsel-select-head`, 24 cases, `DBGVIEW(*ALL)`, `option(*srcstmt)`) The empty region stays on every real `select;` head and on no other statement. Read over every statement of the 24 cases: the family is exactly `110 108 111 6 111 6 27 35` for 14 of 14 `select;` lines, whether the construct is the first statement of an exported or a local procedure, follows an assignment, follows an `if`/`endif` block (with `if` or `select` after it), stands in an `else`, in a `dou` body, in the `for` loop of the Async_AwaitAll shape (array element of a `dim() const options(*varsize)` parameter, and the scalar twin), or is the first statement of a cycle main; `exp-sel1` (a `select` with one `when`) and `thread(*concurrent)` keep it. Every `dcl-proc`, `else`, `other`, `endif` and `endsl` (and the `endif` that precedes an `if` or a `select`) has the family `110 108 27 35` plus, for a `dcl-proc`, `111 111 111 111 111`. Neither direction has an exception in the 24 cases and in the six Async programs (2 of 2 `select;` lines). The prefix `110 108 111 6 111 6` alone is not enough: an `if`, a `dow` and the `return;` of a cycle main open with it and carry code after it, so the rule compares the whole family. Symbol class 1: the cycle main of `lsel-cyc-*` is symbol 1; the exported procedure of `lsel-exp-*` and `lsel-for-arr-*` (and the 26 exports of each Async program) is class 1 with another symbol; symbol 1 of a module with `main()` or `nomain` is class 3. All 753 class 1 procedures of the committed stripped RPG twins are symbol 1; the other class 1 symbols of the twins (symbol 2 and 3) are C modules (`source.c`), which are not read as RPG. ## Counter `lsel-count.sh` on the six public Async captures (`l10-pgm-a1`, `l10-pgm-a2`): | | before | after | |---|---|---| | recovered statements | 1997 | 1931 | | select text (SELECT/WHEN/OTHER/ENDSL) | 228 | 12 | | false on `if` lines | 150 | 0 | | false on `dcl-proc` lines | 66 | 0 | | genuine (on `select`/`when`/`other`/`endsl` lines) | 12 | 12 | The recovered count of those captures falls by 66 because the false readings left; that fall is the correction, not a regression. The counter counts `source; recovered` statements: the 66 false `SELECT` heads on `dcl-proc` lines are now `declaration; recovered` `DCL-PROC NAME` (and 126 `END-PROC` that were unresolved are now `declaration; partial`). Statement by statement over the six captures (3671 statements before and after), no statement is lost: 450 change, among them 72 `ENDSL` to `ENDIF` and 66 `WHEN` to `IF`. Where the `if` condition itself is unresolved (a call in the condition), its `endif` is now `? (no operation)` where it was a false `SELECT`. ## Gates measured on the lane build (Debug) - Statements of all 797 committed stripped twins, base against this build: only the three adopted probes below change; no committed twin with a real `select` changes. - The adopted probes (public captures of the lane battery): `lsel-exp-if` (export, `if`), `lsel-exp-sel` (export, `select`), `lsel-for-arr-if-if` (the Async_AwaitAll loop shape) and `lsel-cyc-sel` (the real `select;` of a cycle main stays). Their emit still carries SOURCERER-FAIL lines (the emit of an `export` procedure is not written: `DCL-PROC TARGET` is refused), so the three exported ones need a matrix class by the coordinator. - Not determined: a module with both a cycle main and an `export` procedure (no battery case has both); request `requests/lsel/cyc-export` (2 cases). - Emit of an `export` procedure is not written (`isSubprocedure` still wants class 3 and the keyword `export` is not emitted): the emit failures of the adopted exported probes rose (exp-if 5 to 8, exp-sel 8 to 13) while their statements are now read right. The next change. Tests: `src/rpg_select_head_test.zig`. ## Release gate (coordinator, build of cc9bee25 against v0.1.499) - Ship row cc9bee25: every gate passed (census 645/0, twins regressions none, emit worse none); the row is `ok: false` only for the push after the rebase, done afterwards with `push.sh --force-with-lease`. - Development emits: byte-identical. Committed twins at v0.1.499 (`emit-bytes-diff.sh`): byte-identical. L10-test direction: rose. - 66 public captures (`capture-emit-diff.sh`): 22 change. Where the emitted count falls (exported-procedure probes, the six public Async programs), the base text was false: a `select`/`when`/`endsl` for a source `if`/`endif`, and a module-level `dcl-pi` taken from the exported procedure. The head refuses those lines (`DCL-PROC NAME`, the parameter of the exported procedure) until the emit of an `export` procedure has a rule; that is the next change. - Host round trips with this build: `lsel-cyc-sel`, `lsel-cyc-if`, `lsel-cyc-stmt-sel` all `match`. - `captures/lsel-cyc-export` (a cycle main and an `export` procedure in one module, two cases): the cycle main is symbol 1 in both and both procedures read correctly; not adopted as a test yet.
A codeless statement before a condition was read as a select head, so the
dcl-proc of an exported procedure and an endif that lands a forward jump came
out as SELECT/WHEN. The head of a real select; is the statement whose whole
operation family is the empty statement region (110 108 111 6 111 6 [27 35]).

Symbol class 1 is the cycle main (symbol 1) and an export procedure (any other
symbol). One predicate, Module.isCycleMain, serves the six readers of the main.
Regenerate the operations legend
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
cc9bee25f6
sean force-pushed lsel from cc9bee25f6
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
to 039411ecd1
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-11 00:58:13 +00:00
Compare
binjovi-bot manually merged commit 039411ecd1 into trunk 2026-11-11 01:08:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!783
No description provided.