Initial work on standard library
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-29 16:18:59 +02:00
parent ecfc1ae3b7
commit 24c560b52d
12 changed files with 213 additions and 22 deletions

View File

@@ -49,7 +49,7 @@ namespace Porygon::Evaluation{
return new BooleanEvalValue(b);
}
static EvalValue* Create(const string& s){
return new StringEvalValue(Utilities::StringUtils::StringToU16String(s));
return new StringEvalValue(Utilities::StringUtils::ToUTF8(s));
}
static EvalValue* Create(u16string s){
return new StringEvalValue(std::move(s));

View File

@@ -0,0 +1,25 @@
#ifndef PORYGONLANG_NILEVALVALUE_HPP
#define PORYGONLANG_NILEVALVALUE_HPP
#include "EvalValue.hpp"
namespace Porygon::Evaluation{
class NilEvalValue : public EvalValue{
const TypeClass GetTypeClass() const final{
return TypeClass ::Nil;
}
const bool operator==(EvalValue *b) const final{
return b->GetTypeClass() == TypeClass ::Nil;
}
const shared_ptr<EvalValue> Clone() const final{
return make_shared<NilEvalValue>();
}
const std::size_t GetHashCode() const final{
return 0;
}
};
}
#endif //PORYGONLANG_NILEVALVALUE_HPP