pub struct Frontend {Show 20 fields
pub use_new_luau_solver: AtomicI32,
pub environments: HashMap<String, ScopePtr>,
pub builtin_definitions: HashMap<String, Rc<dyn Fn(&mut Frontend, &mut GlobalTypes, ScopePtr)>>,
pub builtin_types_: BuiltinTypes,
pub builtin_types: *mut BuiltinTypes,
pub file_resolver: *mut FileResolver,
pub module_resolver: FrontendModuleResolver,
pub module_resolver_for_autocomplete: FrontendModuleResolver,
pub globals: GlobalTypes,
pub globals_for_autocomplete: GlobalTypes,
pub config_resolver: *mut ConfigResolver,
pub options: FrontendOptions,
pub ice_handler: InternalErrorReporter,
pub prepare_module_scope: Option<Rc<dyn Fn(&ModuleName, &ScopePtr, bool)>>,
pub write_json_log: Option<Rc<dyn Fn(&ModuleName, String)>>,
pub source_nodes: HashMap<ModuleName, Arc<SourceNode>>,
pub source_modules: HashMap<ModuleName, Arc<SourceModule>>,
pub require_trace: HashMap<ModuleName, RequireTraceResult>,
pub stats: FrontendStats,
pub module_queue: Vec<ModuleName>,
}Fields§
§use_new_luau_solver: AtomicI32§environments: HashMap<String, ScopePtr>§builtin_definitions: HashMap<String, Rc<dyn Fn(&mut Frontend, &mut GlobalTypes, ScopePtr)>>§builtin_types_: BuiltinTypes§builtin_types: *mut BuiltinTypes§file_resolver: *mut FileResolver§module_resolver: FrontendModuleResolver§module_resolver_for_autocomplete: FrontendModuleResolver§globals: GlobalTypes§globals_for_autocomplete: GlobalTypes§config_resolver: *mut ConfigResolver§options: FrontendOptions§ice_handler: InternalErrorReporter§prepare_module_scope: Option<Rc<dyn Fn(&ModuleName, &ScopePtr, bool)>>§write_json_log: Option<Rc<dyn Fn(&ModuleName, String)>>§source_nodes: HashMap<ModuleName, Arc<SourceNode>>§source_modules: HashMap<ModuleName, Arc<SourceModule>>§require_trace: HashMap<ModuleName, RequireTraceResult>§stats: FrontendStats§module_queue: Vec<ModuleName>Implementations§
Source§impl Frontend
impl Frontend
pub fn add_build_queue_items( &mut self, items: &mut Vec<BuildQueueItem>, build_queue: &Vec<ModuleName>, cycle_detected: bool, seen: &mut DenseHashSet<ModuleName>, frontend_options: &FrontendOptions, )
Source§impl Frontend
impl Frontend
pub fn all_module_dependencies_valid( &self, name: &ModuleName, for_autocomplete: bool, ) -> bool
Source§impl Frontend
impl Frontend
pub fn apply_builtin_definition_to_environment( &mut self, environment_name: String, definition_name: String, )
Source§impl Frontend
impl Frontend
pub fn check_build_queue_item(&mut self, item: &mut BuildQueueItem)
Source§impl Frontend
impl Frontend
pub fn check_build_queue_items(&mut self, items: &mut Vec<BuildQueueItem>)
Source§impl Frontend
impl Frontend
pub fn check_module_name_optional_frontend_options( &mut self, name: &ModuleName, option_override: Option<FrontendOptions>, ) -> CheckResult
Source§impl Frontend
impl Frontend
pub fn check_source_module_mode_vector_require_cycle_optional_scope_ptr_bool_bool_frontend_stats_type_check_limits( &mut self, source_module: &SourceModule, mode: Mode, require_cycles: Vec<RequireCycle>, environment_scope: Option<ScopePtr>, for_autocomplete: bool, record_json_log: bool, stats: &mut FrontendStats, type_check_limits: TypeCheckLimits, ) -> ModulePtr
Source§impl Frontend
impl Frontend
pub fn classify_lints( &self, warnings: &Vec<LintWarning>, config: &Config, ) -> LintResult
Source§impl Frontend
impl Frontend
pub fn clear_builtin_environments(&mut self)
Source§impl Frontend
impl Frontend
pub fn clear_stats(&mut self)
Source§impl Frontend
impl Frontend
Sourcepub fn frontend_solver_mode_file_resolver_config_resolver_frontend_options(
mode: SolverMode,
file_resolver: *mut FileResolver,
config_resolver: *mut ConfigResolver,
options: FrontendOptions,
) -> Self
pub fn frontend_solver_mode_file_resolver_config_resolver_frontend_options( mode: SolverMode, file_resolver: *mut FileResolver, config_resolver: *mut ConfigResolver, options: FrontendOptions, ) -> Self
Owned constructor for Frontend::Frontend(SolverMode, FileResolver*, ConfigResolver*, FrontendOptions).
The C++ member-init list wires several self-referential pointers:
builtinTypes(NotNull{&builtinTypes_}), moduleResolver(this),
moduleResolverForAutocomplete(this), and the two GlobalTypes members
capture builtinTypes (i.e. &builtinTypes_). None of those can be set
here because the returned value is moved into its final slot, so they are
left null/dangling-free and wired by Frontend::wire_self_pointers
once the Frontend lives at a stable address.
builtinTypes_’s arena is heap-boxed, so moving the BuiltinTypes value
itself is sound; GlobalTypes::new runs its arena mutations through the
temporary &builtinTypes_ pointer (valid for the duration of this call),
and only the cached builtin_types back-pointer is re-pointed afterward.
Sourcepub unsafe fn wire_self_pointers(&mut self)
pub unsafe fn wire_self_pointers(&mut self)
Wires the self-referential pointers the C++ Frontend member-init list
sets in place: builtinTypes(&builtinTypes_), the two GlobalTypes’
captured builtinTypes, and moduleResolver(this) /
moduleResolverForAutocomplete(this).
Must be called once the Frontend is at its final address and before any
use of builtin_types, globals.builtin_types, or the module resolvers.
§Safety
The Frontend must not be moved after this call, or the wired pointers
dangle.
Source§impl Frontend
impl Frontend
Sourcepub fn frontend_file_resolver_config_resolver_frontend_options(
file_resolver: *mut FileResolver,
config_resolver: *mut ConfigResolver,
options: &FrontendOptions,
) -> Self
pub fn frontend_file_resolver_config_resolver_frontend_options( file_resolver: *mut FileResolver, config_resolver: *mut ConfigResolver, options: &FrontendOptions, ) -> Self
Owned constructor delegating to the SolverMode-taking ctor. The only
difference from C++ ctor #1 is the solver mode is derived from the
LuauSolverV2 fast flag: useNewLuauSolver(FFlag::LuauSolverV2 ? SolverMode::New : SolverMode::Old).
As with the other ctor, the returned value’s self-referential pointers
are wired by Frontend::wire_self_pointers after placement.