allChildren method

Set<Parser> allChildren(
  1. Parser parser
)

Returns a set of all deep children reachable from parser.

The returned set does only include the parser itself, if it is recursively calling itself.

Implementation

Set<Parser> allChildren(Parser parser) {
  assert(parsers.contains(parser), 'parser is not part of the analyzer');
  return _allChildren.putIfAbsent(
    parser,
    () => parser.children.fold(
      <Parser>{},
      (result, child) => result..addAll(allParser(child)),
    ),
  );
}