mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Detect fx mode based on hosted module
This commit is contained in:
parent
fd3fb16f7a
commit
01c94050c8
9 changed files with 54 additions and 10 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue