Implements string evaluation and concat

This commit is contained in:
2019-05-25 16:15:20 +02:00
parent b536187593
commit 0205b92ae6
10 changed files with 123 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
#ifndef PORYGONLANG_NUMERICEVALVALUE_HPP
#define PORYGONLANG_NUMERICEVALVALUE_HPP
#include <sstream>
#include "EvalValue.hpp"
class NumericEvalValue : public EvalValue{
@@ -43,6 +44,12 @@ public:
long EvaluateInteger() final{
return _value;
}
std::string EvaluateString() final{
std::ostringstream strs;
strs << _value;
return strs.str();
}
};
class FloatEvalValue : public NumericEvalValue{
@@ -61,6 +68,12 @@ public:
double EvaluateFloat() final{
return _value;
}
std::string EvaluateString() final{
std::ostringstream strs;
strs << _value;
return strs.str();
}
};
#endif //PORYGONLANG_NUMERICEVALVALUE_HPP