findPathTo method

ParserPath? findPathTo(
  1. Parser source,
  2. Parser target
)

Returns the shortest path from source to target, if any.

Implementation

ParserPath? findPathTo(Parser source, Parser target) {
  assert(parsers.contains(target), 'target is not part of the analyzer');
  return findPath(source, (path) => path.target == target);
}