Initial work on standard library
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:
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "EvaluationScope.hpp"
|
||||
#include "../../StandardLibraries/StaticScope.hpp"
|
||||
#include <memory>
|
||||
|
||||
namespace Porygon::Evaluation {
|
||||
@@ -29,8 +30,11 @@ namespace Porygon::Evaluation {
|
||||
}
|
||||
|
||||
shared_ptr<EvalValue> EvaluationScope::GetVariable(const BoundVariableKey *key) {
|
||||
if (key->GetScopeId() == 0) {
|
||||
auto scopeId = key -> GetScopeId();
|
||||
if (scopeId== 0) {
|
||||
return _scriptScope->at(key->GetIdentifier());
|
||||
} else if(scopeId == -2){
|
||||
return StandardLibraries::StaticScope::GetVariable(key->GetIdentifier());
|
||||
} else {
|
||||
return _localScope[key->GetHash()];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user