Struct rustpython_vm::compiler::codegen::symboltable::SymbolTable
source · pub struct SymbolTable {
pub name: String,
pub typ: SymbolTableType,
pub line_number: u32,
pub is_nested: bool,
pub symbols: IndexMap<String, Symbol, RandomState>,
pub sub_tables: Vec<SymbolTable, Global>,
}
Expand description
Captures all symbols in the current scope, and has a list of sub-scopes in this scope.
Fields§
§name: String
The name of this symbol table. Often the name of the class or function.
typ: SymbolTableType
The type of symbol table
line_number: u32
The line number in the source code where this symboltable begins.
is_nested: bool
§symbols: IndexMap<String, Symbol, RandomState>
A set of symbols present on this scope level.
sub_tables: Vec<SymbolTable, Global>
A list of sub-scopes in the order as found in the AST nodes.
Implementations§
source§impl SymbolTable
impl SymbolTable
pub fn scan_program( program: &[Stmt<SourceRange>] ) -> Result<SymbolTable, SymbolTableError>
pub fn scan_expr( expr: &Expr<SourceRange> ) -> Result<SymbolTable, SymbolTableError>
Trait Implementations§
source§impl Clone for SymbolTable
impl Clone for SymbolTable
source§fn clone(&self) -> SymbolTable
fn clone(&self) -> SymbolTable
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for SymbolTable
impl Send for SymbolTable
impl Sync for SymbolTable
impl Unpin 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