Work on making userdata work through extern C entry points
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-14 22:21:33 +02:00
parent 2c313791d9
commit 7c345d85e8
22 changed files with 128 additions and 51 deletions

View File

@@ -14,21 +14,21 @@
using namespace std;
class BoundScope {
unordered_map<int, BoundVariable*>* _tableScope;
vector<unordered_map<int, BoundVariable*>*> _localScope;
unordered_map<uint32_t, BoundVariable*>* _tableScope;
vector<unordered_map<uint32_t, BoundVariable*>*> _localScope;
int _currentScope;
int _lastCreatedScope;
public:
explicit BoundScope(unordered_map<int, BoundVariable*> *tableScope);
explicit BoundScope(unordered_map<uint32_t, BoundVariable*> *tableScope);
~BoundScope();
void GoInnerScope();
void GoOuterScope();
int Exists(int key);
BoundVariable* GetVariable(int scope, int identifier);
VariableAssignment CreateExplicitLocal(int identifier, std::shared_ptr<ScriptType> type);
VariableAssignment AssignVariable(int identifier, const std::shared_ptr<ScriptType>& type);
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();