Binder

Struct Binder 

Source
pub struct Binder { /* private fields */ }

Implementations§

Source§

impl Binder

Source

pub fn current_scope_id(&self) -> ScopeId

Source

pub fn get_function( &self, function_id: FunctionId, ) -> &SpannedItem<FunctionDeclaration>

Source

pub fn get_type(&self, type_id: TypeId) -> &TypeDeclaration

Source

pub fn find_symbol_in_scope( &self, name: SymbolId, scope_id: ScopeId, ) -> Option<&Item>

Searches for a symbol in a scope or any of its parents

Source

pub fn find_spanned_symbol_in_scope( &self, name: SymbolId, scope_id: ScopeId, ) -> Option<&SpannedItem<Item>>

Searches for a symbol in a scope or any of its parents

Source

pub fn scope_iter( &self, ) -> impl Iterator<Item = (ScopeId, &Scope<SpannedItem<Item>>)>

Iterate over all scopes in the binder.

Source

pub fn insert_into_current_scope( &mut self, name: SymbolId, item: SpannedItem<Item>, )

Source

pub fn get_scope(&self, scope: ScopeId) -> &Scope<SpannedItem<Item>>

Source

pub fn get_scope_kind(&self, scope: ScopeId) -> ScopeKind

Source

pub fn with_scope<F, R>(&mut self, kind: ScopeKind, f: F) -> R
where F: FnOnce(&mut Self, ScopeId) -> R,

Source

pub fn from_ast(ast: &Ast) -> Self

Source

pub fn from_ast_and_deps( ast: &Ast, dependencies: Vec<Dependency>, interner: &mut SymbolInterner, ) -> Self

Source

pub fn insert_into_specified_scope( &mut self, scope: ScopeId, name: Identifier, item: Item, )

Source

pub fn get_module(&self, id: ModuleId) -> &Module

Source

pub fn get_binding(&self, binding_id: BindingId) -> &Binding

Source

pub fn create_scope(&mut self, kind: ScopeKind) -> ScopeId

Source

pub fn iter_scope( &self, scope: ScopeId, ) -> impl Iterator<Item = (&SymbolId, &SpannedItem<Item>)>

Source

pub fn insert_expression(&mut self, id: ExprId, scope: ScopeId)

Source

pub fn get_expr_scope(&self, id: ExprId) -> Option<ScopeId>

Auto Trait Implementations§

§

impl Freeze for Binder

§

impl RefUnwindSafe for Binder

§

impl !Send for Binder

§

impl !Sync for Binder

§

impl Unpin for Binder

§

impl UnwindSafe for Binder

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.