Add module_path to can env instead of threading it through

This commit is contained in:
Agus Zubiaga 2024-04-21 10:30:34 -03:00
parent e5789158e5
commit 5112e064e5
No known key found for this signature in database
7 changed files with 76 additions and 194 deletions

View file

@ -1,3 +1,5 @@
use std::path::Path;
use crate::procedure::References;
use crate::scope::Scope;
use bumpalo::Bump;
@ -13,6 +15,8 @@ pub struct Env<'a> {
/// are assumed to be relative to this path.
pub home: ModuleId,
pub module_path: &'a Path,
pub dep_idents: &'a IdentIdsByModule,
pub qualified_module_ids: &'a PackageModuleIds<'a>,
@ -43,6 +47,7 @@ impl<'a> Env<'a> {
pub fn new(
arena: &'a Bump,
home: ModuleId,
module_path: &'a Path,
dep_idents: &'a IdentIdsByModule,
qualified_module_ids: &'a PackageModuleIds<'a>,
opt_shorthand: Option<&'a str>,
@ -50,6 +55,7 @@ impl<'a> Env<'a> {
Env {
arena,
home,
module_path,
dep_idents,
qualified_module_ids,
problems: Vec::new(),