rpg_source_decl_emit.zig, rpg_source_decl.zig, rpg_source.zig: a character field whose start value holds control bytes is declared in hexadecimal, in the lines of the source (lane Lgd3; changes rpg_source.zig; on top of lgd3) #777

Manually merged
binjovi-bot merged 2 commits from lgd3b into trunk 2026-11-10 13:52:08 +00:00
Owner

rpg_source_decl_emit.zig, rpg_source_decl.zig, rpg_source.zig: a character field whose start value holds control bytes is declared in hexadecimal, in the lines of the source (lane Lgd3; changes rpg_source.zig; on top of lgd3)

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

  • lgd2-b-hex-50/-90/-150, lgd2-c-hex-600 (declare s03): the start value of char(N) holds the
    control bytes 00 01 FF. inzText gives no rule for a character field with a byte below 40, the
    declaration is refused ("the initial value has no rule") and both statements that read it fail.
  • lgd2-d-whole-100/-150/-200 (declare s03): the same refusal. The symbol is a data structure that the
    statements read whole, so no subfield is proved and it is declared as one character field.
  • A hexadecimal start value in the loose wrap (inz( on its own line, 4 blanks, 88 digits a line) needs one line
    more than the source: lgd2-b-hex-50 needs 7 lines for the 6 before the first statement.

Rule

  • controlStart: a character field that a statement names, with a whole bytes start value that holds a byte
    below 40, is declared with inz(x'...'). Not for a field no statement names (the compiler has such fields),
    a varying field, an array, a value that starts as a length prefix, or a symbol that a statement stores into
    or resets (r6a-reset-ds/-fixed/-two: the symbol is a data structure with a subfield at byte 0).
  • fitGlobals: when the declarations need more lines than there are before the first statement, the wrap is
    wrapTight: inz(x' stays on the line of the name and the pieces run to 100 bytes with no indent.

Measured

  • Tests src/rpg_lgd3_test.zig (adopted captures lgd2-b-hex-50, lgd2-b-hex-90, lgd2-c-hex-600): no
    SOURCERER-FAIL, the type and the hexadecimal start value equal those of source.rpgle, no line over 100
    bytes. rpg_source_decl.zig: wrapTight of 100 digits is two lines, the first of 100 bytes.
  • Battery, 31 captures, lgd3 (build 1) against this build: cases with a failure line 23 -> 16. Clean now:
    b-hex-50/-90/-150, c-hex-600, d-whole-100/-150/-200 (d-whole is clean as dcl-s char(100) inz(x'...'); whether
    it compiles to the object of the structure is open: request lgd3/decl-shape dw-char, dw-ds1).
  • Sweep of the 776 stripped saves of src/testdata (emit text, lgd3 against this build): one differs,
    lr1-ld-ds-two-text (statements emitted 3 -> 4, failures 1 -> 0, one decimal_positions placeholder; the
    declarations fit the lines in the tight wrap). With the store/reset exclusion the three r6a-reset-* saves are
    unchanged (without it they gained a wrong char(13) declaration).

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": 1,
    "newly_clean": 7,
    "clean_delta": 7,
    "base": 581,
    "new": 588
  },
  "twins": {
    "groups": 826,
    "recovered": 804,
    "regressions": [],
    "newly": 6
  },
  "allgroups": {
    "regressions": [],
    "newly": [],
    "worse": []
  },
  "full_check": {
    "exit": 0,
    "seconds": 948
  }
}
# rpg_source_decl_emit.zig, rpg_source_decl.zig, rpg_source.zig: a character field whose start value holds control bytes is declared in hexadecimal, in the lines of the source (lane Lgd3; changes rpg_source.zig; on top of lgd3) ## Cause (public battery lgd2-long-start, v0.1.490 Debug build with the refusal tracer) - `lgd2-b-hex-50/-90/-150`, `lgd2-c-hex-600` (`declare s03`): the start value of `char(N)` holds the control bytes `00 01 FF`. `inzText` gives no rule for a character field with a byte below 40, the declaration is refused ("the initial value has no rule") and both statements that read it fail. - `lgd2-d-whole-100/-150/-200` (`declare s03`): the same refusal. The symbol is a data structure that the statements read whole, so no subfield is proved and it is declared as one character field. - A hexadecimal start value in the loose wrap (`inz(` on its own line, 4 blanks, 88 digits a line) needs one line more than the source: lgd2-b-hex-50 needs 7 lines for the 6 before the first statement. ## Rule - `controlStart`: a character field that a statement names, with a whole `bytes` start value that holds a byte below 40, is declared with `inz(x'...')`. Not for a field no statement names (the compiler has such fields), a varying field, an array, a value that starts as a length prefix, or a symbol that a statement stores into or resets (r6a-reset-ds/-fixed/-two: the symbol is a data structure with a subfield at byte 0). - `fitGlobals`: when the declarations need more lines than there are before the first statement, the wrap is `wrapTight`: `inz(x'` stays on the line of the name and the pieces run to 100 bytes with no indent. ## Measured - Tests `src/rpg_lgd3_test.zig` (adopted captures lgd2-b-hex-50, lgd2-b-hex-90, lgd2-c-hex-600): no `SOURCERER-FAIL`, the type and the hexadecimal start value equal those of `source.rpgle`, no line over 100 bytes. `rpg_source_decl.zig`: `wrapTight` of 100 digits is two lines, the first of 100 bytes. - Battery, 31 captures, lgd3 (build 1) against this build: cases with a failure line 23 -> 16. Clean now: b-hex-50/-90/-150, c-hex-600, d-whole-100/-150/-200 (d-whole is clean as `dcl-s char(100) inz(x'...')`; whether it compiles to the object of the structure is open: request lgd3/decl-shape dw-char, dw-ds1). - Sweep of the 776 stripped saves of `src/testdata` (emit text, lgd3 against this build): one differs, lr1-ld-ds-two-text (statements emitted 3 -> 4, failures 1 -> 0, one `decimal_positions` placeholder; the declarations fit the lines in the tight wrap). With the store/reset exclusion the three r6a-reset-* saves are unchanged (without it they gained a wrong `char(13)` declaration). 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": 1, "newly_clean": 7, "clean_delta": 7, "base": 581, "new": 588 }, "twins": { "groups": 826, "recovered": 804, "regressions": [], "newly": 6 }, "allgroups": { "regressions": [], "newly": [], "worse": [] }, "full_check": { "exit": 0, "seconds": 948 } } ```
sean force-pushed lgd3b from f5336af6ce
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
to cdc3701992
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-10 13:41:50 +00:00
Compare
binjovi-bot manually merged commit cdc3701992 into trunk 2026-11-10 13:52:08 +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!777
No description provided.