MCPcopy Index your code
hub / github.com/endbasic/endbasic / get_local_or_global

Method get_local_or_global

core/src/compiler/syms.rs:362–368  ·  view source on GitHub ↗

Gets a symbol by its `vref`, looking for it in the local and global scopes.

(&self, vref: &VarRef)

Source from the content-addressed store, hash-verified

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>> {

Callers 15

compile_exprFunction · 0.80
compile_assignmentFunction · 0.80
compile_forFunction · 0.80
compile_stmtFunction · 0.80
test_local_put_and_getFunction · 0.80
test_local_get_undefinedFunction · 0.80
test_fixup_local_typeFunction · 0.80

Calls 2

get_varFunction · 0.85
get_globalMethod · 0.45