Setup for making script options non global if desired
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -325,7 +325,7 @@ namespace Porygon::Evaluation {
|
||||
arr[i] = parameters[i].Get();
|
||||
}
|
||||
delete function;
|
||||
return scriptOption -> Call(arr, parameters.size());
|
||||
return scriptOption -> Call(this -> _scriptOptions, arr, parameters.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "EvalValues/ScriptFunctionEvalValue.hpp"
|
||||
#include "EvaluationScope/EvaluationScope.hpp"
|
||||
#include "EvalValuePointer.hpp"
|
||||
#include "../ScriptOptions.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -21,7 +22,7 @@ namespace Porygon::Evaluation{
|
||||
bool _hasReturned;
|
||||
bool _hasBroken;
|
||||
|
||||
//Porygon::Script* _scriptData;
|
||||
const Porygon::ScriptOptions* _scriptOptions;
|
||||
shared_ptr<EvaluationScope> _evaluationScope;
|
||||
|
||||
void EvaluateStatement(const BoundStatement* statement);
|
||||
@@ -48,9 +49,9 @@ namespace Porygon::Evaluation{
|
||||
|
||||
EvalValuePointer GetVariable(const BoundVariableExpression *expression);
|
||||
public:
|
||||
explicit Evaluator(map<Utilities::HashedString, EvalValuePointer>* scriptVariables)
|
||||
explicit Evaluator(map<Utilities::HashedString, EvalValuePointer>* scriptVariables, const ScriptOptions* options)
|
||||
: _scriptVariables(scriptVariables), _hasReturned(false), _hasBroken(false), _returnValue(nullptr),
|
||||
_evaluationScope(nullptr){
|
||||
_evaluationScope(nullptr), _scriptOptions(options){
|
||||
}
|
||||
|
||||
const EvalValue* Evaluate(const BoundScriptStatement* statement);
|
||||
|
||||
Reference in New Issue
Block a user