This commit is contained in:
2026-05-02 08:30:33 -05:00
parent 728fc9d571
commit f16f2e0e8e
4 changed files with 19 additions and 0 deletions

View File

@@ -36,12 +36,25 @@ int32_t VM::to_integer(int index) const
return i.as_integer();
}
float VM::to_float(int index) const
{
Value i = stack_.at(index);
assert_type(i, Type::Float);
return i.as_float();
}
VM& VM::push_integer(int32_t value)
{
stack_.push(Value::CreateInteger(value));
return *this;
}
VM& VM::push_float(float value)
{
stack_.push(Value::CreateFloat(value));
return *this;
}
void VM::run_until_return()
{
size_t level = stack_.fp_level();