mainline method

Iterable<T> mainline()

Implements an Iterable to iterate the mainline.

Implementation

Iterable<T> mainline() sync* {
  var node = this;
  while (node.children.isNotEmpty) {
    final child = node.children[0];
    yield child.data;
    node = child;
  }
}