Declare the static fields that no statement names #713
Loading…
Reference in a new issue
No description provided.
Delete branch "l4-declarations"
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?
Declare the static fields that no statement names
The compiler keeps the symbol of a field that no statement names (scale-one:
spare packed(9:2); ftwin14-x1:A char(10)), butunusedFieldsdeclaredonly a field that an initial value proved. A static field of the source range
whose kind and length give a type (
rpg_source_unused.shaped: int of 1, 2 or 4bytes, uns of 2, 4 or 8, packed, zoned, float(8), char of 2 or more) is now
declared with that type when it has no initial value other than the default and
the program has no files. A 1-byte field stays undeclared: it can be
char(1),indor a flag of the compiler.The decimal positions of an unused packed or zoned field are the type keywords
that nothing else explains (
rpg_source_scale.unexplained, the rule ofmissingScaleas a list). The creation data holds no scale for such a field(SCALE-AMBIGUITY: scale-one and scale-two compile to the same object), so any
pairing of the keywords with the fields gives the object;
assignUnusedtakesthe smallest keyword left that the digits hold, in symbol order, else 0. When a
field of the statements has unproved positions the unused fields wait, because
missingScalegives that field the keyword.Measured offline (Debug build, emit-all against the trunk build): failures,
statements and emitted are equal, no row is worse, and no
matchrow changesits text. Thirty programs gain a declaration; none of them is a
matchrow.Matching their rebuilt objects waits for the host.
The saved image of a RESET (
33 F; 33 V; 32 V 0 T; 42 F 0 T,rpg_source_unused.resetImage)is a compiler field with the flags of a source field; it is not declared. The
existing assertion of
rpg_source_polish_testr6a-reset-two (its image is notdeclared) stays as it was: the first version of this change declared the
images, and that test caught it.
Red first: on trunk the three tests of
rpg_decl_types_test.zigthat declare anunused field (ftwin14-x1
char(10), ftwin18-d7char(50), scale-onespare)fail, because trunk declares none of them; the RESET-image test passes on trunk
and guards the new rule.
Hand-off (not fixed here; the files belong to other lanes): r6a-reset-ds and
r6a-reset-two keep their SOURCERER-FAIL lines. A padded store narrower than its
field is not folded:
rpg_eval.zigfolds the blank fill only when the store isthe whole field (
whole), so statementS256.0 = 'beta'; %SUBST(S256.4: 1: 6) = *ALL' 'of a 13-byte structure stays two statements, andpaddedReferenceinrpg_source.zigmarks the symbolpadded_zero, so the structure is not one.Gates