parents property

Iterable<AstNode> parents

Returns all parents of this node up to the root. If this node is the root, the iterable will be empty.

Implementation

Iterable<AstNode> get parents sync* {
  var node = parent;
  while (node != null) {
    yield node;
    node = node.parent;
  }
}