Get the cell-relative index of a cell variable. Returns cellvar_idx. Fixed up to localsplus index during finalize.
(&mut self, name: &str)
| 777 | /// Get the cell-relative index of a cell variable. |
| 778 | /// Returns cellvar_idx. Fixed up to localsplus index during finalize. |
| 779 | fn get_cell_var_index(&mut self, name: &str) -> CompileResult<oparg::VarNum> { |
| 780 | let info = self.code_stack.last_mut().unwrap(); |
| 781 | let idx = info |
| 782 | .metadata |
| 783 | .cellvars |
| 784 | .get_index_of(name) |
| 785 | .unwrap_or_else(|| info.metadata.cellvars.insert_full(name.to_owned()).0); |
| 786 | Ok(idx.to_u32().into()) |
| 787 | } |
| 788 | |
| 789 | /// Get the index of a local variable. |
| 790 | fn get_local_var_index(&mut self, name: &str) -> CompileResult<oparg::VarNum> { |
no test coverage detected