move identids into Scope

This commit is contained in:
Folkert 2022-04-28 21:08:28 +02:00
parent 37cb9279f5
commit 7fb5b23fb0
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
10 changed files with 123 additions and 181 deletions

View file

@ -107,9 +107,7 @@ impl GeneratedInfo {
env.problem(Problem::UnknownGeneratesWith(unknown));
}
let effect_symbol = scope
.introduce(name.into(), &mut env.ident_ids, Region::zero())
.unwrap();
let effect_symbol = scope.introduce(name.into(), Region::zero()).unwrap();
{
let a_var = var_store.fresh();
@ -409,7 +407,7 @@ pub fn canonicalize_module_defs<'a>(
let symbol = def.pattern_vars.iter().next().unwrap().0;
let ident_id = symbol.ident_id();
let ident =
env.ident_ids.get_name(ident_id).unwrap().to_string();
scope.ident_ids.get_name(ident_id).unwrap().to_string();
let def_annotation = def.annotation.clone().unwrap();
let annotation = crate::annotation::Annotation {
typ: def_annotation.signature,
@ -537,6 +535,8 @@ pub fn canonicalize_module_defs<'a>(
}
}
let ident_ids = scope.ident_ids.clone();
let output = ModuleOutput {
scope,
aliases,
@ -547,7 +547,7 @@ pub fn canonicalize_module_defs<'a>(
exposed_imports: can_exposed_imports,
problems: env.problems,
lookups,
ident_ids: env.ident_ids,
ident_ids,
};
Ok(output)