ArkScript
A small, fast, functional and scripting language for video games
ValTableElem.cpp
Go to the documentation of this file.
2
3namespace Ark::internal
4{
5 ValTableElem::ValTableElem(double value) noexcept :
6 value(value),
8 {}
9
10 ValTableElem::ValTableElem(long value) noexcept :
11 value(static_cast<double>(value)),
13 {}
14
15 ValTableElem::ValTableElem(const std::string& value) noexcept :
16 value(value),
18 {}
19
21 {
22 if (v.nodeType() == NodeType::Number)
23 {
24 value = v.number();
26 }
27 else if (v.nodeType() == NodeType::String)
28 {
29 value = v.string();
31 }
32 }
33
34 ValTableElem::ValTableElem(std::size_t value) noexcept :
35 value(value),
37 {}
38
39 bool ValTableElem::operator==(const ValTableElem& A) noexcept
40 {
41 return A.value == value && A.type == type;
42 }
43}
The basic value type handled by the compiler.
A node of an Abstract Syntax Tree for ArkScript.
Definition: Node.hpp:29
A Compiler Value class helper to handle multiple types.
ValTableElem(double value) noexcept
Definition: ValTableElem.cpp:5
bool operator==(const ValTableElem &A) noexcept