Allow non-local script functions to be called from outside the script

This commit is contained in:
2019-06-05 18:44:23 +02:00
parent 43dede9ae2
commit bda26b0ddf
6 changed files with 50 additions and 4 deletions

View File

@@ -9,6 +9,7 @@
#include "EvalValues/NumericEvalValue.hpp"
#include "EvalValues/StringEvalValue.hpp"
#include "EvalValues/StringEvalValue.hpp"
#include "EvalValues/ScriptFunctionEvalValue.hpp"
#include "EvaluationScope/EvaluationScope.hpp"
using namespace std;
@@ -21,6 +22,7 @@ class Evaluator {
EvaluationScope* _evaluationScope;
void EvaluateStatement(BoundStatement* statement);
void EvaluateBlockStatement(BoundBlockStatement* statement);
void EvaluateExpressionStatement(BoundExpressionStatement* statement);
void EvaluateAssignmentStatement(BoundAssignmentStatement* statement);
void EvaluateFunctionDeclarationStatement(BoundFunctionDeclarationStatement *statement);
@@ -52,7 +54,7 @@ public:
}
void Evaluate(BoundScriptStatement* statement);
void EvaluateBlockStatement(BoundBlockStatement* statement);
EvalValue* EvaluateFunction(ScriptFunctionEvalValue* func, vector<EvalValue*> parameters);
EvaluationScope* GetScope(){
return _evaluationScope;