pub struct Parse { /* private fields */ }Expand description
The result of parsing a source file: a lossless green tree, the interner needed to read token text back, and the diagnostics gathered while parsing.
Implementations§
Source§impl Parse
impl Parse
Sourcepub fn syntax_node(&self) -> ResolvedNode<SyntaxKind>
pub fn syntax_node(&self) -> ResolvedNode<SyntaxKind>
The resolved (interner-carrying) red tree root. Cheap to produce; supports
Display/.text() and the byte-exact round-trip.
Sourcepub fn errors(&self) -> &[SyntaxError]
pub fn errors(&self) -> &[SyntaxError]
The parse diagnostics (lexer/parser recovery + indentation issues).
Sourcepub fn debug_tree(&self) -> String
pub fn debug_tree(&self) -> String
A stable, indented S-expression dump of the tree (kinds + byte ranges + token text) — the golden-fixture review surface.
Trait Implementations§
impl Eq for Parse
Source§impl PartialEq for Parse
Equality compares the lossless green tree and the diagnostics; the interner is excluded
because it is a derived token-text cache (two parses with equal green trees reference equal
token text). This makes Parse a sound salsa tracked-fn return: an unchanged reparse
backdates instead of invalidating dependents — the Phase-3 incrementality precondition
(Playbook §4). GreenNode equality is structural, so this is O(tree) worst case but
short-circuits on the first difference.
impl PartialEq for Parse
Equality compares the lossless green tree and the diagnostics; the interner is excluded
because it is a derived token-text cache (two parses with equal green trees reference equal
token text). This makes Parse a sound salsa tracked-fn return: an unchanged reparse
backdates instead of invalidating dependents — the Phase-3 incrementality precondition
(Playbook §4). GreenNode equality is structural, so this is O(tree) worst case but
short-circuits on the first difference.
Auto Trait Implementations§
impl Freeze for Parse
impl RefUnwindSafe for Parse
impl Send for Parse
impl Sync for Parse
impl Unpin for Parse
impl UnsafeUnpin for Parse
impl UnwindSafe for Parse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.