A numeric array held in a data structure is declared as an array #737

Manually merged
binjovi-bot merged 6 commits from lr1-big-ds into trunk 2026-11-05 20:34:06 +00:00
Owner

A numeric array held in a data structure is declared as an array

A 6000-byte numeric array that the source declares in a data structure
(dcl-ds a dim(1000) qualified; v packed(11:2); end-ds;, or an array
subfield) starts blank in the object (FILL[6000] = X'40'), not zero. The
declaration rule of lr1-num-elem refused that initial value, so the array
stayed undeclared and every element statement failed (twins lr1-bs-ds-dim and
lr1-bs-ds-overlay). arrayDefault in rpg_source_decl_emit.zig now accepts
the blank fill, and the array is declared packed(11:s) dim(n) and the
element arithmetic recovers.

Known gap: the emitted array is a standalone array, so the rebuilt object
starts zero, not blank; the decimal positions of the array are not proved
(packed(11:0)).

An element at an index that the statement computes before the unit
(a(i + 1)) was not a unit: the compiler loads and adds the index, then
34 A 0; 5; 35 T takes it from the stack instead of loading the field. The
array fact never formed, so the array stayed undeclared. prefixOf in
rpg_array_element.zig reads that head, and the element takes its index text
from the stack (twin lr1-ec-loop-next). An array that is only indexed at
constants (b(1)) has no variable-index unit and stays undeclared.

An element at a decimal index (i packed(5:0), zoned(4:0) or packed(3:0)) is
another head: the compiler loads the field, converts it to binary and
subtracts one, with no bounds labels and no temporary, then checks the index
against the dimension (34 A 0; 29 P; [84;] 87; 75; 77; 27 1; 52; 27 K; 138; 78 4; 65 W). decimalPrefix in rpg_array_element.zig reads it with the
decimal field as the index (twins lr1-di-*). A for over a decimal index is
still unresolved (its control statements are not emitted).

Gates

{"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":"current","emit":{"worse":[],"better":1,"newly_clean":14,"clean_delta":14,"base":359,"new":373},"twins":{"groups":549,"recovered":541,"regressions":[],"newly":30},"allgroups":{"regressions":[],"newly":[],"worse":[]},"full_check":{"exit":0,"seconds":570}}
# A numeric array held in a data structure is declared as an array A 6000-byte numeric array that the source declares in a data structure (`dcl-ds a dim(1000) qualified; v packed(11:2); end-ds;`, or an array subfield) starts blank in the object (`FILL[6000] = X'40'`), not zero. The declaration rule of lr1-num-elem refused that initial value, so the array stayed undeclared and every element statement failed (twins lr1-bs-ds-dim and lr1-bs-ds-overlay). `arrayDefault` in `rpg_source_decl_emit.zig` now accepts the blank fill, and the array is declared `packed(11:s) dim(n)` and the element arithmetic recovers. Known gap: the emitted array is a standalone array, so the rebuilt object starts zero, not blank; the decimal positions of the array are not proved (`packed(11:0)`). An element at an index that the statement computes before the unit (`a(i + 1)`) was not a unit: the compiler loads and adds the index, then `34 A 0; 5; 35 T` takes it from the stack instead of loading the field. The array fact never formed, so the array stayed undeclared. `prefixOf` in `rpg_array_element.zig` reads that head, and the element takes its index text from the stack (twin lr1-ec-loop-next). An array that is only indexed at constants (`b(1)`) has no variable-index unit and stays undeclared. An element at a decimal index (`i` packed(5:0), zoned(4:0) or packed(3:0)) is another head: the compiler loads the field, converts it to binary and subtracts one, with no bounds labels and no temporary, then checks the index against the dimension (`34 A 0; 29 P; [84;] 87; 75; 77; 27 1; 52; 27 K; 138; 78 4; 65 W`). `decimalPrefix` in `rpg_array_element.zig` reads it with the decimal field as the index (twins lr1-di-*). A `for` over a decimal index is still unresolved (its control statements are not emitted). ## Gates ``` {"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":"current","emit":{"worse":[],"better":1,"newly_clean":14,"clean_delta":14,"base":359,"new":373},"twins":{"groups":549,"recovered":541,"regressions":[],"newly":30},"allgroups":{"regressions":[],"newly":[],"worse":[]},"full_check":{"exit":0,"seconds":570}} ```
binjovi-bot manually merged commit 60410e5c77 into trunk 2026-11-05 20:34:06 +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!737
No description provided.