11#ifndef VM_VALUE_CLOSURE_HPP
12#define VM_VALUE_CLOSURE_HPP
54 [[nodiscard]]
const std::shared_ptr<ClosureScope>&
scopePtr()
const {
return m_scope; }
88 inline bool operator<(const Closure& A, const Closure& B) noexcept
90 return A.m_page_addr < B.m_page_addr;
95struct std::hash<Ark::internal::Closure>
97 [[nodiscard]] std::size_t operator()(const Ark::internal::Closure& s) const noexcept
99 return std::hash<Ark::internal::ClosureScope*> {}(s.m_scope.get());
The ArkScript virtual machine, executing ArkScript bytecode.
A class to store fields captured by a closure.
std::string toString(VM &vm) const noexcept
Print the closure to a string.
PageAddr_t pageAddr() const
friend ARK_API_INLINE bool operator<(const Closure &A, const Closure &B) noexcept
const ClosureScope & scope() const noexcept
ClosureScope & refScope() const noexcept
bool hasFieldEndingWith(const std::string &end, const VM &vm) const
Used when generating error messages in the VM, to see if a symbol might have been wrongly fully quali...
friend ARK_API bool operator==(const Closure &A, const Closure &B) noexcept
const std::shared_ptr< ClosureScope > & scopePtr() const
std::shared_ptr< ClosureScope > m_scope