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

Method leave_scope

crates/codegen/src/symboltable.rs:1082–1089  ·  view source on GitHub ↗

Pop symbol table and add to sub table of parent table.

(&mut self)

Source from the content-addressed store, hash-verified

1080
1081 /// Pop symbol table and add to sub table of parent table.
1082 fn leave_scope(&mut self) {
1083 let mut table = self.tables.pop().unwrap();
1084 // Save the collected varnames to the symbol table
1085 table.varnames = core::mem::take(&mut self.current_varnames);
1086 self.tables.last_mut().unwrap().sub_tables.push(table);
1087 // Restore parent's varnames
1088 self.current_varnames = self.varnames_stack.pop().unwrap_or_default();
1089 }
1090
1091 /// Enter annotation scope (PEP 649)
1092 /// Creates or reuses the annotation block for the current scope

Callers 4

scan_statementMethod · 0.80
scan_expressionMethod · 0.80
scan_comprehensionMethod · 0.80

Calls 4

takeFunction · 0.85
unwrapMethod · 0.45
popMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected