Call pop repeatedly until the name of the current scope is the same as name.
name
void popUntil(String name) { while (current.name != name && current.name != rootName) { pop(); } }