mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-15 01:45:02 +01:00
20 lines
407 B
Rust
20 lines
407 B
Rust
use crate::bytecode::FnBlock;
|
|
use crate::gc::RtAlloc;
|
|
|
|
type VmResult = Result<(), ()>;
|
|
|
|
pub fn execute<'bc>(bytecode: &'bc [FnBlock<'bc>], alloc: RtAlloc) -> Result<(), ()> {
|
|
let _vm = Vm {
|
|
blocks: bytecode,
|
|
current: bytecode.first().ok_or(())?,
|
|
alloc,
|
|
};
|
|
|
|
Ok(())
|
|
}
|
|
|
|
struct Vm<'bc> {
|
|
blocks: &'bc [FnBlock<'bc>],
|
|
current: &'bc FnBlock<'bc>,
|
|
alloc: RtAlloc,
|
|
}
|