Added namespaces to most classes, general cleanup
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -13,31 +13,38 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
class BoundScope {
|
||||
unordered_map<uint32_t, BoundVariable*>* _tableScope;
|
||||
vector<unordered_map<uint32_t, BoundVariable*>*> _localScope;
|
||||
int _currentScope;
|
||||
int _lastCreatedScope;
|
||||
public:
|
||||
explicit BoundScope(unordered_map<uint32_t, BoundVariable*> *tableScope);
|
||||
~BoundScope();
|
||||
namespace Porygon::Binder {
|
||||
class BoundScope {
|
||||
unordered_map<uint32_t, BoundVariable *> *_tableScope;
|
||||
vector<unordered_map<uint32_t, BoundVariable *> *> _localScope;
|
||||
int _currentScope;
|
||||
int _lastCreatedScope;
|
||||
public:
|
||||
explicit BoundScope(unordered_map<uint32_t, BoundVariable *> *tableScope);
|
||||
|
||||
void GoInnerScope();
|
||||
void GoOuterScope();
|
||||
~BoundScope();
|
||||
|
||||
int Exists(int key);
|
||||
BoundVariable* GetVariable(uint32_t scope, uint32_t identifier);
|
||||
VariableAssignment CreateExplicitLocal(uint32_t identifier, std::shared_ptr<ScriptType> type);
|
||||
VariableAssignment AssignVariable(uint32_t identifier, const std::shared_ptr<ScriptType>& type);
|
||||
void GoInnerScope();
|
||||
|
||||
size_t GetLocalVariableCount(){
|
||||
return _localScope.size();
|
||||
}
|
||||
void GoOuterScope();
|
||||
|
||||
int GetCurrentScope(){
|
||||
return _currentScope;
|
||||
}
|
||||
};
|
||||
int Exists(int key);
|
||||
|
||||
BoundVariable *GetVariable(uint32_t scope, uint32_t identifier);
|
||||
|
||||
VariableAssignment CreateExplicitLocal(uint32_t identifier, std::shared_ptr<ScriptType> type);
|
||||
|
||||
VariableAssignment AssignVariable(uint32_t identifier, const std::shared_ptr<ScriptType> &type);
|
||||
|
||||
size_t GetLocalVariableCount() {
|
||||
return _localScope.size();
|
||||
}
|
||||
|
||||
int GetCurrentScope() {
|
||||
return _currentScope;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //PORYGONLANG_BOUNDSCOPE_HPP
|
||||
|
||||
Reference in New Issue
Block a user