mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-13 15:38:06 -05:00
Fixes to run the very first program: 5+7 -> 12
This commit is contained in:
@@ -37,13 +37,6 @@ impl VirtualMachine {
|
||||
while self.stack.len() > 0 {
|
||||
self.step();
|
||||
}
|
||||
|
||||
let a = VsNumber::from_f64(1_f64);
|
||||
let b = VsString::from_str("2");
|
||||
|
||||
std::println!("a + b = {}", op_plus(&a, &b));
|
||||
|
||||
std::panic!("Not implemented");
|
||||
}
|
||||
|
||||
pub fn new() -> VirtualMachine {
|
||||
|
||||
@@ -35,8 +35,8 @@ impl VsValue for VsFunction {
|
||||
fn push_frame(&self, vm: &mut VirtualMachine) -> bool {
|
||||
let mut registers: Vec<Val> = Vec::with_capacity(self.register_count - 1);
|
||||
|
||||
for i in 0..(self.register_count - 1) {
|
||||
registers[i] = VsUndefined::new();
|
||||
for _ in 0..(self.register_count - 1) {
|
||||
registers.push(VsUndefined::new());
|
||||
}
|
||||
|
||||
vm.stack.push(StackFrame {
|
||||
|
||||
Reference in New Issue
Block a user