Skip to main content

Module Transform

Module Transform 

Source

Modulesยง

Collect
Count
Inline
Patch
Safe

Functionsยง

CollectBlockPatches ๐Ÿ”’
Recursively compare OrigBlock (spans anchored to Source) and MutBlock (mutated AST, spans may be synthetic) and collect patches for any statements that differ.
CollectInnerBlockPatches ๐Ÿ”’
Recurse into block-containing expression variants.
PreservePass ๐Ÿ”’
One pass: parse Working, find the first inlinable binding, apply the text edit, return Some(new_text). Returns None when nothing changed.
Run
Parse Source, run up to super::Constant::MaxIterations elimination passes, then return the patched source text.
RunPreserve
Identify inlinable bindings via the same AST pipeline as Run, but apply the substitutions as targeted text edits so that every character outside the affected let binding and its single use-site is preserved verbatim.
StmtNestedBlock ๐Ÿ”’
Extract a directly nested Block from a statement for recursion.
StmtToText ๐Ÿ”’
Render a single syn::Stmt to its canonical text representation by wrapping it in a dummy function body and extracting the inner line(s). The wrapper indentation (one tab or 4 spaces from prettyplease) is stripped so the result is indentation-relative.
StmtTokensMatch ๐Ÿ”’
Compare two statements by their token stream text.
TryBlockPreserve ๐Ÿ”’
TryItemPreserve ๐Ÿ”’
TryPatchSource ๐Ÿ”’
Attempt to reconstruct the output by splicing only the changed ranges. Returns None on any span resolution failure, triggering the fallback.