MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / resolve_local

Method resolve_local

aiscript-vm/src/compiler/codegen.rs:1659–1664  ·  view source on GitHub ↗

Resolve a local variable by name, return its index and depth.

(&mut self, name: &str)

Source from the content-addressed store, hash-verified

1657
1658 // Resolve a local variable by name, return its index and depth.
1659 fn resolve_local(&mut self, name: &str) -> Option<(u8, isize, Mutability)> {
1660 (0..self.local_count)
1661 .rev()
1662 .find(|&i| self.locals[i].name.lexeme == name)
1663 .map(|i| (i as u8, self.locals[i].depth, self.locals[i].mutability))
1664 }
1665
1666 fn resolve_upvalue(
1667 &mut self,

Callers 2

named_variableMethod · 0.80
resolve_upvalueMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected