repl now complete
Signed-off-by: Ava Hahn <ava@aidanis.online>
This commit is contained in:
parent
fbb85f2e3d
commit
2439a37aaa
9 changed files with 188 additions and 123 deletions
11
src/stl.rs
11
src/stl.rs
|
|
@ -56,13 +56,20 @@ pub fn static_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
|||
/// dynamic_stdlib
|
||||
/// takes configuration data and uses it to insert dynamic
|
||||
/// callbacks with configuration into a symtable
|
||||
pub fn dynamic_stdlib(env: bool, syms: &mut SymTable) -> Result<(), String> {
|
||||
pub fn dynamic_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
||||
//get CFG_RELISH_ENV from syms
|
||||
let env_cfg_user_form = syms.call_symbol(
|
||||
&"CFG_RELISH_ENV".to_string(), &Seg::new(), true)
|
||||
.unwrap_or_else(|_: String| Box::new(Ctr::None))
|
||||
.to_string()
|
||||
.ne("");
|
||||
|
||||
syms.insert("def".to_string(), Symbol {
|
||||
name: String::from("define"),
|
||||
args: Args::Infinite,
|
||||
conditional_branches: true,
|
||||
value: ValueType::Internal(Rc::new( move |ast: &Seg, syms: &mut SymTable| -> Result<Ctr, String> {
|
||||
_store_callback(ast, syms, env)
|
||||
_store_callback(ast, syms, env_cfg_user_form)
|
||||
},
|
||||
)),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue