summaryrefslogtreecommitdiff
path: root/src/MemoryData.cpp
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2022-11-30 09:55:13 +0200
committerSyndamia <kamen@syndamia.com>2022-11-30 09:55:13 +0200
commit3ddc966106cb24bdbfe5be6571291e76722b3ebb (patch)
tree353365046cacc7613999283092d3f9bdbac92cdc /src/MemoryData.cpp
parent8cf23935113ad8f35c294f23148ec0ff7d99c4e9 (diff)
downloadarzu-interpreter-3ddc966106cb24bdbfe5be6571291e76722b3ebb.tar
arzu-interpreter-3ddc966106cb24bdbfe5be6571291e76722b3ebb.tar.gz
arzu-interpreter-3ddc966106cb24bdbfe5be6571291e76722b3ebb.zip
[PNP] Fixed retrieval of value in variable
Diffstat (limited to 'src/MemoryData.cpp')
-rw-r--r--src/MemoryData.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/MemoryData.cpp b/src/MemoryData.cpp
index 34e2877..fa7f024 100644
--- a/src/MemoryData.cpp
+++ b/src/MemoryData.cpp
@@ -7,6 +7,10 @@ MemoryData::Type MemoryData::get_type() const {
MemoryData::MemoryData() : type(TNone) {}
+MemoryData* MemoryData::clone() {
+ return new MemoryData(*this);
+}
+
Name::Name() : value() {
this->type = TName;
}
@@ -15,10 +19,22 @@ Name::Name(string& str) : value(str) {
this->type = TName;
}
+MemoryData* Name::clone() {
+ return new Name(*this);
+}
+
Int::Int(int num) : value(num) {
this->type = TInt;
}
+MemoryData* Int::clone() {
+ return new Int(*this);
+}
+
Function::Function(list<string> argNames, int scopeStart, int scopeEnd) : argumentNames(argNames), scopeStart(scopeStart), scopeEnd(scopeEnd) {
this->type = TFunc;
}
+
+MemoryData* Function::clone() {
+ return new Function(*this);
+}