pub struct Scopes {
pub literals: Vec<(BytecodeLiteral, Declaration)>,
pub scopes: Vec<Scope>,
}
Fields§
§literals: Vec<(BytecodeLiteral, Declaration)>
§scopes: Vec<Scope>
Implementations§
Source§impl Scopes
impl Scopes
pub fn new() -> Scopes
pub fn add_lit_decl( &mut self, literal: BytecodeLiteral, reg: Reg, ) -> CompilerResult<()>
pub fn add_var_decl(&mut self, decl: String) -> CompilerResult<Register>
pub fn add_decl( &mut self, decl: String, decl_type: DeclarationType, ) -> CompilerResult<Register>
pub fn reserve_register(&mut self) -> CompilerResult<Register>
pub fn reserve_register_back(&mut self) -> CompilerResult<Register>
pub fn get_var(&mut self, var_name: &str) -> CompilerResult<&Declaration>
pub fn get_lit_decl( &self, literal: &BytecodeLiteral, ) -> CompilerResult<&Declaration>
pub fn enter_new_scope(&mut self) -> CompilerResult<()>
pub fn current_scope(&self) -> CompilerResult<&Scope>
pub fn current_scope_mut(&mut self) -> CompilerResult<&mut Scope>
pub fn leave_current_scope(&mut self) -> CompilerResult<Scope>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scopes
impl RefUnwindSafe for Scopes
impl Send for Scopes
impl Sync for Scopes
impl Unpin for Scopes
impl UnwindSafe for Scopes
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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