Move ThunkBranch struct impl into Thunk::Branch

ThunkBranch standalone struct was not as useful as I was expecting it
would be. Its logic is now directly stored in Thunk::Branch variant

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-11-10 18:01:55 -08:00
parent 004f2b91f8
commit 2f99742e85
2 changed files with 14 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
use crate::{
compile::{Compile, thunk::{Thunk, ThunkBranch}},
compile::{Compile, thunk::Thunk},
obj::{prelude::*, reserved::*},
syn::{ast::*, visit::*},
vm::inst::Inst,
@@ -89,11 +89,11 @@ impl List {
]);
let thunk_true = body.thunkify(compile).into();
let thunk_false = el.thunkify(compile).into();
Thunk::Branch(ThunkBranch {
Thunk::Branch {
preamble: preamble.into(),
thunk_true,
thunk_false,
})
}
}
List::Lambda { params, expr } => {
// TODO(fun) : need captures for functions, built dynamically (or statically?)