More fixes for boundscope

This commit is contained in:
2019-05-28 18:50:23 +02:00
parent 2c84c1e229
commit 6185f755a4
6 changed files with 58 additions and 20 deletions

View File

@@ -14,16 +14,20 @@ using namespace std;
class BoundScope {
unordered_map<int, BoundVariable*>* _scriptScope;
vector<unordered_map<int, BoundVariable*>> _localScope;
vector<unordered_map<int, BoundVariable*>*> _localScope;
int _currentScope;
int _deepestScope;
public:
explicit BoundScope(unordered_map<int, BoundVariable*> *scriptScope);
~BoundScope();
void GoInnerScope();
void GoOuterScope();
int Exists(int key);
BoundVariable* GetVariable(int scope, int identifier);
VariableAssignment CreateExplicitLocal(int identifier, ScriptType* type);
VariableAssignment AssignVariable(int identifier, ScriptType* type);
VariableAssignment CreateExplicitLocal(int identifier, const ScriptType& type);
VariableAssignment AssignVariable(int identifier, const ScriptType& type);
};