pub struct ResolveContext {
pub global_scope: Scope,
pub scope_stack: Vec<Scope>,
pub variables: Vec<VariableInfo>,
pub functions: Vec<FuncInfo>,
pub places: Vec<Place>,
/* private fields */
}Fields§
§global_scope: Scope§scope_stack: Vec<Scope>§variables: Vec<VariableInfo>§functions: Vec<FuncInfo>§places: Vec<Place>Implementations§
Source§impl ResolveContext
impl ResolveContext
pub fn define_builtins(&mut self)
pub fn define_var( &mut self, name: EcoString, ident: Option<Identifier>, ty_hint: Option<Type>, ) -> VarId
pub fn define_fn( &mut self, name: EcoString, params: Vec<VarId>, return_ty: Type, ) -> FuncInfo
pub fn define_global_fn( &mut self, name: EcoString, params: Vec<EcoString>, params_ty: Vec<Type>, return_ty: Type, ) -> FuncInfo
pub fn resolve_ty(&mut self, name: &EcoString) -> Type
pub fn resolve_var(&mut self, name: &EcoString) -> Option<VarId>
pub fn resolve_fn( &mut self, name: &EcoString, num_params: usize, ) -> Option<FnId>
pub fn add_instance(&mut self, fn_id: FnId, instance: &FuncType)
pub fn push_scope(&mut self, update_place: bool)
pub fn pop_scope(&mut self)
pub fn get_var(&self, var_id: VarId) -> &VariableInfo
pub fn get_fn(&self, fn_id: FnId) -> &FuncInfo
pub fn new_ty_var(&mut self) -> Type
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResolveContext
impl !RefUnwindSafe for ResolveContext
impl Send for ResolveContext
impl !Sync for ResolveContext
impl Unpin for ResolveContext
impl UnsafeUnpin for ResolveContext
impl UnwindSafe for ResolveContext
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more