rpg_trim.zig, rpg_eval.zig and rpg_eval_builtins.zig: %CHAR of an integer owns its label definitions (operation 15) #763
Loading…
Reference in a new issue
No description provided.
Delete branch "lo15"
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_trim.zig, rpg_eval.zig and rpg_eval_builtins.zig: %CHAR of an integer owns its label definitions (operation 15)
%CHAR(I)of an integer compiles to a zoned convert of I into a temporary T,a copy of its digits behind one byte of a buffer B, a loop that strips the
leading zeros (three label definitions, operation 15) and the sign. No unit
read that expansion, so the first label stopped the statement at
control_flow / operation_semantics.
rpg_trim.charStripnow reads the wholeexpansion with its labels (the parked lc2b unit, ported onto the tracer
tokens and the trim halves of trunk). The consumers of the stripped digits
differ, and each is its own reader; the statement is recovered when one of them
reads the rest:
S = %CHAR(I);copyTail, now shared withthe trim assignment);
first (
R.b = %CHAR(I);copyTailmodestacked, the head has op 5 where34 S 0stands;aimBeforereads the address);27 P; 35 Qwith the N of the strip(
%TRIM(%CHAR(I));loopsFromisloopsentered at its first label);'Total ' + %CHAR(N);charConcat,copyTailmodejoined).rpg_eval_builtins.charIntegerrenders the value (one hook line inrpg_eval.zig). The temporary of the trim form is saved as a buffer value sothat
Source.tempof the trim operation reads it.Red tests (G header of the dump / source statement)
Recovered: h-editc G29 / 44, dspf-io G30 / 37, h-subfill G25 / 66, d4-edit G10 /
14, lc2-cat-char-int G16 / 24 (
src/rpg_lo15_labels_test.zig). The parkedcommit alone (lc2b 9f771bcd) recovered the first two.
Not in this change (family 2, range checks of %SUBST with a variable start,
%LEFT, %RIGHT, and %SUBST of %EDITC): h-bifs-char G8, G14, G15 and
r5e-editc-held G6 still stop at operation 15.