reprtree detach add list types

This commit is contained in:
Michael Sippel 2024-09-01 23:23:03 +02:00
parent ca5ba52e53
commit 7a8a37d334
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -19,7 +19,7 @@ use {
sync::{Arc, RwLock}, sync::{Arc, RwLock},
any::Any any::Any
}, },
super::{Context, ReprLeaf, ReprTreeExt, context::{TYPEID_vec, TYPEID_char, TYPEID_u64, TYPEID_edittree}} super::{Context, ReprLeaf, ReprTreeExt, context::{TYPEID_list, TYPEID_vec, TYPEID_char, TYPEID_u64, TYPEID_edittree}}
}; };
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>> //<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
@ -285,8 +285,26 @@ impl ReprTree {
]) { ]) {
leaf.detach_vec::< u64 >(); leaf.detach_vec::< u64 >();
} }
else if self.type_tag == TypeTerm::App(vec![
TypeTerm::TypeID(TYPEID_list),
TypeTerm::TypeID(TYPEID_edittree),
]) {
leaf.detach::< dyn ListView<Arc<RwLock<crate::edit_tree::EditTree>>> >();
}
else if self.type_tag == TypeTerm::App(vec![
TypeTerm::TypeID(TYPEID_list),
TypeTerm::TypeID(TYPEID_char),
]) {
leaf.detach::< dyn ListView<char> >();
}
else if self.type_tag == TypeTerm::App(vec![
TypeTerm::TypeID(TYPEID_list),
TypeTerm::TypeID(TYPEID_u64),
]) {
leaf.detach::< dyn ListView<u64> >();
}
else { else {
eprintln!("cant detach type"); eprintln!("cant detach type {}", ctx.read().unwrap().type_term_to_str(&self.type_tag));
} }
} }