Jump to specific function scope when calling function
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:
@@ -8,7 +8,7 @@ EvaluationScope::EvaluationScope(unordered_map<int, shared_ptr<EvalValue>> *scri
|
||||
_currentScope = -1;
|
||||
}
|
||||
|
||||
void EvaluationScope::CreateVariable(int scope, int id, shared_ptr<EvalValue> value) {
|
||||
void EvaluationScope::CreateVariable(int scope, int id, const shared_ptr<EvalValue>& value) {
|
||||
if (scope == 0){
|
||||
_scriptScope->at(id) = value;
|
||||
} else{
|
||||
@@ -16,7 +16,7 @@ void EvaluationScope::CreateVariable(int scope, int id, shared_ptr<EvalValue> va
|
||||
}
|
||||
}
|
||||
|
||||
void EvaluationScope::SetVariable(int scope, int id, shared_ptr<EvalValue> value) {
|
||||
void EvaluationScope::SetVariable(int scope, int id, const shared_ptr<EvalValue>& value) {
|
||||
if (scope == 0){
|
||||
_scriptScope->at(id) = value;
|
||||
} else{
|
||||
@@ -31,6 +31,10 @@ shared_ptr<EvalValue> EvaluationScope::GetVariable(int scope, int id) {
|
||||
return _localScope[scope - 1][id];
|
||||
}
|
||||
|
||||
void EvaluationScope::JumpToScope(int index){
|
||||
_currentScope = index;
|
||||
}
|
||||
|
||||
void EvaluationScope::OuterScope() {
|
||||
_currentScope++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user