export vars fixed. tests pass
This commit is contained in:
parent
307101327c
commit
1b1ac3cd2b
3 changed files with 17 additions and 7 deletions
10
src/eval.rs
10
src/eval.rs
|
|
@ -46,19 +46,19 @@ pub fn eval(
|
|||
|
||||
// another check to detect if we may have a function call
|
||||
if let Ctr::Symbol(ref tok) = car {
|
||||
match cdr {
|
||||
match cdr.clone() {
|
||||
Ctr::Seg(ast) => {
|
||||
if let Some(func) = funcs.borrow().get(tok) {
|
||||
return func_call(func.clone(), ast.clone(), vars.clone(), funcs.clone())
|
||||
} else {
|
||||
return Err(format!("Couldnt find function: {}.", tok))
|
||||
} else if !sym_loose {
|
||||
return Err(format!("Couldnt find definition of {}.", tok))
|
||||
}
|
||||
},
|
||||
Ctr::None => {
|
||||
if let Some(func) = funcs.borrow().get(tok) {
|
||||
return func_call(func.clone(), new_ast(Ctr::None, Ctr::None), vars.clone(), funcs.clone())
|
||||
} else {
|
||||
return Err(format!("Couldnt find function: {}.", tok))
|
||||
} else if !sym_loose {
|
||||
return Err(format!("Couldnt find definition of {}.", tok))
|
||||
}
|
||||
},
|
||||
_ => return Err(format!("Arguments to function not a list!"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue