Implements string evaluation and concat
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user