add variable export function

This commit is contained in:
Aidan Hahn 2021-11-06 15:43:42 -07:00
parent 7ca42f18da
commit 0931fbdcf0
No known key found for this signature in database
GPG key ID: 327711E983899316
5 changed files with 102 additions and 6 deletions

View file

@ -18,6 +18,7 @@
use crate::str::{get_echo, get_concat};
use crate::append::get_append;
use crate::func::{FTable, func_declare};
use crate::vars::{get_export};
use std::rc::Rc;
use std::cell::RefCell;
@ -32,6 +33,9 @@ pub fn get_stdlib() -> Result<Rc<RefCell<FTable>>, String> {
if let Some(s) = func_declare(ft.clone(), Rc::new(RefCell::new(get_concat()))) {
return Err(s)
}
if let Some(s) = func_declare(ft.clone(), Rc::new(RefCell::new(get_export()))) {
return Err(s)
}
return Ok(ft)
}