Add some base VM implementations
Some instructions are currently implemented. Others are not. This is mostly just a checkpoint so I can implement lexical name definitions. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -206,6 +206,12 @@ impl Visit for CompileBody<'_, '_> {
|
||||
fn visit_atom(&mut self, atom: &Atom) -> Self::Out {
|
||||
let thunk = match atom {
|
||||
Atom::Ident(ident) => {
|
||||
// TODO : set up lexical name stack
|
||||
// - think about how lexical names in function defs need to be captured, so no
|
||||
// references get prematurely GC'd
|
||||
// - Python uses LOAD_CLOSURE and CREATE_FUNCTION ops, but is this necessary if we
|
||||
// know the names being closed over at runtime? Hm.
|
||||
|
||||
// get local
|
||||
Inst::PushLocal(global_sym(ident.to_string())).into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user