finally figure out how to hold closures

This commit is contained in:
Aidan Hahn 2022-01-16 22:01:42 -08:00
parent 69f31db23b
commit f805290a4b
No known key found for this signature in database
GPG key ID: 327711E983899316
8 changed files with 98 additions and 89 deletions

View file

@ -16,8 +16,8 @@
*/
use crate::segment::{Ctr};
//use crate::str::{get_echo, get_concat};
//use crate::append::get_append;
use crate::str::{get_echo, get_concat};
use crate::append::get_append;
use crate::func::{FTable, func_declare};
use crate::vars::{VTable, get_export};
use std::rc::Rc;
@ -25,7 +25,7 @@ use std::cell::RefCell;
pub fn get_stdlib(conf: Rc<RefCell<VTable>>) -> Result<Rc<RefCell<FTable>>, String> {
let ft = Rc::new(RefCell::new(FTable::new()));
/* if let Some(s) = func_declare(ft.clone(), Rc::new(RefCell::new(get_echo()))) {
if let Some(s) = func_declare(ft.clone(), Rc::new(RefCell::new(get_echo()))) {
return Err(s)
}
if let Some(s) = func_declare(ft.clone(), Rc::new(RefCell::new(get_append()))) {
@ -33,7 +33,7 @@ pub fn get_stdlib(conf: Rc<RefCell<VTable>>) -> Result<Rc<RefCell<FTable>>, Stri
}
if let Some(s) = func_declare(ft.clone(), Rc::new(RefCell::new(get_concat()))) {
return Err(s)
}*/
}
let mut cfg_env = true;
match conf.borrow().get(&String::from("CFG_RELISH_ENV")) {