diff --git a/lib-nested-core/src/repr_tree/context.rs b/lib-nested-core/src/repr_tree/context.rs index b592ae0..e7cad72 100644 --- a/lib-nested-core/src/repr_tree/context.rs +++ b/lib-nested-core/src/repr_tree/context.rs @@ -1,9 +1,15 @@ use { - r3vi::{view::{OuterViewPort, singleton::*}, buffer::{singleton::*}}, - laddertypes::{TypeDict, TypeTerm, TypeID, MorphismType, MorphismBase, Morphism}, crate::{ - repr_tree::{ReprTree, ReprTreeExt, GenericReprTreeMorphism}, - edit_tree::EditTree + edit_tree::EditTree, + repr_tree::{GenericReprTreeMorphism, ReprTree, ReprTreeExt}, + }, + laddertypes::{ + parser::ParseLadderType, sugar::SugaredTypeTerm, unparser::UnparseLadderType, + BimapTypeDict, Morphism, MorphismBase, MorphismType, TypeDict, TypeID, TypeTerm, + }, + r3vi::{ + buffer::singleton::*, + view::{singleton::*, OuterViewPort}, }, std::{ collections::HashMap, @@ -24,7 +30,7 @@ pub static TYPEID_vec : TypeID = TypeID::Fun(4); #[derive(Clone)] pub struct Context { /// assigns a name to every type - pub type_dict: Arc>, + pub type_dict: Arc>, pub morphisms: laddertypes::morphism::MorphismBase< GenericReprTreeMorphism >, @@ -53,12 +59,12 @@ impl Context { type_dict: match parent.as_ref() { Some(p) => p.read().unwrap().type_dict.clone(), None => { - let mut dict = TypeDict::new(); - assert_eq!( TYPEID_edittree, dict.add_typename("EditTree".into()) ); - assert_eq!( TYPEID_char, dict.add_typename("Char".into()) ); - assert_eq!( TYPEID_u64, dict.add_typename("machine.UInt64".into()) ); - assert_eq!( TYPEID_list, dict.add_typename("List".into()) ); - assert_eq!( TYPEID_vec, dict.add_typename("Vec".into()) ); + let mut dict = BimapTypeDict::new(); + assert_eq!(TYPEID_edittree, dict.add_typename("EditTree".into())); + assert_eq!(TYPEID_char, dict.add_typename("Char".into())); + assert_eq!(TYPEID_u64, dict.add_typename("machine.UInt64".into())); + assert_eq!(TYPEID_list, dict.add_typename("List".into())); + assert_eq!(TYPEID_vec, dict.add_typename("Vec".into())); Arc::new(RwLock::new(dict)) }