rpg_source.zig, rpg_source_ctdata.zig: an array of compile-time data is declared with CTDATA and its data records follow the last line #796
Loading…
Reference in a new issue
No description provided.
Delete branch "lctd"
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?
rpg_source.zig, rpg_source_ctdata.zig: an array of compile-time data is declared with CTDATA and its data records follow the last line
A program with
dcl-s list char(13) dim(1000) ctdata;and a**CTDATA listsection was written as one scalar withall the bytes inline (
dcl-s A_00255 char(13000) inz('...')). That is refused as "declaration of symbol N: longerthan 100 bytes", and every statement that names the array then failed as "not declared". The emit now writes
one element in each record, the blanks at the end of a record left out, the section after the summary comments (nothing
after
**CTDATAis source). The section is named, so the order of several arrays does not matter. The receipt namesits lines
emit_ctdata_v1(a new form of the table in docs/DUMP.md; the summary is no longer the last line when asection follows).
fromImageFilesreads the text of the statements only, so the digits of the records are no literal.What the object proves (battery
lctd-ctdata, 14 captures of 2026-11-13; one question each)S253.0 CHARACTER[n] = X'...'(therecord bytes, elements end to end, short records padded with blanks) at the HEAD of the static initialization:
items 1 to k, before the compiler's own first item
S(n).0 POINTER[16] = ADDRESS(S(n+1).0). Two arrays areitems 1 and 2 (
lctd-two-arrays). A fact that comes later is not: the INZ twin of the same first value(
dcl-s list char(13) dim(3) inz('00012 00345')) is the itemS253.0 CHARACTER[39] = ALL X'F0F0F0F1F2404040F0F0F3F4F5',item 26 of 27, and a character scalar with INZ (
d7-args) is item 26 of 28. The symbol records of the CTDATA andthe INZ array are byte for byte equal (kind 8, class 3, length 39, flag words 0x7000c000 and 0x80010000), so the
position in the static initialization is the only discriminator. Census over the 970 public twins: of the 850
programs with a static initialization of 20 items or more, 845 start with the pointer item; the other 5 start
with
CHARACTER[256] = X'000102...', the identity table of the compiler (control bytes: no record).Long data are items of 400 bytes (
dev5/p3: 32 items of 400 and one of 200 for 13000 bytes), whichinitialalready joins into one value.
34 A 0; 29 N 0 T; 87 4; 75 4; 77 4; 27 ONE; 52; 27 K; 138; 78 4; 65 Wis K + 1 elements of W bytes (lctd-loop: K = 2, W = 13, 39 bytes), and the length ofA is their product. A CONSTANT index is an offset:
list(1)is34 253 0,list(3)is34 253 0; 27 26; 62,the operations of
%subst(scalar: 27: 13); the literal pool holds the offset (26 inlctd-c13-3) and thewidth of the access (13, also in the INZ twin), nothing that names an element count.
No element width and no count: the 11 battery cases that index by constants only are not declared as arrays
(the scalar they had stays, or the refusal). The element is a character field because a decimal call reads
the unit as characters (
%INT(%SUBST(list(i): 1: 5)):decimal_callwith a character source whose firstoperation is the head of the unit). That call is the only proof; a typed access of the same array
(
array_element_v1) can only veto it (a numeric element, or another width or count).DIM(*CTDATA)againstDIM(3)(lctd-dim-starandlctd-short-linehave the samestatements and instructions; they differ in the constants and the data bytes), of a bare
**against**CTDATA list(lctd-plain-star: the same item aslctd-c13-3), or of the padding of a short record(
00012then 8 blanks). PERRCD has no mark either in the item oflctd-perrcd2(AAAAABBBBBCCCCCDDDDD: fourelements of 5 end to end), but no PERRCD(1) twin was compiled yet (request
lctd/ctdata-index,lctd2-perrcdandlctd2-perrcd-one). The emit writesdim(n), named sections and one element in each record.Observed, not proved: the symbols follow the order of the names (
i, list, xare S253, S254, S255;list, nare S253, S254), and the emitted names (
A_00253...) keep that order.What is written, and what is refused (a failure line, never a guess)
The array is declared when ALL hold: the symbol is a static character field whose whole initial value is bytes;
it is initialized at the head of the static initialization; a decimal call that reads it as characters at a
packed index gives W and N with W * N the length of the symbol, N >= 2; the elements are records. The failure line
compile-time data array: <fact>is written, in place of the declaration, when an element holds a controlbyte, a character that has another code point in some CCSID (only the invariant characters are written), is
blank (not measured), starts with
*or/(a mark of a source line), is wider than 100 bytes (a source line),or when every element is equal (an INZ array is not excluded: no probe of equal CTDATA records yet).
Not read, and unchanged: arrays that a statement indexes by a constant only; units of an integer or zoned index
(the packed index is the form of the battery and the development programs); numeric CTDATA arrays (they keep
"the initial value of the numeric array has no rule"); the fixed-form and mixed renders.
Battery before and after (
capture-emit-diff.sh, base = v0.1.512)Only
lctd-loopchanges (statements, emitted, failures 5, 4, 1 to 5, 5, 0). The 13 other cases are the same, asthe object proves nothing more for them:
lctd-c1-2,-c13-3,-c13-5,-ctdata-after-other,-dim-100,-dim-star,-inz-twin,-perrcd2,-plain-star,-short-line,-two-arrays,-zoned-3keep their emit: ascalar
char(N) inz('...')(none for the INZ twin) and theDSPLYfailure line (the reader of the DSPLYarguments is not this change);
-dim-star-elemhas no failure line before or after.The development programs
p3andp4(fit, not a rule: no test holds their text): one declarationchar(13) dim(1000) ctdata, a section of 1000 records that is byte for byte the data of the source, and the twostatements that read
%INT(%SUBST(list(i): ...)); failure lines 5 to 2 and 6 to 3 (what is left isSORTAand%LOOKUP). The scorer: suspect 3 and 3, same 30 to 35, refused 10 to 5,decl_missing2 to 0, andtype_unmarked0 to 2, which isDIM(*CTDATA)of the source againstdim(1000) ctdata.Probe
lctd-loop(dictionary capture). Tests:src/rpg_ctdata_test.zig.Gate
The type_unmarked WATCH: source
DIM(*CTDATA)against emitteddim(1000) ctdata, a spelling difference the object does not record.