![]() |
ArkScript
A small, lisp-inspired, functional scripting language
|
#include <Value.hpp>
Public Types | |
using | Number_t = double |
using | String_t = std::string |
using | List_t = std::vector<Value> |
using | Ref_t = Value* |
using | Dict_t = internal::Dict |
using | Value_t |
Public Member Functions | |
Value () noexcept | |
Construct a new Value object. | |
Value (ValueType type) noexcept | |
Construct a new Value object. | |
template<typename T > | |
Value (const ValueType type, T &&value) noexcept | |
Construct a new Value object. | |
Value (int value) noexcept | |
Value (double value) noexcept | |
Value (const String_t &value) noexcept | |
Value (const char *value) noexcept | |
Value (internal::PageAddr_t value) noexcept | |
Value (Procedure &&value) noexcept | |
Value (List_t &&value) noexcept | |
Value (internal::Closure &&value) noexcept | |
Value (UserType &&value) noexcept | |
Value (Dict_t &&value) noexcept | |
Value (Ref_t ref) noexcept | |
ValueType | valueType () const noexcept |
bool | isFunction () const noexcept |
bool | isIndexable () const noexcept |
Number_t | number () const |
const String_t & | string () const |
String_t & | stringRef () |
const List_t & | constList () const |
List_t & | list () |
const UserType & | usertype () const |
UserType & | usertypeRef () |
const Dict_t & | dict () const |
Dict_t & | dictRef () |
Ref_t | reference () const |
void | push_back (const Value &value) |
Add an element to the list held by the value (if the value type is set to list) | |
void | push_back (Value &&value) |
Add an element to the list held by the value (if the value type is set to list) | |
std::string | toString (VM &vm) const noexcept |
Private Member Functions | |
constexpr uint8_t | typeNum () const noexcept |
internal::PageAddr_t | pageAddr () const |
const Procedure & | proc () const |
const internal::Closure & | closure () const |
internal::Closure & | refClosure () |
Private Attributes | |
ValueType | m_type |
Value_t | m_value |
Friends | |
class | Ark::VM |
class | Ark::BytecodeReader |
struct | std::hash< Ark::Value > |
ARK_API bool | operator== (const Value &A, const Value &B) |
ARK_API_INLINE bool | operator< (const Value &A, const Value &B) |
ARK_API_INLINE bool | operator! (const Value &A) |
using Ark::Value::Dict_t = internal::Dict |
using Ark::Value::List_t = std::vector<Value> |
using Ark::Value::Number_t = double |
using Ark::Value::Ref_t = Value* |
using Ark::Value::String_t = std::string |
using Ark::Value::Value_t |
|
noexcept |
|
explicitnoexcept |
Construct a new Value object.
type | the value type which is going to be held |
Definition at line 14 of file Value.cpp.
References Ark::List, and Ark::String.
|
inlinenoexcept |
|
explicitnoexcept |
|
explicitnoexcept |
|
explicitnoexcept |
|
inlinenodiscardprivate |
|
inlinenodiscard |
Definition at line 168 of file Value.hpp.
Referenced by Ark::helper::head(), Ark::VM::safeRun(), and Ark::helper::tail().
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
Definition at line 157 of file Value.hpp.
Referenced by Ark::VM::safeRun().
|
inlinenodiscard |
Definition at line 169 of file Value.hpp.
Referenced by Ark::helper::at(), Ark::VM::createList(), push_back(), push_back(), Ark::VM::safeRun(), and Ark::State::setArgs().
|
inlinenodiscard |
Definition at line 162 of file Value.hpp.
Referenced by Ark::helper::at(), and Ark::VM::safeRun().
|
inlinenodiscardprivate |
Definition at line 209 of file Value.hpp.
Referenced by Ark::VM::backtrace(), and Ark::VM::safeRun().
|
inlinenodiscardprivate |
void Ark::Value::push_back | ( | const Value & | value | ) |
Add an element to the list held by the value (if the value type is set to list)
value |
Definition at line 67 of file Value.cpp.
References list().
Referenced by Ark::VM::createList(), and Ark::VM::listAppendInPlace().
void Ark::Value::push_back | ( | Value && | value | ) |
|
inlinenodiscardprivate |
Definition at line 212 of file Value.hpp.
Referenced by Ark::VM::getField(), and Ark::VM::safeRun().
|
inlinenodiscard |
Definition at line 177 of file Value.hpp.
Referenced by Ark::VM::safeRun().
|
inlinenodiscard |
Definition at line 164 of file Value.hpp.
Referenced by Ark::helper::at(), Ark::internal::ASTLowerer::compileExpression(), Ark::helper::head(), Ark::VM::safeRun(), and Ark::helper::tail().
|
inlinenodiscard |
Definition at line 165 of file Value.hpp.
Referenced by Ark::helper::head(), Ark::VM::safeRun(), and Ark::helper::tail().
|
noexcept |
Definition at line 77 of file Value.cpp.
References Ark::Closure, Ark::CProc, Ark::Dict, Ark::False, Ark::InstPtr, Ark::List, Ark::Nil, Ark::Number, Ark::PageAddr, Ark::Reference, Ark::String, Ark::True, Ark::Undefined, and Ark::User.
Referenced by Ark::helper::at(), and Ark::VM::safeRun().
|
inlinenodiscardconstexprprivatenoexcept |
|
inlinenodiscard |
|
inlinenodiscardnoexcept |
Definition at line 151 of file Value.hpp.
Referenced by Ark::helper::at(), Ark::VM::backtrace(), Ark::types::generateError(), Ark::VM::getField(), Ark::helper::head(), Ark::VM::listAppendInPlace(), Ark::VM::safeRun(), and Ark::helper::tail().
|
friend |
|
friend |
|
friend |
|
friend |