findPath method

ParserPath? findPath(
  1. Parser source,
  2. bool predicate(
    1. ParserPath path
    )
)

Returns the shortest path from source that satisfies the given predicate, if any.

Implementation

ParserPath? findPath(
  Parser source,
  bool Function(ParserPath path) predicate,
) {
  assert(parsers.contains(source), 'source is not part of the analyzer');
  return breadthFirstSearch(source, predicate);
}