rpg_source.zig (with rpg_export.zig, rpg_frames.zig, rpg_end.zig): an export procedure is written like a local one, plus export #784
Loading…
Reference in a new issue
No description provided.
Delete branch "lexp"
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?
Since v0.1.500 an
exportprocedure is read as a procedure (Module.isCycleMain),but the emitter refused its
dcl-procline, its parameters, its locals and itsEND-PROC, and never wrote the keyword. The change writes it from two objectfacts and keeps a failure line whenever the two do not agree.
What proves
export(measured)Two facts of the object. They agree on every procedure of the public data, so the
data does not say which one is the cause; the emitter asks for both.
(symbol 1 of class 1 is the cycle main). A local procedure is class 3.
+0x28, then +0x10;
rpg_export.zig): the row holds the number of a row of theprocedure table, and that row holds the procedure symbol (+112) and the name
(+108). The export name equals the name of the row.
Crosstab over every procedure of the ILE RPG objects among the 1684 public
stripped objects (the committed twins and the captures, some objects counted
twice; an object is RPG when it has a
_QRNP_PEP_procedure: 1607 objects, allprograms, no RPG module or service program):
export)AddressOutsideSections)The same holds in the C and CL objects of the data (143 class 1 procedures other
than symbol 1, 143 rows), which the emitter does not read.
The cycle main is in the table too, under the name of the module, so a row alone
does not prove
export: the cycle main is not written asdcl-procat all.The pair
lsel-loc-if/lsel-exp-if(and-sel) differs in exactly these twofacts and in the text: the sibling procedure is class 3 with no row, the exported
one class 1 with one row (
outline.json:exportsis empty againstTARGET procedure 3).Emitter.isSubprocedure(rpg_source.zig) now reads: a class 3 procedure with noexport row, or a class 1 procedure that is not the cycle main and has an export
row. A class 3 procedure with a row (not observed) and a class 1 procedure with no
row (not observed, or the table does not read) are not subprocedures: their
DCL-PROCkeeps the failure line, because a clean emit would dropexportorinvent it. The keyword is written in
dcl-proc NAME export;, also on thedcl-procof a failure line.The readers of a procedure frame took class 3 only
The emitter was not the only reader.
Module.isSubprocedure(class 3, or class 1that is not the cycle main) now stands where a reader asked for the class of the
procedure it recovers:
rpg_frames.procedure(parameters, return value, a call tothe procedure: the
RUNPROBEcall ofTARGETwas? unresolved statement),rpg_calls.oneParameter,rpg_end.procedureExitTransferandrpg_end.guard(theprocedure end:
END-PROCandRETURNwere partial),rpg_init_layout,rpg_ccsid_initandrpg_cycle_template.linearPrologue(the initialisation ofthe frame). Class 3 and the cycle main read as before; the 886 committed twins
emit byte for byte what they emitted (
emit-all.sh, base against head, the sixadopted twins included), except the seven twins that hold an exported procedure:
lsel-exp-if,lsel-exp-sel,lsel-for-arr-if-ifand the four adopted below(
lext-export-cycle-p,lext-export-main-p,lsel-cx-if,lsel-cx-sel).Counter (capture-emit-diff, base
~/bin/sourcererv0.1.500, head this change)Statements / emitted / failure lines, summed over the group:
lsel-exp-*lsel-cx-*(cycle main + export)lext-export-*lsel-for-arr-if-*Free of failure lines now:
lsel-cx-if,lsel-cx-sel,lext-export-cycle-p.Each
lsel-exp-*case andlext-export-main-*keeps exactly one failure line,compiler statement 2100000001 is partial, which its local sibling(
lsel-loc-if,lsel-loc-sel) has too: amain()module gap, not the export.The text of an exported twin equals the text of its local sibling with
export;taken off thedcl-proc(a test,lsel-exp-ifagainstlsel-loc-if,lsel-exp-selagainstlsel-loc-sel).Read against
source.rpgle: all new lines of the 9lsel-exp-*, the 2lsel-cx-*and the 3lext-export-*cases agree with their sources (names areplaceholders;
r += 1is writtenA = A + 1;inz(0)is not written, as forthe local siblings). Of the six Async programs the
dcl-procanddcl-piof the26 exported procedures were compared with the source by script, and the bodies of
the 26 exported procedures of
l10-async-asyncagewere read; the other fiveprograms were not read in full. Newly emitted lines that disagree with the source:
Async_Runsecond parameterarg pointer value options(*nopass)is writtenint(10) options(*nopass)in 4 programs,Async_Returnfirst parameterdata pointer valueis writtenint(10)in 1 program (no marker). The localprocedures do the same in the base emit (
sleepFor:arg pointer valueisint(10);startThread:likeds(TMPL...)): a parameter-type rule, not theexport.
Async_ThrowIfCanceled: the emptydcl-pi *n; end-pi;is not written (benign).carries a failure line or a
SOURCERER-TODOplaceholder (an array parameterdim() const options(*varsize)writtenuns(10)orchar(16384), a missingreturn type on the
dcl-procline, a varcharconst).Async_Then's localknown indis writtenchar(1) inz('0')(not compared with a local procedure).No Async program is free of failure lines. The emit of a non-exported procedure
changes only where it calls an exported one: a failure line (
? unresolved statement,CALLP ... partial) becomes the call text (Async_Sleep(10);,A = Async_Await(...)), or the line before the call now resolves; 27 of 151 localprocedures of the six programs change so, and no line of theirs that was written
before changes.
Seen, not changed
rpg_display.recover,rpg_display_numericandrpg_output_specstill take raw class 1 as "the main". No public case has aDSPLY or an output specification in an export procedure.
dim() const options(*varsize)is writtenchar(40)oruns(10), with aparameter_typeTODO in the Async programs.lsel-for-arr-if-ifthe store to a subfield of alikedsparameter is stillwritten as an assignment to the whole parameter (the known item of lane Lsel).
dcl-pr, iswritten as the object holds it (
A = TARGET(A);); the local siblings do thesame. Whether RPG accepts it is for the round trip.
Not determined
exportprocedure of anomainmodule or a service program: no capture. Therule is measured on programs (
*PGM) only.export(extname)is not in the data.Tests:
src/rpg_export_proc_test.zig. Adopted twins:lsel-cx-if,lsel-cx-sel,lext-export-cycle-p,lext-export-main-p,lsel-loc-if,lsel-loc-sel.Release gate (coordinator, build of
e33c6631against v0.1.500)e33c6631: all gates passed (census 645/0, twins regressions none, emit worse none).emit-bytes-diff.sh): onlylsel-exp-if,lsel-exp-selandlsel-for-arr-if-ifchange, the three with an exported procedure.capture-emit-diff.sh): 22 change, none with fewer emitted statements or more failures. The number ofdcl-proc NAME exportlines never exceeds the source's, and every exported procedure of a source is either written with the keyword or keeps its failure line.match:lsel-cx-if,lsel-cx-sel(a cycle main and anexportprocedure),lext-export-cycle-p,lext-export-main-p,lext-export-main-c,lsel-exp-if,lsel-exp-sel,lsel-exp-if-thr,lsel-exp-ifelse,lsel-exp-pi-if,lsel-loc-if. At v0.1.500lsel-exp-ifandlsel-exp-selweredifferent.int(10)without a failure line (the same rule writes local procedures); those programs still carry failure lines and do not compile. It is the next change, with the store to a subfield of alikedsparameter.e33c6631ba6e4fe40326