in progress work with scaffolding for environment integration
This commit is contained in:
parent
c465c974d4
commit
5aa2b27343
1 changed files with 10 additions and 2 deletions
12
src/vars.rs
12
src/vars.rs
|
|
@ -18,6 +18,7 @@
|
|||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use crate::segment::{Ctr, Ast};
|
||||
use crate::eval::eval;
|
||||
use crate::func::{Function, Operation, Args, FTable};
|
||||
|
|
@ -38,7 +39,6 @@ pub fn define(
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Accept bool config value for env vars
|
||||
pub fn get_export(env_cfg: bool) -> Function {
|
||||
return Function{
|
||||
name: String::from("export"),
|
||||
|
|
@ -57,12 +57,21 @@ pub fn get_export(env_cfg: bool) -> Function {
|
|||
Ctr::Seg(val) => {
|
||||
let val_tmp = val.borrow().clone();
|
||||
define(b, identifier.to_string(), Rc::new(val_tmp.car));
|
||||
if env_cfg {
|
||||
// set var in env
|
||||
// gotta distill value
|
||||
// env::set_var(identifier, VALUE)
|
||||
}
|
||||
},
|
||||
|
||||
_ => {
|
||||
eprintln!("impossible args to export");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Ctr::None => {
|
||||
// UNSET VAR LOGIC
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -73,7 +82,6 @@ pub fn get_export(env_cfg: bool) -> Function {
|
|||
return Ctr::None;
|
||||
},
|
||||
_ => {
|
||||
println!("{:#?}", a);
|
||||
eprintln!("first argument to export must be a symbol");
|
||||
return Ctr::None;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue