Expand description
Token-segment rendering of instructions for rich (colored, clickable) display.
instruction_segments produces the same bytes as an instruction’s
Display (InstructionStatement) — concatenating every
returned Token’s text reproduces the canonical textual IR exactly — while
additionally tagging each run with a semantic TokenKind (for coloring) and
an optional Link (for click-through to the referenced value, function, or
block). The textual format stays the single source of truth: a test asserts
concat(segments) == format!("{insn}") for every mnemonic, so the two can
never drift.
Structs§
- Token
- One contiguous run of rendered text with its semantic kind and optional link.
Enums§
- Link
- A click-through target carried by a token, when it names something navigable.
- Token
Kind - What a token is, semantically — drives syntax coloring in a viewer.
Functions§
- instruction_
segments - Render an instruction as colored, linkable tokens. Concatenating the tokens’
text equals the instruction’s
Display(as_statement()) output. - literal_
atom - The rendered atom (no
<ty>prefix) of the literalid, resolved against the whole&Contextso symbolic block/function literals show their target name. This is the full-context twin ofLiteralRef’sDisplay(which, being&Shared-backed, cannot reach body/interface names and falls back to the numeric form). Used by the instruction renderer and the dataflow graph. Concatenating with the type prefix reproduces the pre-narrowing rendering byte-for-byte (context-split stage 5b-ii item #1). - value_
tokens - The token stream for a single value operand. Concatenating the token text
equals
ValueRef’sDisplay— which is implemented by writing these. - value_
tokens_ shared - The token stream for a shared-leaf value operand (literal, bytes, varnode),
rendered from only the module’s
SharedIR state. The&Sharedtwin ofvalue_tokensfor the operands a&Shared-backedValueRefcan hold; symbolic block/function literals fall back to the numeric form (their names live in bodies/interfaces, out of a&Shared’s reach). Panics on arena-cluster ids, which a shared-leaf ref never carries. - value_
tokens_ view - Provider-generic value rendering used by immutable arena-cluster refs.