This commit is contained in:
Andre Wagner
2026-04-29 16:46:05 -05:00
parent 3d4ce8cd15
commit 8720bd1cd9
3 changed files with 27 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
#include "vm.hh"
#include "vm_exceptions.hh"
namespace tyche {
void VM::load_bytecode(ByteArray const& ba)
@@ -10,7 +12,22 @@ void VM::load_bytecode(ByteArray const& ba)
void VM::call(size_t n_params)
{
// TODO
// TODO - parameters
Value f = stack_.pop();
if (f.type() != Type::Function)
throw VMTypeError(Type::Function, f.type());
loc_.emplace(f.as_function_id(), 0);
stack_.push_fp();
run_until_return();
stack_.pop_fp();
loc_.pop();
}
void VM::run_until_return()
{
}
} // tyche