locate method
locate the real caller: '#3 ...'
Implementation
// protected
Map? locate(String anchor, List<String> traces) {
bool flag = false;
for (var element in traces) {
if (checkAnchor(anchor, element)) {
// skip anchor(s)
flag = true;
} else if (flag) {
// get next element of the anchor(s)
return parseCaller(element);
}
}
assert(false, 'caller not found: $anchor -> $traces');
return null;
}