pub trait ScopeManager {
// Required methods
fn enter_scope(&mut self);
fn exit_scope(&mut self);
fn define_symbol(
&mut self,
name: String,
kind: SymbolKind,
type_id: TypeId,
is_mutable: bool,
) -> Result<(), String>;
}
Expand description
Trait for scope management operations
This trait abstracts scope lifecycle management, enabling different scoping strategies and easier testing.
Required Methods§
Sourcefn enter_scope(&mut self)
fn enter_scope(&mut self)
Enter a new scope
Sourcefn exit_scope(&mut self)
fn exit_scope(&mut self)
Exit the current scope
Sourcefn define_symbol(
&mut self,
name: String,
kind: SymbolKind,
type_id: TypeId,
is_mutable: bool,
) -> Result<(), String>
fn define_symbol( &mut self, name: String, kind: SymbolKind, type_id: TypeId, is_mutable: bool, ) -> Result<(), String>
Define a symbol in the current scope