Implements complex tables
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-12 15:19:28 +02:00
parent ba4fe888fa
commit c022c91777
21 changed files with 272 additions and 50 deletions

View File

@@ -7,17 +7,17 @@
#include "../EvalValues/EvalValue.hpp"
class EvaluationScope {
unordered_map<int, shared_ptr<EvalValue>>* _scriptScope;
unordered_map<size_t, shared_ptr<EvalValue>>* _scriptScope;
vector<shared_ptr<unordered_map<int, shared_ptr<EvalValue>>>> _localScope;
int _currentScope;
public:
explicit EvaluationScope(unordered_map<int, shared_ptr<EvalValue>>* scriptVariables, int deepestScope);
explicit EvaluationScope(unordered_map<size_t, shared_ptr<EvalValue>>* scriptVariables, int deepestScope);
~EvaluationScope() = default;
void CreateVariable(int scope, int id, const shared_ptr<EvalValue>& value);
void SetVariable(int scope, int id, const shared_ptr<EvalValue>& value);
void OuterScope();
void InnerScope();
void InnerScope(bool clearScope = true);
shared_ptr<EvalValue> GetVariable(int scope, int id);
EvaluationScope* CreateBranchingScope(int index);