rpg_source_decl.zig, rpg_source.zig: a long text start value of a character field is declared as text, with $ and # kept (lane Lgd3; changes rpg_source.zig) #776

Manually merged
binjovi-bot merged 2 commits from lgd3 into trunk 2026-11-10 13:14:03 +00:00
Owner

rpg_source_decl.zig, rpg_source.zig: a long text start value of a character field is declared as text, with $ and # kept (lane Lgd3; changes rpg_source.zig)

Cause (public battery lgd2-long-start, v0.1.490 Debug build with the refusal tracer)

  • lgd2-c-text-1000/-1500/-3000 (checkNames s04): the start value needs 13, 17 and 34 lines;
    declLine kept a declaration of at most twelve lines (max_decl_lines, the guard that keeps the
    whole image of an array out of a scalar declaration), so the declaration became
    "longer than 100 bytes" and every statement that names the field failed.
  • lgd2-c-var-1500, lgd2-b-var-50/-90/-150: the text holds $ and #; characterLiteral wrote the
    whole value as hexadecimal, twice its length. c-var-1500 passed the line cap; b-var-* did not fit the
    source lines ("declarations do not fit before source line N").

Rule

  • characterLiteral: the bytes 5B and 7B that read as $ and # are text. The captures
    lgd2-b-var-* and lgd2-c-var-1500 (compiled under CCSID 273) store 5B and 7B for them, as the
    text constants of the statements already assume. The other national characters stay hexadecimal.
  • declLine and the structure lines: the twelve-line limit applies where there is array evidence
    (e.arrays, ds_arrays); a field without it may hold up to 64 lines.

Measured

  • Tests src/rpg_lgd3_test.zig (adopted captures lgd2-c-text-1000, lgd2-b-var-50, lgd2-c-var-1500): no
    SOURCERER-FAIL, the declared type and the start value equal those of source.rpgle, no line over 100 bytes.
    Red before the change (each had a failure line).
  • Battery, 31 captures, v0.1.490 Debug against this build: cases with a failure line 30 -> 23. Clean now:
    c-text-1000/-1500/-3000, c-var-1500, b-var-50/-90/-150. The first p = %dec(...) statement is on the
    line of the source in all seven.
  • Sweep of the 776 stripped saves of src/testdata (emit text, v0.1.490 Debug against this build): only the three
    adopted captures differ.
  • The captures lgd2-c-text-1000, lgd2-b-var-50 and lgd2-c-var-1500 are adopted as probes (matrix rows, not yet compiled
    by the loop).

Gates (ship.sh):

{
  "checks": {
    "net_statements": 0
  },
  "census": {
    "statuses": {
      "recovered": 645,
      "partial": 0,
      "unresolved": 0
    },
    "regressions": 0,
    "newly_recovered": 0
  },
  "golden": "golden floor 173 ceiling 0 <= dump 173/5/0",
  "legend": "regenerated",
  "emit": {
    "worse": [],
    "better": 0,
    "newly_clean": 3,
    "clean_delta": 3,
    "base": 581,
    "new": 584
  },
  "twins": {
    "groups": 823,
    "recovered": 801,
    "regressions": [],
    "newly": 3
  },
  "allgroups": {
    "regressions": [],
    "newly": [],
    "worse": []
  },
  "full_check": {
    "exit": 0,
    "seconds": 884
  }
}
# rpg_source_decl.zig, rpg_source.zig: a long text start value of a character field is declared as text, with `$` and `#` kept (lane Lgd3; changes rpg_source.zig) ## Cause (public battery lgd2-long-start, v0.1.490 Debug build with the refusal tracer) - `lgd2-c-text-1000/-1500/-3000` (`checkNames s04`): the start value needs 13, 17 and 34 lines; `declLine` kept a declaration of at most twelve lines (`max_decl_lines`, the guard that keeps the whole image of an array out of a scalar declaration), so the declaration became "longer than 100 bytes" and every statement that names the field failed. - `lgd2-c-var-1500`, `lgd2-b-var-50/-90/-150`: the text holds `$` and `#`; `characterLiteral` wrote the whole value as hexadecimal, twice its length. c-var-1500 passed the line cap; b-var-* did not fit the source lines ("declarations do not fit before source line N"). ## Rule - `characterLiteral`: the bytes 5B and 7B that read as `$` and `#` are text. The captures lgd2-b-var-* and lgd2-c-var-1500 (compiled under CCSID 273) store 5B and 7B for them, as the text constants of the statements already assume. The other national characters stay hexadecimal. - `declLine` and the structure lines: the twelve-line limit applies where there is array evidence (`e.arrays`, `ds_arrays`); a field without it may hold up to 64 lines. ## Measured - Tests `src/rpg_lgd3_test.zig` (adopted captures lgd2-c-text-1000, lgd2-b-var-50, lgd2-c-var-1500): no `SOURCERER-FAIL`, the declared type and the start value equal those of `source.rpgle`, no line over 100 bytes. Red before the change (each had a failure line). - Battery, 31 captures, v0.1.490 Debug against this build: cases with a failure line 30 -> 23. Clean now: c-text-1000/-1500/-3000, c-var-1500, b-var-50/-90/-150. The first `p = %dec(...)` statement is on the line of the source in all seven. - Sweep of the 776 stripped saves of `src/testdata` (emit text, v0.1.490 Debug against this build): only the three adopted captures differ. - The captures lgd2-c-text-1000, lgd2-b-var-50 and lgd2-c-var-1500 are adopted as probes (matrix rows, not yet compiled by the loop). Gates (ship.sh): ```json { "checks": { "net_statements": 0 }, "census": { "statuses": { "recovered": 645, "partial": 0, "unresolved": 0 }, "regressions": 0, "newly_recovered": 0 }, "golden": "golden floor 173 ceiling 0 <= dump 173/5/0", "legend": "regenerated", "emit": { "worse": [], "better": 0, "newly_clean": 3, "clean_delta": 3, "base": 581, "new": 584 }, "twins": { "groups": 823, "recovered": 801, "regressions": [], "newly": 3 }, "allgroups": { "regressions": [], "newly": [], "worse": [] }, "full_check": { "exit": 0, "seconds": 884 } } ```
sean force-pushed lgd3 from 82ba673114
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
to 7247905b59
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-10 13:01:47 +00:00
Compare
binjovi-bot manually merged commit 7247905b59 into trunk 2026-11-10 13:14:03 +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!776
No description provided.