luaur-vm 0.1.1

The Luau register virtual machine and standard library (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::enums::lua_type::lua_Type;
use crate::macros::curr_func::curr_func;
use crate::records::lua_state::lua_State;
use crate::records::lua_table::LuaTable;

pub unsafe fn getcurrenv(l: *mut lua_State) -> *mut LuaTable {
    if (*l).ci == (*l).base_ci {
        (*l).gt
    } else {
        (*curr_func!(l)).env
    }
}