locate method

Map? locate(
  1. String anchor,
  2. List<String> traces
)

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;
}