diff --git a/lib-nested-core/src/editors/list/ctx.rs b/lib-nested-core/src/editors/list/ctx.rs index 0d38e7a..0107124 100644 --- a/lib-nested-core/src/editors/list/ctx.rs +++ b/lib-nested-core/src/editors/list/ctx.rs @@ -84,6 +84,20 @@ pub fn init_ctx(ctx: Arc>) { } ); + let seq_morph_to_list_char = GenericReprTreeMorphism::new( + Context::parse(&ctx, ""), + Context::parse(&ctx, "~"), + { + let ctx = ctx.clone(); + move |src_rt, σ| { + src_rt.attach_leaf_to( + Context::parse(&ctx, ""), + src_rt.view_seq::().to_list() + ); + } + } + ); + let list_morph_to_vec_char = GenericReprTreeMorphism::new( Context::parse(&ctx, ""), Context::parse(&ctx, "~"), @@ -98,6 +112,34 @@ pub fn init_ctx(ctx: Arc>) { } ); + let seq_morph_to_list_u64 = GenericReprTreeMorphism::new( + Context::parse(&ctx, ""), + Context::parse(&ctx, "~"), + { + let ctx = ctx.clone(); + move |src_rt, σ| { + src_rt.attach_leaf_to( + Context::parse(&ctx, ""), + src_rt.view_seq::().to_list() + ); + } + } + ); + + let list_morph_to_vec_u64 = GenericReprTreeMorphism::new( + Context::parse(&ctx, ""), + Context::parse(&ctx, "~"), + { + let ctx = ctx.clone(); + move |src_rt, σ| { + src_rt.attach_leaf_to( + Context::parse(&ctx, ""), + src_rt.view_list::() + ); + } + } + ); + let list_morph_from_vec_char = GenericReprTreeMorphism::new( Context::parse(&ctx, "~"), Context::parse(&ctx, ""), @@ -129,7 +171,10 @@ pub fn init_ctx(ctx: Arc>) { ctx.write().unwrap().morphisms.add_morphism( list_morph_editsetup1 ); ctx.write().unwrap().morphisms.add_morphism( list_morph_editsetup3 ); ctx.write().unwrap().morphisms.add_morphism( list_morph_from_vec_char ); + ctx.write().unwrap().morphisms.add_morphism( seq_morph_to_list_char ); + ctx.write().unwrap().morphisms.add_morphism( seq_morph_to_list_u64 ); ctx.write().unwrap().morphisms.add_morphism( list_morph_to_vec_char ); + ctx.write().unwrap().morphisms.add_morphism( list_morph_to_vec_u64 ); ctx.write().unwrap().morphisms.add_morphism( list_morph_to_vec_edittree ); }