Implements variable assignment evaluation
This commit is contained in:
@@ -16,6 +16,7 @@ Script::Script() {
|
||||
_evaluator = new Evaluator(this);
|
||||
_lastValue = nullptr;
|
||||
BoundScript = nullptr;
|
||||
_scriptVariables = new unordered_map<int, EvalValue*>(0);
|
||||
}
|
||||
|
||||
void Script::Evaluate() {
|
||||
@@ -27,6 +28,8 @@ Script::~Script() {
|
||||
delete this -> BoundScript;
|
||||
delete this -> _lastValue;
|
||||
delete this -> _evaluator;
|
||||
this->_scriptVariables->clear();
|
||||
delete this->_scriptVariables;
|
||||
}
|
||||
|
||||
void Script::Parse(string script) {
|
||||
@@ -43,7 +46,7 @@ void Script::Parse(string script) {
|
||||
auto bindScope = new BoundScope(&scriptScope);
|
||||
this->BoundScript = Binder::Bind(this, parseResult, bindScope);
|
||||
for (const auto& v : scriptScope){
|
||||
this->_scopeVariables.insert({v.first, nullptr});
|
||||
this->_scriptVariables -> insert({v.first, nullptr});
|
||||
delete v.second;
|
||||
}
|
||||
scriptScope.clear();
|
||||
|
||||
Reference in New Issue
Block a user