luaur-analysis 0.1.3

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::records::mapped_generic_environment::MappedGenericEnvironment;
use luaur_common::macros::luau_assert::LUAU_ASSERT;

impl MappedGenericEnvironment {
    pub fn pop_frame(&mut self) {
        LUAU_ASSERT!(self.current_scope_index.is_some());
        if let Some(current_scope_index) = self.current_scope_index {
            let new_frame_index = self.frames[current_scope_index].parent_scope_index;
            self.current_scope_index = new_frame_index.unwrap_or(0 as usize).into();
        }
    }
}