Added namespaces to most classes, general cleanup
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -3,42 +3,45 @@
|
||||
#include "StringEvalValue.hpp"
|
||||
#include <cstring>
|
||||
|
||||
extern "C" {
|
||||
TypeClass GetEvalValueTypeClass(EvalValue* v){
|
||||
namespace Porygon::Evaluation {
|
||||
|
||||
extern "C" {
|
||||
Porygon::TypeClass GetEvalValueTypeClass(EvalValue *v) {
|
||||
return v->GetTypeClass();
|
||||
}
|
||||
|
||||
int64_t EvaluateEvalValueInteger(EvalValue* v){
|
||||
int64_t EvaluateEvalValueInteger(EvalValue *v) {
|
||||
return v->EvaluateInteger();
|
||||
}
|
||||
|
||||
double EvaluateEvalValueFloat(EvalValue* v){
|
||||
double EvaluateEvalValueFloat(EvalValue *v) {
|
||||
return v->EvaluateFloat();
|
||||
}
|
||||
|
||||
bool EvaluateEvalValueBool(EvalValue* v){
|
||||
bool EvaluateEvalValueBool(EvalValue *v) {
|
||||
return v->EvaluateBool();
|
||||
}
|
||||
|
||||
const char16_t * EvaluateEvalValueString(EvalValue* v){
|
||||
return v->EvaluateString() -> c_str();
|
||||
const char16_t *EvaluateEvalValueString(EvalValue *v) {
|
||||
return v->EvaluateString()->c_str();
|
||||
}
|
||||
|
||||
EvalValue* CreateIntegerEvalValue(long l){
|
||||
EvalValue *CreateIntegerEvalValue(long l) {
|
||||
return new IntegerEvalValue(l);
|
||||
}
|
||||
|
||||
EvalValue* CreateFloatEvalValue(double d){
|
||||
EvalValue *CreateFloatEvalValue(double d) {
|
||||
return new FloatEvalValue(d);
|
||||
}
|
||||
|
||||
EvalValue* CreateBoolEvalValue(bool b){
|
||||
EvalValue *CreateBoolEvalValue(bool b) {
|
||||
return new BooleanEvalValue(b);
|
||||
}
|
||||
|
||||
EvalValue* CreateStringEvalValue(const char16_t * s){
|
||||
EvalValue *CreateStringEvalValue(const char16_t *s) {
|
||||
return new StringEvalValue(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TESTS_BUILD
|
||||
@@ -47,7 +50,7 @@ extern "C" {
|
||||
|
||||
|
||||
TEST_CASE( "Evaluate String", "[integration]" ) {
|
||||
auto script = Script::Create(u"\"foo bar\"");
|
||||
auto script = Porygon::Script::Create(u"\"foo bar\"");
|
||||
REQUIRE(!script->Diagnostics -> HasErrors());
|
||||
script->Evaluate();
|
||||
auto lastValue = script->GetLastValue();
|
||||
|
||||
Reference in New Issue
Block a user