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

Method first

core/src/compiler/syms.rs:517–521  ·  view source on GitHub ↗

Returns the first register available for this scope.

(&mut self)

Source from the content-addressed store, hash-verified

515impl TempScope {
516 /// Returns the first register available for this scope.
517 pub(crate) fn first(&mut self) -> Result<Register> {
518 let reg = u8::try_from(usize::from(self.nlocals) + usize::from(self.base_temp))
519 .map_err(|_| Error::OutOfRegisters(RegisterScope::Temp))?;
520 Register::local(reg).map_err(|_| Error::OutOfRegisters(RegisterScope::Temp))
521 }
522
523 /// Allocates a new temporary register.
524 pub(crate) fn alloc(&mut self) -> Result<Register> {

Callers 5

compile_argsFunction · 0.80
callables_to_indexFunction · 0.80
newMethod · 0.80
parse_numeric_prefixFunction · 0.80
poly_pointsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected