Skip to main content

luaur_compiler/methods/
compiler_get_local_reg.rs

1use crate::records::compiler::Compiler;
2use luaur_ast::records::ast_local::AstLocal;
3
4impl Compiler {
5    pub fn get_local_reg(&mut self, local: *mut AstLocal) -> i32 {
6        match self.locals.find(&local) {
7            Some(l) if l.allocated => i32::from(l.reg),
8            _ => -1,
9        }
10    }
11}