Skip to main content

ScopeBuilder

Struct ScopeBuilder 

Source
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

Source

pub fn new() -> Self

Source

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Visitor for ScopeBuilder

Source§

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

Called after visiting this node’s children (post-order).
Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.