fix docs, and init stdlib when configuring
This commit is contained in:
parent
1b1ac3cd2b
commit
827458b06f
4 changed files with 16 additions and 7 deletions
|
|
@ -20,13 +20,20 @@ use crate::func::{FTable, Args, Function, Operation, func_declare};
|
|||
use crate::segment::{Ast, Ctr};
|
||||
use crate::lex::lex;
|
||||
use crate::eval::eval;
|
||||
use crate::stl::get_stdlib;
|
||||
use std::rc::Rc;
|
||||
use std::cell::RefCell;
|
||||
use std::fs;
|
||||
|
||||
pub fn configure(filename: String, vars: Rc<RefCell<VTable>>, funcs: Rc<RefCell<FTable>>) {
|
||||
define(vars.clone(), String::from("CFG_RELISH_POSIX"), Rc::new(Ctr::String(String::from("1"))));
|
||||
pub fn configure(filename: String, vars: Rc<RefCell<VTable>>, mut funcs: Rc<RefCell<FTable>>) {
|
||||
define(vars.clone(), String::from("CFG_RELISH_POSIX"), Rc::new(Ctr::String(String::from("0"))));
|
||||
define(vars.clone(), String::from("CFG_RELISH_ENV"), Rc::new(Ctr::String(String::from("1"))));
|
||||
|
||||
match get_stdlib(vars.clone()) {
|
||||
Ok(f) => funcs = f,
|
||||
Err(s) => println!("{}", s)
|
||||
}
|
||||
|
||||
func_declare(funcs.clone(), Rc::new(RefCell::new(Function{
|
||||
name: String::from("CFG_RELISH_PROMPT"),
|
||||
loose_syms: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue