luaur-analysis 0.1.3

Luau type checker and type inference (Rust).
Documentation
use crate::records::dfg_scope::DfgScope;
use crate::records::symbol::Symbol;
use crate::type_aliases::def_id_def::DefId;

impl DfgScope {
    pub fn lookup_symbol(&self, symbol: Symbol) -> Option<DefId> {
        let mut current = self as *const DfgScope;
        unsafe {
            while !current.is_null() {
                if let Some(def) = (*current).bindings.find(&symbol) {
                    return Some(*def);
                }

                current = (*current).parent as *const DfgScope;
            }
        }

        None
    }
}