Iterable<Path> ancestors() sync* { yield this; Path? current = parent().toNullable(); while (current != null) { yield current; current = current.parent().toNullable(); } }