Remove all variables with a scope greater than the parameter
| 160 | |
| 161 | // Remove all variables with a scope greater than the parameter |
| 162 | void VariableSet::EndScope(uint8_t blockNesting) noexcept |
| 163 | { |
| 164 | LinkedVariable *prev = nullptr; |
| 165 | for (LinkedVariable *lv = root; lv != nullptr; ) |
| 166 | { |
| 167 | if (lv->v.GetScope() > (int16_t)blockNesting) |
| 168 | { |
| 169 | LinkedVariable *temp = lv; |
| 170 | lv = lv->next; |
| 171 | if (prev == nullptr) |
| 172 | { |
| 173 | root = lv; |
| 174 | } |
| 175 | else |
| 176 | { |
| 177 | prev->next = lv; |
| 178 | } |
| 179 | delete temp; |
| 180 | } |
| 181 | else |
| 182 | { |
| 183 | prev = lv; |
| 184 | lv = lv->next; |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | void VariableSet::Delete(const char *_ecv_array str) noexcept |
| 190 | { |