Implements complex tables
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:
@@ -2,7 +2,7 @@
|
||||
#include "EvaluationScope.hpp"
|
||||
#include <memory>
|
||||
|
||||
EvaluationScope::EvaluationScope(unordered_map<int, shared_ptr<EvalValue>> *scriptVariables, int deepestScope) {
|
||||
EvaluationScope::EvaluationScope(unordered_map<size_t, shared_ptr<EvalValue>> *scriptVariables, int deepestScope) {
|
||||
_scriptScope = scriptVariables;
|
||||
_localScope = vector<shared_ptr<unordered_map<int, shared_ptr<EvalValue>>>>(deepestScope);
|
||||
for (int i = 0; i < deepestScope; i++){
|
||||
@@ -42,6 +42,7 @@ EvaluationScope* EvaluationScope::CreateBranchingScope(int index){
|
||||
for (int i = 0; i < index; i++){
|
||||
scope->_localScope[i] = this->_localScope[i];
|
||||
}
|
||||
scope->_currentScope = index;
|
||||
return scope;
|
||||
}
|
||||
|
||||
@@ -49,9 +50,11 @@ void EvaluationScope::OuterScope() {
|
||||
_currentScope++;
|
||||
}
|
||||
|
||||
void EvaluationScope::InnerScope() {
|
||||
auto scope = this->_localScope[_currentScope];
|
||||
scope->clear();
|
||||
void EvaluationScope::InnerScope(bool clearScope) {
|
||||
if (clearScope){
|
||||
auto scope = this->_localScope[_currentScope];
|
||||
scope->clear();
|
||||
}
|
||||
_currentScope--;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user