Gets a symbol by its `vref`, looking for it in the local and global scopes.
(&self, vref: &VarRef)
| 360 | |
| 361 | /// Gets a symbol by its `vref`, looking for it in the local and global scopes. |
| 362 | pub(crate) fn get_local_or_global(&self, vref: &VarRef) -> Result<(Register, SymbolPrototype)> { |
| 363 | match get_var(vref, &self.locals, Register::local, RegisterScope::Local) { |
| 364 | Ok(local) => Ok(local), |
| 365 | Err(Error::UndefinedSymbol(..)) => self.symtable.get_global(vref), |
| 366 | Err(e) => Err(e), |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | /// Gets a callable by its name `key`. |
| 371 | pub(crate) fn get_callable(&self, key: &SymbolKey) -> Option<Rc<CallableMetadata>> { |