Refusal-site tokens in the value rewriters and the unit dispatch of rpg_eval.zig #760
Loading…
Reference in a new issue
No description provided.
Delete branch "lt2"
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?
Refusal-site tokens in the value rewriters and the unit dispatch of rpg_eval.zig
The first oracle run showed that every control-flow refusal on an inlined
built-in ends at
rpg_render_ctx.unhandledOperation s01, which does not saywhich value rewriter declined. This change adds site tokens (the grammar and the
Debug-only gate of
rpg_trace.zigare unchanged:refusal <file>.<function> sNN,code locations only, no program content, no output change) to:
the rewriters: every
return null/return falseinrpg_trim.zig(
argumentUnitand the loop readers),rpg_char.zig,rpg_array_element.zig,rpg_value_units.zig,rpg_choice.zigandrpg_eval_builtins.zig(thebuilt-in expansion readers: %CHAR of an integer, the %SUBST / %REPLACE / %LEFT /
%RIGHT / %CHECK range checks, %LOOKUP, %SQRT, %SCAN);
rpg_eval.zig runValues, where each unit is tried, in the order the units run:s01value_units,s02CCSID,s03UCS-2,s04trim,s05frames,s06programs,s07choice. A token means that the unit read nothing in thisstatement. Units that never match leave this token only, so the set of tokens
still separates the families;
runValuesagain, where the rewritten values were tried and did not read, sothe plain operations run instead:
s08a step had no rule,s09the stack orthe lines were left over;
rpg_eval.zig run:s01, a step returned false.the recognizers that own a return-point store (a label pointer, kind 22) or a
subroutine region, because
rpg_eval.step s02(the33address push of anon-data symbol) is the fallback label that fires when one of them refused
first:
rpg_subroutines.zig(validRegionand the routine reader),rpg_display.zigandrpg_display_numeric.zig(the DSPLY proof),rpg_cycle.zig,rpg_cycle_effect.zig,rpg_cycle_end.zig,rpg_cycle_template.zig,rpg_cycle_transfer.zig(the cycle-start andlinear-main init readers),
rpg_static_init.zigandrpg_init_layout.zig(the module-init readers), and every other unit that matches kind 22:
rpg_cases.zig,rpg_closing.zig,rpg_end.zig,rpg_until.zig,rpg_numeric.zig,rpg_loops.zig,rpg_file_ops.zig,rpg_specs.zig,rpg_io_routines.zig.A token in a rewriter (
rpg_trim.sourceOf s09) answers "which reader of thatunit declined"; the
runValuestokens answer "which units read nothing at all".A reader that scans every position (
rpg_array_element.decimalPrefix,rpg_value_units.shape) also fires on each position it does not match, so acount of those tokens is a count of probes, not of refused statements.
rpg_trace_test.ziglists the six new files and holds each new token to thesame pattern, uniqueness and file-name checks. rpg_eval.zig
stepis unchanged;rpg_statements.zig is unchanged.
Gates