Rework of evaluation variable handling, to account for functions having branching variable states
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-08 18:33:56 +02:00
parent 4d452b33e0
commit 471632c6e4
4 changed files with 57 additions and 13 deletions

View File

@@ -8,7 +8,7 @@
class EvaluationScope {
unordered_map<int, shared_ptr<EvalValue>>* _scriptScope;
vector<unordered_map<int, shared_ptr<EvalValue>>> _localScope;
vector<shared_ptr<unordered_map<int, shared_ptr<EvalValue>>>> _localScope;
int _currentScope;
public:
explicit EvaluationScope(unordered_map<int, shared_ptr<EvalValue>>* scriptVariables, int deepestScope);
@@ -20,11 +20,12 @@ public:
void InnerScope();
shared_ptr<EvalValue> GetVariable(int scope, int id);
void JumpToScope(int index);
EvaluationScope* CreateBranchingScope(int index);
int GetCurrentScope(){
return _currentScope;
}
};