Lane Sc: a scan site prints scan, not refusal #813
Loading…
Reference in a new issue
No description provided.
Delete branch "lane-sc-scan-marker-20261117"
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?
Lane Sc: a scan site prints
scan, notrefusalThe Debug refusal trace (
SOURCERER_TRACE_REFUSALS=1) printedrefusal <file>.<function> sNNatevery decline, including the declines of readers that try a pattern at every index of every body
(or a unit on every body). Those fire whether or not a statement later fails, so the trace could not
tell a scan miss from the refusal that stops the statement.
A scan site now prints
scan <file>.<function> sNN(andscan ... sNN <operand>where it had anoperand): the same fields, another first word. New in
core/rpg_trace.zig:scanAt,scanRet,scanAtOperand,scanToken. A reader of the trace drops everyscanline by one rule, and therefusallines that remain are the stopping ones. Debug builds only: a Release build compiles everycall to nothing, so the binary and every emit byte are unchanged.
rpg_statements.zigis untouched.Rule used to pick the sites (from the code): a function that a loop tries at every index of every
body, or that only such a function calls, and that declines with null or false for "the pattern is not
here". A decline there never stops a statement. A function that other, non-scan readers also call keeps
its tokens, and so does every site that refuses a proved call or a rewritten body.
Marked sites:
rpg_choice:extreme,boolean(the two patternsrewritetries at each index), and the checks only theycall:
ownLabel,pair,enclosed(a "needs parentheses" test, not a refusal).originalkeeps its token.rpg_frames.deadStore.rpg_trim:assignUnit,unit(also tried byrpg_source_trim),argumentUnit,charAssign,substVar,substCount(the unit tries ofrewrite), andsourceOf,elementAt(reached only from those).copyTail,loops,leading,trailing,lengthAtandhalvesalso serve readers outside thescan, so they keep
refusal.rpg_eval.runValuess01 to s07 (a unit that rewrote nothing, with its operand). s08 and s09(the rewritten values did not read) keep
refusal.Not marked:
rpg_frames.rewriteandframe(the call has no proved frame: the decision about one call,not a try at each index),
rpg_trimtails and loop readers,rpg_trim.rewrite's whole-body tries.Tests:
src/rpg_scan_marker_test.zig(new: the scan line shape and silence when off, every site ofeach scan function is a scan site, the stopping sites keep
refusal); the scanner ofsrc/rpg_trace_test.zigacceptsscanAt,scanRetandscanAtOperand, keeps its unique andwell-formed checks, and fails on a
scanword that is no scan form;src/rpg_trace_operand_test.ziglists
runValuess01 to s07 as scan operands and s08, s09 as refusal operands.Gates