add more unit tests for function calls
This commit is contained in:
parent
a6abc993a5
commit
9b981921b4
4 changed files with 339 additions and 19 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue