@@ -38,6 +38,11 @@ enum class instruction_t : byte {
|
|||||||
*/
|
*/
|
||||||
Get,
|
Get,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets an array element.
|
||||||
|
*/
|
||||||
|
Set,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Pops top element from the stack.
|
* @brief Pops top element from the stack.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -161,6 +161,12 @@ void executor::step() {
|
|||||||
auto array = pop_thing();
|
auto array = pop_thing();
|
||||||
push_thing(array->at(index->integer()));
|
push_thing(array->at(index->integer()));
|
||||||
} break;
|
} break;
|
||||||
|
case instruction_t::Set: {
|
||||||
|
auto index = pop_thing();
|
||||||
|
auto array = pop_thing();
|
||||||
|
auto element = pop_thing();
|
||||||
|
array->at(index->integer()) = std::move(element->clone());
|
||||||
|
} break;
|
||||||
case instruction_t::Drop: {
|
case instruction_t::Drop: {
|
||||||
pop_thing();
|
pop_thing();
|
||||||
} break;
|
} break;
|
||||||
|
|||||||
Reference in New Issue
Block a user