From 3ddc966106cb24bdbfe5be6571291e76722b3ebb Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 30 Nov 2022 09:55:13 +0200 Subject: [PNP] Fixed retrieval of value in variable --- src/MemoryData.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/MemoryData.cpp') 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 argNames, int scopeStart, int scopeEnd) : argumentNames(argNames), scopeStart(scopeStart), scopeEnd(scopeEnd) { this->type = TFunc; } + +MemoryData* Function::clone() { + return new Function(*this); +} -- cgit v1.2.3