pub struct StatementSummary {
pub shape_tag: u8,
pub native_kind: Option<Lexeme>,
pub token_start: usize,
pub token_end: usize,
}Expand description
A statement reduced to its shape and the span of its tokens.
The shape carries the rename-invariant signal that aligns two statement sequences; the span is how the text itself is recovered, for the lexical comparison that decides whether aligned statements are actually copies.
The span is kept rather than the token texts because a compound statement covers its whole body: cloning the texts would cost a copy of the token stream once per level of nesting, while an index pair costs the same whatever the statement contains. It is a position into one file’s stream and nothing more — identity in this tool is content-derived, and no fingerprint reads this type.
Fields§
§shape_tag: u8Shape tag of the statement (see Shape::tag).
native_kind: Option<Lexeme>Native kind name when the statement is a Shape::Native node.
token_start: usizeIndex of the statement’s first token in its file’s stream.
token_end: usizeIndex one past the statement’s last token in its file’s stream.