pub struct SymbolTable {
pub outer: Option<Rc<SymbolTable>>,
pub free_symbols: Vec<Rc<Symbol>>,
pub definitions: Vec<Rc<Symbol>>,
pub num_definitions: usize,
/* private fields */
}Fields§
§outer: Option<Rc<SymbolTable>>§free_symbols: Vec<Rc<Symbol>>§definitions: Vec<Rc<Symbol>>Every slot-allocating definition of this scope in definition order, so
definitions[i].index == i. A rebinding appends a fresh entry instead
of replacing the shadowed slot’s entry, unlike symbols.
num_definitions: usizeImplementations§
Source§impl SymbolTable
impl SymbolTable
pub fn new() -> SymbolTable
pub fn new_enclosed_symbol_table(outer: SymbolTable) -> SymbolTable
pub fn define(&mut self, name: String) -> Rc<Symbol>
pub fn visible_names(&self) -> Vec<String>
Sourcepub fn global_definitions(&self) -> &[Rc<Symbol>]
pub fn global_definitions(&self) -> &[Rc<Symbol>]
The outermost scope’s definition ledger, in slot order. Unlike a view
derived from symbols, a rebound name appears once per slot it ever
occupied, which is what debug metadata needs.
pub fn resolve(&mut self, name: String) -> Option<Rc<Symbol>>
pub fn define_builtin(&mut self, index: usize, name: String) -> Rc<Symbol>
pub fn define_function_name(&mut self, name: String) -> Rc<Symbol>
pub fn define_free(&mut self, original: Rc<Symbol>) -> Rc<Symbol>
Trait Implementations§
Source§impl Clone for SymbolTable
impl Clone for SymbolTable
Source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SymbolTable
impl Debug for SymbolTable
Source§impl Default for SymbolTable
impl Default for SymbolTable
impl Eq for SymbolTable
Source§impl PartialEq for SymbolTable
impl PartialEq for SymbolTable
impl StructuralPartialEq for SymbolTable
Auto Trait Implementations§
impl !Send for SymbolTable
impl !Sync for SymbolTable
impl Freeze for SymbolTable
impl RefUnwindSafe for SymbolTable
impl Unpin for SymbolTable
impl UnsafeUnpin for SymbolTable
impl UnwindSafe for SymbolTable
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