Expand description
Structural-mode Rust frontend: real-parser CST to Syntax-IR conversion.
The file is parsed with ra_ap_syntax (rust-analyzer’s error-tolerant
parser) and the resulting lossless CST is mapped onto the language-neutral
SyntaxIrFile: a comment- and whitespace-free token stream plus a tree
of IrNodes built from structurally meaningful grammar nodes only.
Interior expression detail (paths, literals, parentheses, non-assignment
binary operators, field accesses) stays token-only under the nearest
ancestor node, keeping the tree at the granularity structural comparison
works on. Statement wrappers add no node of their own when their inner
expression already maps to a shape: f(); is one Shape::Call node,
not an ExprStmt(Call) pair.
Nothing is executed or expanded: macro definitions and invocations are
recorded as nodes over their raw token trees. Malformed regions and
CST-depth truncation become Shape::Error nodes plus byte ranges in
SyntaxIrFile::error_ranges.
Delimiter nesting is checked with the nonrecursive lexer before the Rust
parser constructs its CST, so excessive nesting also becomes explicit
truncation data.
Structs§
- Rust
Structural Frontend - The Rust Structural-mode frontend.
Constants§
- STRUCTURAL_
FRONTEND_ VERSION - Version tag of this structural frontend, used as a fingerprint input. Bump it whenever a change alters the token stream or the IR tree for unchanged input.