luaur_analysis/records/
normalizer.rs1use crate::enums::solver_mode::SolverMode;
2use crate::records::builtin_types::BuiltinTypes;
3use crate::records::normalized_type::NormalizedType;
4use crate::records::type_arena::TypeArena;
5use crate::records::type_id_pair_hash::TypeIdPairHash;
6use crate::records::type_ids::TypeIds;
7use crate::records::unifier_shared_state::UnifierSharedState;
8use crate::type_aliases::type_id::TypeId;
9use crate::type_aliases::type_pack_id::TypePackId;
10use alloc::sync::Arc;
11use luaur_common::records::dense_hash_map::DenseHashMap;
12
13#[derive(Debug, Clone)]
14pub struct Normalizer {
15 pub(crate) cached_normals: alloc::collections::BTreeMap<TypeId, Arc<NormalizedType>>,
16 pub(crate) cached_intersections: alloc::collections::BTreeMap<*const TypeIds, TypeId>,
17 pub(crate) cached_unions: alloc::collections::BTreeMap<*const TypeIds, TypeId>,
18 pub(crate) cached_type_ids: alloc::collections::BTreeMap<*const TypeIds, Box<TypeIds>>,
19 pub(crate) cached_is_inhabited: DenseHashMap<TypeId, bool>,
20 pub(crate) cached_is_inhabited_intersection:
21 DenseHashMap<(TypeId, TypeId), bool, TypeIdPairHash>,
22 pub(crate) fuel: Option<i32>,
23 pub(crate) arena: *mut TypeArena,
24 pub(crate) builtin_types: *mut BuiltinTypes,
25 pub(crate) shared_state: *mut UnifierSharedState,
26 pub(crate) cache_inhabitance: bool,
27 pub(crate) solver_mode: SolverMode,
28}