12#ifndef ARK_VM_SCOPE_HPP
13#define ARK_VM_SCOPE_HPP
66 bool has(uint16_t
id)
noexcept;
97 [[nodiscard]] std::size_t
size()
const noexcept;
105 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.
uint16_t m_max_id
Maximum stored ID, used for a basic bloom filter.
void mergeRefInto(Scope &other)
Merge values from this scope as refs in the other scope.
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
uint16_t m_min_id
Minimum stored ID, used for a basic bloom filter.
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.
Value * operator[](uint16_t id_to_look_for) noexcept
Get a value from its symbol id.
std::size_t size() const noexcept
Return the size of the scope.
Scope() noexcept
Construct a new Scope object.
friend ARK_API bool operator==(const Scope &A, const Scope &B) noexcept