MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / EndScope

Method EndScope

src/ObjectModel/Variable.cpp:162–187  ·  view source on GitHub ↗

Remove all variables with a scope greater than the parameter

Source from the content-addressed store, hash-verified

160
161// Remove all variables with a scope greater than the parameter
162void 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
189void VariableSet::Delete(const char *_ecv_array str) noexcept
190{

Callers 1

EndBlockMethod · 0.80

Calls 1

GetScopeMethod · 0.80

Tested by

no test coverage detected