Get the index of a local variable.
(&mut self, name: &str)
| 788 | |
| 789 | /// Get the index of a local variable. |
| 790 | fn get_local_var_index(&mut self, name: &str) -> CompileResult<oparg::VarNum> { |
| 791 | let info = self.code_stack.last_mut().unwrap(); |
| 792 | let idx = info |
| 793 | .metadata |
| 794 | .varnames |
| 795 | .get_index_of(name) |
| 796 | .unwrap_or_else(|| info.metadata.varnames.insert_full(name.to_owned()).0); |
| 797 | Ok(idx.to_u32().into()) |
| 798 | } |
| 799 | |
| 800 | /// Get the index of a global name. |
| 801 | fn get_global_name_index(&mut self, name: &str) -> u32 { |
no test coverage detected