cl_structures: Rename deprecated_intern_pool to the more correct name "IndexMap"

Also, reverse the order of generic args, to make them consistent with other map collections
This commit is contained in:
2024-05-19 14:51:14 -05:00
parent 0cc0cb5cfb
commit fa8a71addc
5 changed files with 49 additions and 51 deletions

View File

@@ -1,7 +1,7 @@
use cl_structures::deprecated_intern_pool::*;
use cl_structures::index_map::*;
// define the index types
make_intern_key! {
make_index! {
/// Uniquely represents a [Def][1] in the [Def][1] [Pool]
///
/// [1]: crate::definition::Def

View File

@@ -1,7 +1,7 @@
//! A [Module] is a node in the Module Tree (a component of a
//! [Project](crate::project::Project))
use cl_ast::Sym;
use cl_structures::deprecated_intern_pool::InternKey;
use cl_structures::index_map::MapIndex;
use crate::key::DefID;
use std::collections::HashMap;

View File

@@ -7,7 +7,7 @@ use crate::{
path::Path,
};
use cl_ast::PathPart;
use cl_structures::deprecated_intern_pool::Pool;
use cl_structures::index_map::IndexMap;
use std::{
collections::HashMap,
ops::{Index, IndexMut},
@@ -17,7 +17,7 @@ use self::evaluate::EvaluableTypeExpression;
#[derive(Clone, Debug)]
pub struct Project<'a> {
pub pool: Pool<Def<'a>, DefID>,
pub pool: IndexMap<DefID, Def<'a>>,
/// Stores anonymous tuples, function pointer types, etc.
pub anon_types: HashMap<TypeKind, DefID>,
pub root: DefID,
@@ -33,7 +33,7 @@ impl Default for Project<'_> {
fn default() -> Self {
const ROOT_PATH: cl_ast::Path = cl_ast::Path { absolute: true, parts: Vec::new() };
let mut pool = Pool::default();
let mut pool = IndexMap::default();
let root = pool.insert(Def {
module: Default::default(),
kind: DefKind::Type(TypeKind::Module),