Detect fx mode based on hosted module

This commit is contained in:
Agus Zubiaga 2024-10-14 22:16:04 -03:00
parent fd3fb16f7a
commit 01c94050c8
No known key found for this signature in database
9 changed files with 54 additions and 10 deletions

View file

@ -45,6 +45,8 @@ pub struct Env<'a> {
pub opt_shorthand: Option<&'a str>,
pub fx_mode: FxMode,
pub src: &'a str,
/// Lazily calculated line info. This data is only needed if the code contains calls to `dbg`,
@ -62,6 +64,7 @@ impl<'a> Env<'a> {
dep_idents: &'a IdentIdsByModule,
qualified_module_ids: &'a PackageModuleIds<'a>,
opt_shorthand: Option<&'a str>,
fx_mode: FxMode,
) -> Env<'a> {
Env {
arena,
@ -79,6 +82,7 @@ impl<'a> Env<'a> {
home_params_record: None,
opt_shorthand,
line_info: arena.alloc(None),
fx_mode,
}
}
@ -237,3 +241,9 @@ impl<'a> Env<'a> {
self.line_info.as_ref().unwrap()
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum FxMode {
PurityInference,
Task,
}