fix issue with env var to sym table sync
Signed-off-by: Ava Hahn <ava@sunnypup.io>
This commit is contained in:
parent
6d68e6f91c
commit
c2cc8571bc
1 changed files with 7 additions and 3 deletions
|
|
@ -56,7 +56,7 @@ pub fn eval_callback(ast: &Seg, syms: &mut SymTable) -> Result<Ctr, String> {
|
||||||
* kept here for reference purposes since I have gone back and forth on this
|
* kept here for reference purposes since I have gone back and forth on this
|
||||||
* a bit
|
* a bit
|
||||||
*
|
*
|
||||||
* thanks you for your patience (ava)
|
* thank you for your patience (ava)
|
||||||
|
|
||||||
match arguments {
|
match arguments {
|
||||||
Ctr::Seg(ref s) => Ok(*eval(s, syms)?.clone()),
|
Ctr::Seg(ref s) => Ok(*eval(s, syms)?.clone()),
|
||||||
|
|
@ -353,7 +353,11 @@ pub fn store_callback(ast: &Seg, syms: &mut SymTable, env_cfg: bool) -> Result<C
|
||||||
Symbol::from_ast(&name, &docs, &outer_seg, None),
|
Symbol::from_ast(&name, &docs, &outer_seg, None),
|
||||||
);
|
);
|
||||||
if env_cfg {
|
if env_cfg {
|
||||||
env::set_var(name.clone(), var_val.to_string());
|
let mut s = var_val.to_string();
|
||||||
|
if let Ctr::String(tok) = var_val {
|
||||||
|
s = tok;
|
||||||
|
}
|
||||||
|
env::set_var(name.clone(), s);
|
||||||
}
|
}
|
||||||
return Ok(Ctr::None)
|
return Ok(Ctr::None)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue