.
This commit is contained in:
13
src/vm/vm.cc
13
src/vm/vm.cc
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user