Handle bound classes as constants during evaluation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -7,7 +7,7 @@ EvaluationScope::EvaluationScope(unordered_map<size_t, shared_ptr<EvalValue>> *s
|
||||
_localScope = unordered_map<uint64_t, shared_ptr<EvalValue>>(localVariableCount);
|
||||
}
|
||||
|
||||
void EvaluationScope::CreateVariable(BoundVariableKey* key, const shared_ptr<EvalValue> &value) {
|
||||
void EvaluationScope::CreateVariable(const BoundVariableKey* key, const shared_ptr<EvalValue> &value) {
|
||||
if (key->GetScopeId() == 0){
|
||||
_scriptScope -> at(key->GetIdentifier()) = value;
|
||||
} else{
|
||||
@@ -18,7 +18,7 @@ void EvaluationScope::CreateVariable(BoundVariableKey* key, const shared_ptr<Eva
|
||||
}
|
||||
}
|
||||
|
||||
void EvaluationScope::SetVariable(BoundVariableKey* key, const shared_ptr<EvalValue> &value) {
|
||||
void EvaluationScope::SetVariable(const BoundVariableKey* key, const shared_ptr<EvalValue> &value) {
|
||||
if (key->GetScopeId() == 0){
|
||||
_scriptScope -> at(key->GetIdentifier()) = value;
|
||||
} else{
|
||||
@@ -26,7 +26,7 @@ void EvaluationScope::SetVariable(BoundVariableKey* key, const shared_ptr<EvalVa
|
||||
}
|
||||
}
|
||||
|
||||
shared_ptr<EvalValue> EvaluationScope::GetVariable(BoundVariableKey* key) {
|
||||
shared_ptr<EvalValue> EvaluationScope::GetVariable(const BoundVariableKey* key) {
|
||||
if (key->GetScopeId() == 0){
|
||||
return _scriptScope -> at(key->GetIdentifier());
|
||||
} else{
|
||||
|
||||
@@ -13,9 +13,9 @@ public:
|
||||
explicit EvaluationScope(unordered_map<size_t, shared_ptr<EvalValue>>* scriptVariables, int deepestScope);
|
||||
~EvaluationScope() = default;
|
||||
|
||||
void CreateVariable(BoundVariableKey* key, const shared_ptr<EvalValue>& value);
|
||||
void SetVariable(BoundVariableKey* key, const shared_ptr<EvalValue>& value);
|
||||
shared_ptr<EvalValue> GetVariable(BoundVariableKey* key);
|
||||
void CreateVariable(const BoundVariableKey* key, const shared_ptr<EvalValue>& value);
|
||||
void SetVariable(const BoundVariableKey* key, const shared_ptr<EvalValue>& value);
|
||||
shared_ptr<EvalValue> GetVariable(const BoundVariableKey* key);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user