add more unit tests for function calls

This commit is contained in:
Aidan 2021-06-06 10:24:19 -07:00
parent a6abc993a5
commit 9b981921b4
No known key found for this signature in database
GPG key ID: 327711E983899316
4 changed files with 339 additions and 19 deletions

View file

@ -23,6 +23,7 @@ pub type Ast = Rc<RefCell<Seg>>;
// Container
#[derive(Clone)]
#[derive(Debug)]
pub enum Ctr {
Symbol(String),
String(String),
@ -53,6 +54,7 @@ pub enum Type {
* how important RefCells were in Rust
*/
#[derive(Clone)]
#[derive(Debug)]
pub struct Seg {
/* "Contents of Address Register"
* Historical way of referring to the first value in a cell.
@ -215,7 +217,7 @@ pub fn list_idx(tree: Ast, idx: u128) -> Ctr {
match inner.car {
Ctr::None => Ctr::None,
_ => {
inner.cdr.clone()
inner.car.clone()
}
}
}