Skip to main content

Validator

Struct Validator 

Source
pub struct Validator<'a> {
    pub store: &'a ScopeStore,
    pub diagnostics: Vec<SemanticDiagnostic>,
    /* private fields */
}
Expand description

Collects diagnostics and maintains scope stack (replaying scope structure from first pass). Uses the same scope ID sequence as ScopeBuilder so resolve() looks up the correct scope.

Fields§

§store: &'a ScopeStore§diagnostics: Vec<SemanticDiagnostic>

Implementations§

Source§

impl<'a> Validator<'a>

Source

pub fn new(store: &'a ScopeStore, scope_id_sequence: &'a [ScopeId]) -> Self

Trait Implementations§

Source§

impl Visitor for Validator<'_>

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§

§

impl<'a> Freeze for Validator<'a>

§

impl<'a> RefUnwindSafe for Validator<'a>

§

impl<'a> Send for Validator<'a>

§

impl<'a> Sync for Validator<'a>

§

impl<'a> Unpin for Validator<'a>

§

impl<'a> UnsafeUnpin for Validator<'a>

§

impl<'a> UnwindSafe for Validator<'a>

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.