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

Method push_current_annotation_symbol_table

crates/codegen/src/compile.rs:863–876  ·  view source on GitHub ↗

Push the annotation symbol table for module/class level annotations This takes annotation_block from the current symbol table (not sub_tables)

(&mut self)

Source from the content-addressed store, hash-verified

861 /// Push the annotation symbol table for module/class level annotations
862 /// This takes annotation_block from the current symbol table (not sub_tables)
863 fn push_current_annotation_symbol_table(&mut self) -> bool {
864 let current_table = self
865 .symbol_table_stack
866 .last_mut()
867 .expect("no current symbol table");
868
869 // For modules/classes, annotation_block is directly in the current table
870 if let Some(annotation_block) = current_table.annotation_block.take() {
871 self.symbol_table_stack.push(*annotation_block);
872 true
873 } else {
874 false
875 }
876 }
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) {

Callers 1

Calls 2

takeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected