12#ifndef ARK_VM_SCOPE_HPP
13#define ARK_VM_SCOPE_HPP
59 bool has(uint16_t
id)
noexcept;
82 std::size_t
size()
const noexcept;
88 std::vector<std::pair<uint16_t, Value>>
m_data;
The ArkScript virtual machine, executing ArkScript bytecode.
A class to handle the VM scope more efficiently.
Value * operator[](uint16_t id) noexcept
Get a value from its symbol id.
bool has(uint16_t id) noexcept
Check if the scope has a specific symbol in memory.
std::vector< std::pair< uint16_t, Value > > m_data
void push_back(uint16_t id, Value &&val) noexcept
Put a value in the scope.
uint16_t idFromValue(const Value &val) const noexcept
Get the id of a variable based on its value ; used for debug only.
std::size_t size() const noexcept
Return the size of the scope.
Scope() noexcept
Construct a new Scope object.