amvm 0.1.0

Apika's My Virtual Machine. A virtual machine with Intermediate Lenguage
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::runtime::AmvmResult;
use crate::{AmvmScope, Command, Value};

pub fn eval(scope: &mut AmvmScope, body: &Vec<Command>) -> AmvmResult {
    'l: loop {
        let mut scope = scope.create_sub(body.clone());

        for cmd in scope.body.clone().iter() {
            match super::eval(&mut scope, cmd) {
                Err(crate::runtime::AmvmPropagate::Break) => break 'l,
                _ => {}
            };
        }
    }

    Ok(Value::Null)
}