forked from Orchid/orchid
bkp
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use orchid_extension::atom::AtomicFeatures;
|
||||
use orchid_extension::atom::{AtomDynfo, AtomicFeatures};
|
||||
use orchid_extension::fs::DeclFs;
|
||||
use orchid_extension::fun::Fun;
|
||||
use orchid_extension::system::{System, SystemCard};
|
||||
@@ -22,16 +22,25 @@ impl SystemCtor for StdSystem {
|
||||
}
|
||||
impl SystemCard for StdSystem {
|
||||
type Ctor = Self;
|
||||
const ATOM_DEFS: &'static [Option<fn() -> &'static orchid_extension::atom::AtomInfo>] = &[
|
||||
Some(StringAtom::info)
|
||||
];
|
||||
const ATOM_DEFS: &'static [Option<&'static dyn AtomDynfo>] = &[Some(StringAtom::INFO)];
|
||||
}
|
||||
impl System for StdSystem {
|
||||
fn lexers() -> Vec<orchid_extension::lexer::LexerObj> { vec![&StringLexer] }
|
||||
fn vfs() -> DeclFs { DeclFs::Mod(&[]) }
|
||||
fn env() -> GenTree {
|
||||
GenTree::module([("std", GenTree::module([("string", GenTree::module([
|
||||
("concat", GenTree::cnst(Fun::new(|left: OrcString| Fun::new(move |right: OrcString| StringAtom::new(Arc::new(left.get_string().to_string() + &right.get_string()))))))
|
||||
]))]))])
|
||||
GenTree::module([(
|
||||
"std",
|
||||
GenTree::module([(
|
||||
"string",
|
||||
GenTree::module([(
|
||||
"concat",
|
||||
GenTree::cnst(Fun::new(|left: OrcString| {
|
||||
Fun::new(move |right: OrcString| {
|
||||
StringAtom::new(Arc::new(left.get_string().to_string() + &right.get_string()))
|
||||
})
|
||||
})),
|
||||
)]),
|
||||
)]),
|
||||
)])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user