Decimal literals passed to a packed CONST parameter of a program #646
Loading…
Reference in a new issue
No description provided.
Delete branch "rpg-9-aj-decimal-argument-20261026"
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?
Decimal literals passed to a packed CONST parameter of a program
A program call with a decimal literal for a
packed(7:1) constparameter(
invoke(.6: text),invoke(4.2: text)) copies a packed constant of themodule into a temporary, rescaled by a nonnegative shift (
27 K; 61 P S 0),and passes its address. The argument rules knew the integer literal
(
27 K; 88 D; 61 P S 0) only, so these calls stayed unresolved. The newrule reads the packed constant, refuses a negative value, rounding and
overflow, and gives the exact packed bytes in the same fact as the integer
form.
The emitter proves the decimal positions of a copied packed literal from
the literals of the module. When they give no one reading (
4.2beside42: the digits 42 have two readings), the positions that an earlier callof the same prototype proved for that parameter decide, when the digits
agree.
d7-argsis the public reproduction; its emit is the source.program-literal(invoke(12.50:text)topacked(9:2) const) was adesigned negative of
rpg_argument_copy_test.zig, held until this ruleexisted; its emit round-trips to a match, and the test now asserts the
copied packed literal.
program-convertandprogram-charstay negative.Gates