Rename Located -> Loc

This commit is contained in:
Joshua Warner 2021-12-22 19:18:22 -08:00
parent c66c845cd2
commit f19220473a
55 changed files with 680 additions and 683 deletions

View file

@ -2,7 +2,7 @@ use roc_collections::all::{MutSet, SendMap};
use roc_module::ident::{Ident, Lowercase};
use roc_module::symbol::{IdentIds, ModuleId, Symbol};
use roc_problem::can::RuntimeError;
use roc_region::all::{Located, Region};
use roc_region::all::{Loc, Region};
use roc_types::subs::{VarStore, Variable};
use roc_types::types::{Alias, Type};
@ -41,7 +41,7 @@ impl Scope {
let mut type_variables: Vec<_> = free_vars.unnamed_vars.into_iter().collect();
type_variables.sort();
for (loc_name, (_, var)) in vars.iter().zip(type_variables) {
variables.push(Located::at(loc_name.region, (loc_name.value.clone(), var)));
variables.push(Loc::at(loc_name.region, (loc_name.value.clone(), var)));
}
let alias = Alias {
@ -87,7 +87,7 @@ impl Scope {
match self.idents.get(ident) {
Some((symbol, _)) => Ok(*symbol),
None => Err(RuntimeError::LookupNotInScope(
Located {
Loc {
region,
value: ident.clone(),
},
@ -110,10 +110,10 @@ impl Scope {
exposed_ident_ids: &IdentIds,
all_ident_ids: &mut IdentIds,
region: Region,
) -> Result<Symbol, (Region, Located<Ident>)> {
) -> Result<Symbol, (Region, Loc<Ident>)> {
match self.idents.get(&ident) {
Some((_, original_region)) => {
let shadow = Located {
let shadow = Loc {
value: ident,
region,
};
@ -172,7 +172,7 @@ impl Scope {
&mut self,
name: Symbol,
region: Region,
vars: Vec<Located<(Lowercase, Variable)>>,
vars: Vec<Loc<(Lowercase, Variable)>>,
typ: Type,
) {
let roc_types::types::VariableDetail {