diff --git a/src/Evaluator/EvalValues/EvalValue.cpp b/src/Evaluator/EvalValues/EvalValue.cpp index 134a437..981fd9c 100644 --- a/src/Evaluator/EvalValues/EvalValue.cpp +++ b/src/Evaluator/EvalValues/EvalValue.cpp @@ -1,4 +1,6 @@ #include "EvalValue.hpp" +#include "NumericEvalValue.hpp" +#include "StringEvalValue.hpp" #include extern "C" { @@ -26,6 +28,21 @@ extern "C" { return v->EvaluateString() -> c_str(); } + EvalValue* CreateIntegerEvalValue(long l){ + return new IntegerEvalValue(l); + } + + EvalValue* CreateFloatEvalValue(double d){ + return new FloatEvalValue(d); + } + + EvalValue* CreateBoolEvalValue(bool b){ + return new BooleanEvalValue(b); + } + + EvalValue* CreateStringEvalValue(const char* s){ + return new StringEvalValue(s); + } } #ifdef TESTS_BUILD diff --git a/src/Script.cpp b/src/Script.cpp index ea7636e..f3ae89a 100644 --- a/src/Script.cpp +++ b/src/Script.cpp @@ -1,6 +1,6 @@ #include - -#include +#include +#include #include #include "Script.hpp" #include "Parser/Lexer.hpp" @@ -97,6 +97,15 @@ extern "C" { EvalValue* GetVariable(Script* script, const char* key){ return script->GetVariable(key); } + + bool HasFunction(Script* script, const char* key){ + return script->HasFunction(key); + } + + EvalValue* CallFunction(Script* script, const char* key, EvalValue* parameters[], int parameterCount){ + std::vector v(parameters, parameters + parameterCount); + return script->CallFunction(key, v); + } }