luaur-compiler 0.1.3

Luau source-to-bytecode compiler (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::records::compiler::Compiler;
use luaur_ast::records::ast_local::AstLocal;

impl Compiler {
    pub fn get_local_reg(&mut self, local: *mut AstLocal) -> i32 {
        match self.locals.find(&local) {
            Some(l) if l.allocated => i32::from(l.reg),
            _ => -1,
        }
    }
}