Skip to main content

Module ast_text

Module ast_text 

Source
Expand description

Short source-text renderings of AST fragments, shared by the agent state model (crate::agent_state) and bynk-ide’s sequence diagram and effect summary: a branch’s outcome, a match arm’s pattern, and a parenthesis peel. #2220 moved them here from bynk-ide’s sequence.rs with the state model.

Functions§

branch_outcome
A branch’s rendered outcome — the tail value the handler yields on that path (Ok(view)), which a renderer shows as a note over the entry lifeline. None when the tail carries no distinguishable reply: a unit () (an else-less if’s synthesised branch, or an explicit () tail), or control flow (if/match/block) that is already rendered as its own nested structure — repeating it as a note would only add noise.
pattern_summary
A match arm’s branch label — a short rendering of its pattern, since there is no dedicated pattern-to-source printer to reuse.
peel_paren