MCPcopy Index your code
hub / github.com/RustPython/RustPython / pop_annotation_symbol_table

Method pop_annotation_symbol_table

crates/codegen/src/compile.rs:879–891  ·  view source on GitHub ↗

Pop the annotation symbol table and restore it to the function scope's annotation_block

(&mut self)

Source from the content-addressed store, hash-verified

877
878 /// Pop the annotation symbol table and restore it to the function scope's annotation_block
879 fn pop_annotation_symbol_table(&mut self) {
880 let annotation_table = self.symbol_table_stack.pop().expect("compiler bug");
881 let current_table = self
882 .symbol_table_stack
883 .last_mut()
884 .expect("no current symbol table");
885
886 // Restore to the next sub_table (function scope) where it came from
887 let next_idx = current_table.next_sub_table;
888 if next_idx < current_table.sub_tables.len() {
889 current_table.sub_tables[next_idx].annotation_block = Some(Box::new(annotation_table));
890 }
891 }
892
893 /// Pop the current symbol table off the stack
894 fn pop_symbol_table(&mut self) -> SymbolTable {

Callers 1

exit_annotation_scopeMethod · 0.80

Calls 4

newFunction · 0.85
SomeClass · 0.50
popMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected