pub struct ScopeBuilder {
pub store: ScopeStore,
pub scope_id_sequence: Vec<ScopeId>,
/* private fields */
}Expand description
Builds scope tree by walking the syntax tree; maintains a stack of scope IDs. Records the sequence of scope IDs pushed (in walk order) so Validator can use the same IDs.
Fields§
§store: ScopeStore§scope_id_sequence: Vec<ScopeId>Scope IDs in the order they were pushed (for Validator sync).
Implementations§
Source§impl ScopeBuilder
impl ScopeBuilder
pub fn new() -> Self
Sourcepub fn with_store(store: ScopeStore) -> Self
pub fn with_store(store: ScopeStore) -> Self
Build scope from a program tree using an existing store (e.g. pre-seeded from signature files).
Trait Implementations§
Source§impl Default for ScopeBuilder
impl Default for ScopeBuilder
Source§impl Visitor for ScopeBuilder
impl Visitor for ScopeBuilder
Source§fn enter_node(&mut self, node: &SyntaxNode) -> WalkResult
fn enter_node(&mut self, node: &SyntaxNode) -> WalkResult
Called before visiting this node’s children (pre-order).
Source§fn leave_node(&mut self, node: &SyntaxNode) -> WalkResult
fn leave_node(&mut self, node: &SyntaxNode) -> WalkResult
Called after visiting this node’s children (post-order).
Source§fn visit_token(&mut self, _token: &SyntaxToken) -> ControlFlow<()>
fn visit_token(&mut self, _token: &SyntaxToken) -> ControlFlow<()>
Called for each token when
WalkOptions::visit_tokens is true.
Trivia is included only when WalkOptions::visit_trivia is true.Auto Trait Implementations§
impl Freeze for ScopeBuilder
impl RefUnwindSafe for ScopeBuilder
impl Send for ScopeBuilder
impl Sync for ScopeBuilder
impl Unpin for ScopeBuilder
impl UnsafeUnpin for ScopeBuilder
impl UnwindSafe for ScopeBuilder
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
Mutably borrows from an owned value. Read more