luaur-analysis 0.1.1

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::records::binding::Binding;
use crate::records::scope::Scope;
use crate::records::symbol::Symbol;
use crate::type_aliases::type_id::TypeId;

impl Scope {
    pub fn lookup_symbol(&self, sym: Symbol) -> Option<TypeId> {
        let mut mutable_self = self as *const Scope as *mut Scope;
        let r = unsafe { (*mutable_self).lookup_ex_symbol(sym) };

        if let Some((binding, _)) = r {
            Some(unsafe { (*binding).type_id })
        } else {
            None
        }
    }
}