Baby steps towards handling non-val car/cdr (eventually cons)

This commit is contained in:
2023-03-22 01:06:24 -04:00
parent 85454fda79
commit 049624a840
2 changed files with 26 additions and 15 deletions

View File

@@ -51,6 +51,8 @@ fn basic_pe_test() {
let g = grammar::TermParser::new();
partial_eval_test(&g, "(+ 2 (car (cons 4 '(1 2))))", "6");
partial_eval_test(&g, "(vau 0 p (+ 1 2))", "NeededIds { heads: {}, tails: {}, body_stopped: {}, if_stopped: {} }#[None/None/EnvID(1)/0/[]/Some(\"p\")/3]");
partial_eval_test(&g, "(vau de p (+ (eval (car p) de) (eval (car (cdr p)) de)))", "NeededIds { heads: {}, tails: {}, body_stopped: {}, if_stopped: {} }#[None/Some(\"de\")/EnvID(1)/0/[]/Some(\"p\")/NeededIds { heads: {EnvID(1)}, tails: {}, body_stopped: {}, if_stopped: {} }#{<+0> NeededIds { heads: {EnvID(1)}, tails: {}, body_stopped: {}, if_stopped: {} }#{<eval0> Some(\"p\")(EnvID(1)0true) Some(\"de\")(EnvID(1)env)} NeededIds { heads: {EnvID(1)}, tails: {}, body_stopped: {}, if_stopped: {} }#{<eval0> Some(\"p\")(EnvID(1)1true) Some(\"de\")(EnvID(1)env)}}]");
}
#[test]